diff --git a/test/cypress/integration/route/cmr/cmrList.spec.js b/test/cypress/integration/route/cmr/cmrList.spec.js index b3561708d95..d33508e3a33 100644 --- a/test/cypress/integration/route/cmr/cmrList.spec.js +++ b/test/cypress/integration/route/cmr/cmrList.spec.js @@ -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); }); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 90e7e08df1f..c8fccbd5d49 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -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);