Skip to content

Commit 10daea3

Browse files
author
Julien Veyssier
authored
Merge pull request #2603 from nextcloud/test/fix-cypress-selector
text: fix cypress selector to find the right image
2 parents 0f961fc + ffba707 commit 10daea3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cypress/e2e/images.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ const clickOnImageAction = (actionName) => {
7979
*/
8080
const checkImage = (documentId, imageName, imageId, index) => {
8181
const encodedName = fixedEncodeURIComponent(imageName)
82+
const src = `.attachments.${documentId}/${encodedName}`
8283

83-
cy.log('Check the image is visible and well formed', { documentId, imageName, imageId, index, encodedName })
84+
cy.log('Check the image is visible and well formed', documentId, imageName, imageId, index, encodedName)
8485
return new Cypress.Promise((resolve, reject) => {
85-
cy.get('#editor [data-component="image-view"]')
86-
.filter('[data-src=".attachments.' + documentId + '/' + encodedName + '"]')
86+
cy.get(`#editor [data-component="image-view"][data-src="${src}"]`)
8787
.find('.image__view') // wait for load finish
8888
.within(($el) => {
8989
// keep track that we have created this image in the attachment dir

0 commit comments

Comments
 (0)