From 44be16e43a991ef016995ea0f8aaae489da3b44e Mon Sep 17 00:00:00 2001 From: provira Date: Tue, 4 Mar 2025 08:54:18 +0100 Subject: [PATCH] fix: refs #8417 fixed e2e test --- .../integration/claim/claimPhoto.spec.js | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/test/cypress/integration/claim/claimPhoto.spec.js b/test/cypress/integration/claim/claimPhoto.spec.js index c3b312a23..324646a87 100755 --- a/test/cypress/integration/claim/claimPhoto.spec.js +++ b/test/cypress/integration/claim/claimPhoto.spec.js @@ -1,5 +1,7 @@ /// describe('ClaimPhoto', () => { + const carrouselClose = '.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon'; + const carrousel = '.q-carousel__slide > .q-img > .q-img__container > .q-img__image'; beforeEach(() => { const claimId = 1; cy.login('developer'); @@ -23,23 +25,15 @@ describe('ClaimPhoto', () => { }); it('should open first image dialog change to second and close', () => { - cy.waitForElement('[data-cy="file-1"] .q-img__image--loaded'); - cy.get( - ':nth-child(1) > .q-card > .q-img > .q-img__container > .q-img__image', - ).click(); - cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should( - 'be.visible', - ); + cy.dataCy('file-1').click(); + cy.get(carrouselClose).click(); + cy.get(carrousel).should('not.be.visible'); + cy.dataCy('file-1').click(); + cy.get(carrousel).should('be.visible'); cy.get('.q-carousel__control > button').as('nextButton').click(); - - cy.get( - '.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon', - ).click(); - - cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should( - 'not.be.visible', - ); + cy.get(carrouselClose,).click(); + cy.get(carrousel).should('not.be.visible'); }); it('should remove third and fourth file', () => {