You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.on('uncaught:exception',(err,runnable)=>{// returning false here prevents Cypress from// failing the testreturnfalse})
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?
The text was updated successfully, but these errors were encountered:
I would say avoid it if possible unless the case of the third-party code and then comment the reason for the use. Similar to wait(), don't use but if you do comment the reason why.
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?The text was updated successfully, but these errors were encountered: