|
@@ -23,7 +23,7 @@ Cypress.Commands.add('forceClick', { prevSubject: 'element' }, (subject) => {
|
|
|
cy.wrap(subject).click({ force: true });
|
|
|
});
|
|
|
|
|
|
-Cypress.on('uncaught:exception', (err) => {
|
|
|
+Cypress.on('uncaught:exception', (err, runnable, promise) => {
|
|
|
// We expect an error "Cannot read properties of undefined (reading 'includes')"
|
|
|
// during the installation of a template so we add an exception
|
|
|
if (err.message.includes("Cannot read properties of undefined (reading 'includes')")) {
|
|
@@ -32,6 +32,12 @@ Cypress.on('uncaught:exception', (err) => {
|
|
|
if(err.message.includes("ResizeObserver loop")){
|
|
|
return false;
|
|
|
}
|
|
|
+ // when the exception originated from an unhandled promise
|
|
|
+ // rejection, the promise is provided as a third argument
|
|
|
+ // you can turn off failing the test in this case
|
|
|
+ if (promise) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
// we still want to ensure there are no other unexpected
|
|
|
// errors, so we let them fail the test
|
|
|
})
|