-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Cypress.env() state is not reset on rerun of test #6010
Comments
Nice writeup, I'm hitting the same issue, with both The docs state that both |
This is still an issue in Cypress 6.4.0 |
I think it's same issue (Cypress 8.3.0) : {
"env": {
"num": 2
}
} it('should always logs 2', () => {
cy.log(`${Cypress.env('num')}`) // logs 2, but 3 on rerun
})
it('should set ENV var num and logs 3', { env: { num: 3 } }, () => {
cy.log(`${Cypress.env('num')}`) // logs 3
}) |
Still an issue in 8.3.0. Really annoying that sometimes is actually works, and when rerunning it does not.
EDIT: Found a workaround adding Cypress.env('ImageUrl'+ [index], $src) |
yes . still this issue persists in 9.2 version |
Still an issue in 9.3.1. Any updates on this? |
is there solution out? I'm hitting same in 9.2/3. thx |
Still an issue on 9.5.3 is there a way to just reload the runner once an env file is changed? Not just re-opening it. |
I can't believe this is still an issue |
still an issue and it's very annoing :( |
This is still an issue. Even setting an |
@zachwhite99 which version of Cypress are you using? If you aren't already using a version of Cypress >12 please try upgrading to latest and seeing if the problem persists. |
Hello, "cypress": "^12.17.4", still the problem. It's not reset after each test. |
Current behavior:
Cypress.env()
state is only read in once when the runner starts. This causes any changes toCypress.env()
to not reset when you rerun a test.Desired behavior:
Clean, fresh
Cypress.env()
for each rerun of a test.Steps to reproduce: (app code and test code)
But if I rerun the test, the log is already 3 at the beginning.
Versions
3.8.0
The text was updated successfully, but these errors were encountered: