-
Notifications
You must be signed in to change notification settings - Fork 20
Conditional logic based off of currentRetry? #32
Comments
Yes, I believe you can access the currentRetry number off of you should be able to use if (Cypress.currentTest.currentRetry()) {
cy.reload()
} It'll be Let me know if that works! |
Unfortunately, it is not working. Acting like there is not any condition and it runs |
@eyup-aydin have you tried logging out what |
I did this way. Am I doing wrong? Thank you for your time and support.
|
@eyup-aydin yes, you're calling I've tested this and it works, so closing for now |
Hi @bkucera, do you know if this above logic is available with the native Cypress retries implementation in v5? Using the same implementation I'm receiving the following error:
|
@mattrlong good question. If you use Otherwise you can use |
this.test.currentRetry() only works within .it statements. Some of our retry handling resides within mocha hooks, which always returns 0. This approach would also mean needing to determine the retry number within the tests and passing into any imported modules, so becomes a quite messy.
|
Had the same issue here. |
The issue is: I want to reload the URL for only my failing tests.
When I run with that way, it works. However, it
reload
s every tests. Is it possible to reload only for retry tests?The text was updated successfully, but these errors were encountered: