From 9d5a8a3e7d981a8709b9e75700baecc2eef16ba6 Mon Sep 17 00:00:00 2001 From: Pablo Costa Date: Fri, 29 Sep 2023 18:40:07 -0300 Subject: [PATCH] Add test for Rollbar logging on the website (#2320) * Add test for Rollbar logging on the website * Move `rollbar.cy.js` test file to `integration` folder --- .../cypress/e2e/integration/rollbar.cy.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 site/gatsby-site/cypress/e2e/integration/rollbar.cy.js diff --git a/site/gatsby-site/cypress/e2e/integration/rollbar.cy.js b/site/gatsby-site/cypress/e2e/integration/rollbar.cy.js new file mode 100644 index 0000000000..73c077482d --- /dev/null +++ b/site/gatsby-site/cypress/e2e/integration/rollbar.cy.js @@ -0,0 +1,19 @@ +describe('Rollbar', () => { + it('Should log an error to Rollbar', () => { + cy.intercept('POST', 'https://api.rollbar.com/api/1/item/').as('rollbarAPICall'); + + cy.visit('/login'); + + cy.get('input[name=email]').type(Cypress.env('e2eUsername')); + + cy.get('input[name=password]').type('invalidPassword'); + + cy.get('[data-cy="login-btn"]').click(); + + cy.wait('@rollbarAPICall').then((interception) => { + expect(interception.response.statusCode).to.equal(200); + expect(interception.response.statusMessage).to.equal('OK'); + expect(interception.response.body.err).to.equal(0); + }); + }); +});