From 90c074ca681737907cc6554e943297e6a2475135 Mon Sep 17 00:00:00 2001 From: Florian Giroud <6267288+fgiroud@users.noreply.github.com> Date: Thu, 19 Aug 2021 11:20:05 +0200 Subject: [PATCH] Cypress tests, added exception handling for edge error messages (#4043) Added exception handling for "Cannot read property offsetTop" of undefined --- main/tests/cypress/cypress/support/index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/main/tests/cypress/cypress/support/index.js b/main/tests/cypress/cypress/support/index.js index 559b0ddd6..06e27deb1 100644 --- a/main/tests/cypress/cypress/support/index.js +++ b/main/tests/cypress/cypress/support/index.js @@ -48,3 +48,16 @@ before(() => { token = response.body.token; }); }); + + +// See https://docs.cypress.io/api/events/catalog-of-events#Uncaught-Exceptions +// We want to catch some Javascript exception that we consider harmless +Cypress.on('uncaught:exception', (err, runnable) => { + // This message occasionally appears with edge + // Doesn't seems like a blocket, and the test should not fail + if (err.message.includes("Cannot read property 'offsetTop' of undefined")) { + return false + } + // we still want to ensure there are no other unexpected + // errors, so we let them fail the test +}) \ No newline at end of file