During a test run, if Cypress encounters an unhandled exception, it fails the test run. Sometimes the exception relates to custom code, but sometimes it relates to third-party code and it might only happen intermittently.
Cypress provides some advice for handling these scenarios: https://docs.cypress.io/api/events/catalog-of-events#To-turn-off-all-uncaught-exception-handling
Cypress.on('uncaught:exception', (err, runnable) => {
// returning false here prevents Cypress from
// failing the test
return false
})
You can add that to a describe() or it() block's scope or try to handle them more globally. What should the guidance be for encountering uncaught exceptions?
During a test run, if Cypress encounters an unhandled exception, it fails the test run. Sometimes the exception relates to custom code, but sometimes it relates to third-party code and it might only happen intermittently.
Cypress provides some advice for handling these scenarios: https://docs.cypress.io/api/events/catalog-of-events#To-turn-off-all-uncaught-exception-handling
You can add that to a
describe()orit()block's scope or try to handle them more globally. What should the guidance be for encountering uncaught exceptions?