refactor: refs #8484 simplify image dialog test by using aliases for elements
gitea/salix-front/pipeline/pr-dev Build queued... Details

This commit is contained in:
Jorge Penadés 2025-02-26 13:30:39 +01:00
parent bc2b5976d9
commit b91f159061
1 changed files with 7 additions and 7 deletions

View File

@ -23,18 +23,18 @@ describe('ClaimPhoto', () => {
}); });
it('should open first image dialog change to second and close', () => { it('should open first image dialog change to second and close', () => {
cy.get( cy.get(':nth-child(1) > .q-card > .q-img > .q-img__container > .q-img__image')
':nth-child(1) > .q-card > .q-img > .q-img__container > .q-img__image', .as('firstImage')
).click(); .click();
cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should( cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should(
'be.visible', 'be.visible',
); );
cy.get('.q-carousel__control > button').click(); cy.get('.q-carousel__control > button').as('nextButton').click();
cy.get( cy.get('.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon')
'.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon', .as('closeButton')
).click(); .click();
cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should( cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should(
'not.be.visible', 'not.be.visible',
); );