diff options
author | Max <max@nextcloud.com> | 2022-06-20 15:58:35 +0300 |
---|---|---|
committer | Max <max@nextcloud.com> | 2022-06-20 17:10:41 +0300 |
commit | ffba7078009733585c208b5d2549c3c20ca1e00a (patch) | |
tree | 25136c955a8d38b52ddb3ed557d4ee783a200a66 /cypress | |
parent | 0f961fc98ba26d986a18dd8a954f1d4c825a9335 (diff) |
text: fix cypress selector to find the right image
`get().filter()` might not take into account elements
that did not exist in the dom yet when the `get` part was fired.
`.filter()` would then wait for the elements that already existed
during `.get()` to contain the newly created image.
Signed-off-by: Max <max@nextcloud.com>
Diffstat (limited to 'cypress')
-rw-r--r-- | cypress/e2e/images.spec.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cypress/e2e/images.spec.js b/cypress/e2e/images.spec.js index 0926dd6d1..5c9d98032 100644 --- a/cypress/e2e/images.spec.js +++ b/cypress/e2e/images.spec.js @@ -79,11 +79,11 @@ const clickOnImageAction = (actionName) => { */ const checkImage = (documentId, imageName, imageId, index) => { const encodedName = fixedEncodeURIComponent(imageName) + const src = `.attachments.${documentId}/${encodedName}` - cy.log('Check the image is visible and well formed', { documentId, imageName, imageId, index, encodedName }) + cy.log('Check the image is visible and well formed', documentId, imageName, imageId, index, encodedName) return new Cypress.Promise((resolve, reject) => { - cy.get('#editor [data-component="image-view"]') - .filter('[data-src=".attachments.' + documentId + '/' + encodedName + '"]') + cy.get(`#editor [data-component="image-view"][data-src="${src}"]`) .find('.image__view') // wait for load finish .within(($el) => { // keep track that we have created this image in the attachment dir |