-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
_currentRetry value in beforeEach hook is always 0 #14783
Comments
I am not an expert, but I am missing somethin like:
or:
Which is on the page you are referring to. Does that have anything todo with this? |
I'm pretty sure this is just to access the total number of retries possible, and has nothing to do with what i'm describing |
@adesko I have testing using this solution and it seems to work: #8404 (comment) perhaps the documentation should be expanded to reference this? FYI |
@MDjhowley Thanks for the reply! However, i already implemented another solution using the cypress module that re-runs failed specs. |
Sorry for the late reply. Closing in favor of #8404. |
The issue
We use a command to reset the database before each spec is run. Unfortunately, it is quite slow (takes about 7 seconds to reset DB fixtures), so we can't really execute it in a beforeEach hook as that would slow down the tests significantly. However, if a test fails mid-execution, it can make some changes in the database that will prevent the test from retrying.
I wanted to make a workaround where i would execute the DB reset command in a beforeEach hook if the current attempt counter is above 0, but that didn't work (see current behavior below).
If there is any other way to make this work, please let me know.
Current behavior
When accessing attempt counter in the beforeEach hook (as described here), the attempts counter is 0 regardless of actual attempt count.
Desired behavior
Since the beforeEach hook is executed for each test attempt, i expected the attempt counter to contain current attempt counter.
Test code to reproduce
Versions
6.3.0
The text was updated successfully, but these errors were encountered: