Migrating away from Cypress.env() #33402
Unanswered
elizakaniewskaevooq
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I’m currently migrating away from Cypress.env() following the official Cypress migration guide:
https://docs.cypress.io/app/references/migration-guide#Migrating-away-from-Cypressenv
I’ve replaced all instances of Cypress.env() with cy.env(), but I’m still encountering the following error:
Cypress.env() does not work when allowCypressEnv is set to false. Please migrate to cy.env() or leverage other stateful methods to manage variables. The variable being accessed was: undefined
I’m loading my environment variables (email and password) from a JSON file.
Do I also need to define these variables in cypress.config? Or is there something else I might be missing in the migration process?
Beta Was this translation helpful? Give feedback.
All reactions