From 3062cbaef7da111b05f1b270bdb3dd667ad3d7ff Mon Sep 17 00:00:00 2001 From: Charles-Pham Date: Wed, 5 Feb 2025 11:04:43 -0700 Subject: [PATCH] try to retry on status code failures to handle intermittent problems --- cypress/e2e/ContactUs.cy.js | 2 +- cypress/e2e/ContactUsCPP.cy.js | 2 +- cypress/e2e/ContactUsEI.cy.js | 2 +- cypress/e2e/ContactUsOAS.cy.js | 2 +- cypress/e2e/DecisionReviews.cy.js | 2 +- cypress/e2e/Login.cy.js | 2 +- cypress/e2e/Logout.cy.js | 2 +- cypress/e2e/Profile.cy.js | 2 +- cypress/e2e/SecuritySettings.cy.js | 6 +++--- cypress/e2e/app.cy.js | 2 +- cypress/e2e/dashboard.cy.js | 6 +++--- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cypress/e2e/ContactUs.cy.js b/cypress/e2e/ContactUs.cy.js index 53099e4a7..46f6b0806 100644 --- a/cypress/e2e/ContactUs.cy.js +++ b/cypress/e2e/ContactUs.cy.js @@ -7,7 +7,7 @@ describe('Validate Contact Us Landing page', () => { hostname: 'assets.adobedtm.com', path: /.*\/launch-.*/, }).as('adobeAnalytics') - cy.visit('/contact-us') + cy.visit('/contact-us', { retryOnStatusCodeFailure: true }) }) it('Contact us has no detectable a11y violations on load', () => { diff --git a/cypress/e2e/ContactUsCPP.cy.js b/cypress/e2e/ContactUsCPP.cy.js index 9b4d41355..6ae1c34c8 100644 --- a/cypress/e2e/ContactUsCPP.cy.js +++ b/cypress/e2e/ContactUsCPP.cy.js @@ -8,7 +8,7 @@ describe('Validate Contact Canada Pension Plan page', () => { hostname: 'assets.adobedtm.com', path: /.*\/launch-.*/, }).as('adobeAnalytics') - cy.visit('/contact-us/contact-canada-pension-plan') + cy.visit('/contact-us/contact-canada-pension-plan', { retryOnStatusCodeFailure: true }) }) it('Contact us CPP has no detectable a11y violations on load', () => { diff --git a/cypress/e2e/ContactUsEI.cy.js b/cypress/e2e/ContactUsEI.cy.js index 8d1cb5848..4d3c5bc7f 100644 --- a/cypress/e2e/ContactUsEI.cy.js +++ b/cypress/e2e/ContactUsEI.cy.js @@ -8,7 +8,7 @@ describe('Validate EI Contact Us Landing page', () => { hostname: 'assets.adobedtm.com', path: /.*\/launch-.*/, }).as('adobeAnalytics') - cy.visit('/contact-us/contact-employment-insurance') + cy.visit('/contact-us/contact-employment-insurance', { retryOnStatusCodeFailure: true }) }) it('Contact us EI has no detectable a11y violations on load', () => { diff --git a/cypress/e2e/ContactUsOAS.cy.js b/cypress/e2e/ContactUsOAS.cy.js index ca4c66b7c..2109b628c 100644 --- a/cypress/e2e/ContactUsOAS.cy.js +++ b/cypress/e2e/ContactUsOAS.cy.js @@ -9,7 +9,7 @@ describe('Validate Contact Old Age Security page', () => { hostname: 'assets.adobedtm.com', path: /.*\/launch-.*/, }).as('adobeAnalytics') - cy.visit('/contact-us/contact-old-age-security') + cy.visit('/contact-us/contact-old-age-security', { retryOnStatusCodeFailure: true }) }) it('Contact us OAS has no detectable a11y violations on load', () => { diff --git a/cypress/e2e/DecisionReviews.cy.js b/cypress/e2e/DecisionReviews.cy.js index c407a4b5e..4cf9fdd36 100644 --- a/cypress/e2e/DecisionReviews.cy.js +++ b/cypress/e2e/DecisionReviews.cy.js @@ -7,7 +7,7 @@ describe('Validate Request a review of a decision page', () => { hostname: 'assets.adobedtm.com', path: /.*\/launch-.*/, }).as('adobeAnalytics') - cy.visit('/en/decision-reviews') + cy.visit('/en/decision-reviews', { retryOnStatusCodeFailure: true }) }) it('Request a review has no detectable a11y violations on load', () => { cy.injectAxe() diff --git a/cypress/e2e/Login.cy.js b/cypress/e2e/Login.cy.js index 85fc380ba..c9eb615a9 100644 --- a/cypress/e2e/Login.cy.js +++ b/cypress/e2e/Login.cy.js @@ -7,7 +7,7 @@ beforeEach(() => { hostname: 'assets.adobedtm.com', path: /.*\/launch-.*/, }).as('adobeAnalytics') - cy.visit('/auth/login') + cy.visit('/auth/login', { retryOnStatusCodeFailure: true }) }) describe('Validate login page', () => { diff --git a/cypress/e2e/Logout.cy.js b/cypress/e2e/Logout.cy.js index b2c9af3a3..a8be14e22 100644 --- a/cypress/e2e/Logout.cy.js +++ b/cypress/e2e/Logout.cy.js @@ -6,7 +6,7 @@ It does not test the authentication functionality currently since those endpoint describe('Validate logout scenario and page', () => { beforeEach(() => { - cy.visit('/my-dashboard') + cy.visit('/my-dashboard', { retryOnStatusCodeFailure: true }) }) it('should show the loading spinner + text then return to index page once logged out', () => { diff --git a/cypress/e2e/Profile.cy.js b/cypress/e2e/Profile.cy.js index 51a4332c4..2a0756a7c 100644 --- a/cypress/e2e/Profile.cy.js +++ b/cypress/e2e/Profile.cy.js @@ -7,7 +7,7 @@ describe('Validate Profile page', () => { hostname: 'assets.adobedtm.com', path: /.*\/launch-.*/, }).as('adobeAnalytics') - cy.visit('/profile') + cy.visit('/profile', { retryOnStatusCodeFailure: true }) }) it('Profile has no detectable a11y violations on load', () => { diff --git a/cypress/e2e/SecuritySettings.cy.js b/cypress/e2e/SecuritySettings.cy.js index f945839c4..17715a6a0 100644 --- a/cypress/e2e/SecuritySettings.cy.js +++ b/cypress/e2e/SecuritySettings.cy.js @@ -7,7 +7,7 @@ describe('Validate Security Settings page', () => { hostname: 'assets.adobedtm.com', path: /.*\/launch-.*/, }).as('adobeAnalytics') - cy.visit('/security-settings') + cy.visit('/security-settings', { retryOnStatusCodeFailure: true }) }) it('Security settings has no detectable a11y violations on load', () => { @@ -70,7 +70,7 @@ describe('Validate Security Settings page', () => { }) it('Validate the "Profile" click navigates to Profile Page EN', () => { - cy.get('[data-cy="access-profile-page-link"]').click({ force: true }) + cy.get('[data-cy="access-profile-page-link"]').click() cy.url().should('contains', '/profile') cy.get('[data-testid ="profileContent-test"]>h1') .should('be.visible') @@ -80,7 +80,7 @@ describe('Validate Security Settings page', () => { it('Validate the "Profil" click navigates to Profile Page FR', () => { cy.get('[data-cy="lang1"] > span').click() cy.url().should('contains', '/fr/parametres-securite') - cy.get('[data-cy="access-profile-page-link"]').click({ force: true }) + cy.get('[data-cy="access-profile-page-link"]').click() cy.url().should('contains', '/profil') cy.get('[data-testid ="profileContent-test"]>h1') .should('be.visible') diff --git a/cypress/e2e/app.cy.js b/cypress/e2e/app.cy.js index 1f2f4d3a4..40d760aa7 100644 --- a/cypress/e2e/app.cy.js +++ b/cypress/e2e/app.cy.js @@ -2,7 +2,7 @@ describe('app page loads', () => { beforeEach(() => { - cy.visit('/') + cy.visit('/', { retryOnStatusCodeFailure: true }) cy.injectAxe() }) diff --git a/cypress/e2e/dashboard.cy.js b/cypress/e2e/dashboard.cy.js index abd61a635..e2a4d549c 100644 --- a/cypress/e2e/dashboard.cy.js +++ b/cypress/e2e/dashboard.cy.js @@ -7,7 +7,7 @@ describe('Validate dashboard page', () => { hostname: 'assets.adobedtm.com', path: /.*\/launch-.*/, }).as('adobeAnalytics') - cy.visit('/my-dashboard') + cy.visit('/my-dashboard', { retryOnStatusCodeFailure: true }) }) it('Dashboard has no detectable a11y violations on load', () => { @@ -234,7 +234,7 @@ describe('Validate dashboard page', () => { cy.get('[data-cy="task-group-list"]') .parents('[data-cy="Task"]') .find('[data-cy="task-link"] a[href="/en/profile"]') - .click({ force: true }) + .click() cy.location('pathname', { timeout: 10000 }).should('equal', '/en/profile') cy.visit('/my-dashboard') cy.location('pathname').should('equal', '/en/my-dashboard') @@ -270,7 +270,7 @@ describe('Validate dashboard page', () => { cy.get('[data-cy="task-group-list"]') .parents('[data-cy="Task"]') .find('[data-cy="task-link"] a[href="/fr/profil"]') - .click({ force: true }) + .click() cy.location('pathname', { timeout: 10000 }).should('equal', '/fr/profil') cy.visit('/fr/mon-tableau-de-bord') cy.location('pathname').should('equal', '/fr/mon-tableau-de-bord')