-
Cypress testing gotchasUse cy.should() for assertions to ensure cypress retries themWe were encountering random test failures on CI with our Cypress tests. It turns out that Cypress recommends you to wrap your assertions in
The differences that you should be aware of are:
So make sure that there are no side effects triggered in the callback you pass to
Leverage Cypress' retry-abilityThis relates to the above. An important concept in Cypress is retry-ability. It's Cypress' way of dealing with asynchronicity. A lot of the commands in Cypress will retry until they succeed:
Read up on this here: https://docs.cypress.io/guides/core-concepts/retry-ability.html. Note that not all commands automatically retry as that don't always know what constitutes success and failure. This is where appending a Moved from gotchas |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
See top post for the recommendations. |
Beta Was this translation helpful? Give feedback.
See top post for the recommendations.