From 93260396c6471eb2e5ead0ec2f1040245fe5451f Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Sun, 27 Nov 2022 22:12:05 +0530 Subject: [PATCH] Silence health check error in Cypress tests. --- frontend/cypress/e2e/bounces.cy.js | 2 +- frontend/cypress/e2e/import.cy.js | 2 ++ frontend/cypress/e2e/settings.cy.js | 2 +- frontend/cypress/support/e2e.js | 6 ++++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/cypress/e2e/bounces.cy.js b/frontend/cypress/e2e/bounces.cy.js index ac181bc..224490e 100644 --- a/frontend/cypress/e2e/bounces.cy.js +++ b/frontend/cypress/e2e/bounces.cy.js @@ -13,7 +13,7 @@ describe('Bounces', () => { cy.get('[data-cy=btn-bounce-count] .plus').click(); cy.get('[data-cy=btn-save]').click(); - cy.wait(1000); + cy.wait(2000); }); diff --git a/frontend/cypress/e2e/import.cy.js b/frontend/cypress/e2e/import.cy.js index bc3f9eb..983d74b 100644 --- a/frontend/cypress/e2e/import.cy.js +++ b/frontend/cypress/e2e/import.cy.js @@ -62,7 +62,9 @@ describe('Import', () => { }); it('Imports subscribers incorrectly', () => { + cy.wait(1000); cy.resetDB(); + cy.wait(1000); cy.loginAndVisit('/subscribers/import'); cy.get('.list-selector input').click(); diff --git a/frontend/cypress/e2e/settings.cy.js b/frontend/cypress/e2e/settings.cy.js index e43c942..23f51c3 100644 --- a/frontend/cypress/e2e/settings.cy.js +++ b/frontend/cypress/e2e/settings.cy.js @@ -26,7 +26,7 @@ describe('Templates', () => { cy.get('[data-cy=btn-save]').click(); - cy.wait(250); + cy.wait(1000); // Verify the changes. cy.request(`${apiUrl}/api/settings`).should((response) => { diff --git a/frontend/cypress/support/e2e.js b/frontend/cypress/support/e2e.js index 02d3a1d..91f43b5 100644 --- a/frontend/cypress/support/e2e.js +++ b/frontend/cypress/support/e2e.js @@ -9,8 +9,14 @@ beforeEach(() => { return true; } + if (xhr.url.indexOf('api/health') > -1) { + return true; + } + // Return the default cypress whitelist filer. return xhr.method === 'GET' && /\.(jsx?|html|css)(\?.*)?$/.test(xhr.url); }, }); + + cy.intercept('GET', '/api/health', {}); });