Skip to content

Commit

Permalink
Silence health check error in Cypress tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Nov 27, 2022
1 parent 1759824 commit 9326039
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/cypress/e2e/bounces.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});


Expand Down
2 changes: 2 additions & 0 deletions frontend/cypress/e2e/import.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion frontend/cypress/e2e/settings.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
6 changes: 6 additions & 0 deletions frontend/cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', {});
});

0 comments on commit 9326039

Please sign in to comment.