Cypress tests, added exception handling for edge error messages (#4043)

Added exception handling for "Cannot read property offsetTop" of undefined
This commit is contained in:
Florian Giroud 2021-08-19 11:20:05 +02:00 committed by GitHub
parent fa3ca5a84b
commit 90c074ca68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,3 +48,16 @@ before(() => {
token = response.body.token; 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
})