fix: refs #8417 fixed e2e test

This commit is contained in:
PAU ROVIRA ROSALENY 2025-03-04 08:54:18 +01:00
parent 15db69be9c
commit 44be16e43a
1 changed files with 9 additions and 15 deletions

View File

@ -1,5 +1,7 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('ClaimPhoto', () => { 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(() => { beforeEach(() => {
const claimId = 1; const claimId = 1;
cy.login('developer'); cy.login('developer');
@ -23,23 +25,15 @@ 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.waitForElement('[data-cy="file-1"] .q-img__image--loaded'); cy.dataCy('file-1').click();
cy.get( cy.get(carrouselClose).click();
':nth-child(1) > .q-card > .q-img > .q-img__container > .q-img__image', cy.get(carrousel).should('not.be.visible');
).click();
cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should(
'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-carousel__control > button').as('nextButton').click();
cy.get(carrouselClose,).click();
cy.get( cy.get(carrousel).should('not.be.visible');
'.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',
);
}); });
it('should remove third and fourth file', () => { it('should remove third and fourth file', () => {