Silence health check error in Cypress tests.

This commit is contained in:
Kailash Nadh 2022-11-27 22:12:05 +05:30
parent 175982443e
commit 93260396c6
4 changed files with 10 additions and 2 deletions

View file

@ -13,7 +13,7 @@ describe('Bounces', () => {
cy.get('[data-cy=btn-bounce-count] .plus').click(); cy.get('[data-cy=btn-bounce-count] .plus').click();
cy.get('[data-cy=btn-save]').click(); cy.get('[data-cy=btn-save]').click();
cy.wait(1000); cy.wait(2000);
}); });

View file

@ -62,7 +62,9 @@ describe('Import', () => {
}); });
it('Imports subscribers incorrectly', () => { it('Imports subscribers incorrectly', () => {
cy.wait(1000);
cy.resetDB(); cy.resetDB();
cy.wait(1000);
cy.loginAndVisit('/subscribers/import'); cy.loginAndVisit('/subscribers/import');
cy.get('.list-selector input').click(); cy.get('.list-selector input').click();

View file

@ -26,7 +26,7 @@ describe('Templates', () => {
cy.get('[data-cy=btn-save]').click(); cy.get('[data-cy=btn-save]').click();
cy.wait(250); cy.wait(1000);
// Verify the changes. // Verify the changes.
cy.request(`${apiUrl}/api/settings`).should((response) => { cy.request(`${apiUrl}/api/settings`).should((response) => {

View file

@ -9,8 +9,14 @@ beforeEach(() => {
return true; return true;
} }
if (xhr.url.indexOf('api/health') > -1) {
return true;
}
// Return the default cypress whitelist filer. // Return the default cypress whitelist filer.
return xhr.method === 'GET' && /\.(jsx?|html|css)(\?.*)?$/.test(xhr.url); return xhr.method === 'GET' && /\.(jsx?|html|css)(\?.*)?$/.test(xhr.url);
}, },
}); });
cy.intercept('GET', '/api/health', {});
}); });