test: refs #8621 ensure elements are visible before interaction in cmrList tests
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jose Antonio Tubau 2025-03-17 14:09:14 +01:00
parent aa9e0bb2a2
commit 93b5be7628
2 changed files with 13 additions and 12 deletions

View File

@ -33,8 +33,8 @@ describe('Cmr list', () => {
it('Should download selected cmr', () => {
const downloadsFolder = Cypress.config('downloadsFolder');
cy.get(selectors.lastRowSelectCheckBox).click();
cy.get(selectors.downloadBtn).click();
cy.get(selectors.lastRowSelectCheckBox).should('be.visible').click();
cy.get(selectors.downloadBtn).should('be.visible').click();
cy.wait(3000);
const fileName = 'cmrs.zip';
@ -51,19 +51,19 @@ describe('Cmr list', () => {
describe('Ticket pop-ups', () => {
it('Should redirect to the ticket summary from the ticket descriptor pop-up', () => {
cy.get(selectors.ticket).click();
cy.get(selectors.ticket).should('be.visible').click();
cy.containContent(selectors.descriptorId, data.ticket);
cy.get(selectors.descriptorGoToSummaryBtn).click();
cy.get(selectors.descriptorGoToSummaryBtn).should('be.visible').click();
cy.url().should('include', '/ticket/1/summary');
cy.containContent(selectors.summaryTitle, data.client);
});
it('Should redirect to the ticket summary from summary pop-up from the ticket descriptor pop-up', () => {
cy.get(selectors.ticket).click();
cy.get(selectors.ticket).should('be.visible').click();
cy.containContent(selectors.descriptorId, data.ticket);
cy.get(selectors.descriptorOpenSummaryBtn).click();
cy.get(selectors.descriptorOpenSummaryBtn).should('be.visible').click();
cy.containContent(selectors.summaryTitle, data.client);
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click();
cy.url().should('include', '/ticket/1/summary');
cy.containContent(selectors.summaryTitle, data.client);
});
@ -71,19 +71,19 @@ describe('Cmr list', () => {
describe('Client pop-ups', () => {
it('Should redirect to the client summary from the client descriptor pop-up', () => {
cy.get(selectors.client).click();
cy.get(selectors.client).should('be.visible').click();
cy.containContent(selectors.descriptorTitle, data.client);
cy.get(selectors.descriptorGoToSummaryBtn).click();
cy.get(selectors.descriptorGoToSummaryBtn).should('be.visible').click();
cy.url().should('include', '/customer/1101/summary');
cy.containContent(selectors.summaryTitle, data.client);
});
it('Should redirect to the client summary from summary pop-up from the client descriptor pop-up', () => {
cy.get(selectors.client).click();
cy.get(selectors.client).should('be.visible').click();
cy.containContent(selectors.descriptorTitle, data.client);
cy.get(selectors.descriptorOpenSummaryBtn).click();
cy.get(selectors.descriptorOpenSummaryBtn).should('be.visible').click();
cy.containContent(selectors.summaryTitle, data.client);
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click();
cy.url().should('include', '/customer/1101/summary');
cy.containContent(selectors.summaryTitle, data.client);
});

View File

@ -324,6 +324,7 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => {
Cypress.Commands.add('containContent', (selector, expectedValue) => {
cy.get(selector)
.should('be.visible')
.invoke('text')
.then((text) => {
expect(text).to.include(expectedValue);