Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Add cy.catch command to prevent failed Cypress commands from failing the test #5094

Open
flotwig opened this issue Sep 5, 2019 · 0 comments
Labels
type: feature New feature that does not currently exist

Comments

@flotwig
Copy link
Contributor

flotwig commented Sep 5, 2019

Current behavior:

There is no way to catch failed commands in a Cypress test. Any failed command fails the entire test. If you want to catch a failed command for a legitimate reason, ugly workarounds must be used: percy/percy-cypress#140

And options to use duck-typing to return errors must be added on a per-command basis: #3161 (comment)

Desired behavior:

Add cy.catch command which can be chained to any Cypress command, and will be short-circuited to if an error is thrown in the chain preceding it.

Similar to Promise.catch:

cy.catch((err) => { ... })
cy.catch({ code: 'ECONNRESET' }, (err) => { ... })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests

2 participants