-
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 prefers value from cypress.json rather than CYPRESS_* env variable #15606
Comments
A // commands.ts
const BASE_URL = process.env.CYPRESS_BASE_URL || Cypress.env("BASE_URL"); Elsewhere:
EDIT: the workaround above doesn't work, as it still evaluates to what's in |
I've encountered this issue too. Definitely something buggy going on! |
Duplicate of #8680 |
Current behavior
Cypress.env("BASE_URL")
returnshttp://localhost:5001
(the value in an environment variable) when running inside tests, buthttp://localhost:6666
(the value incypress.json
) when running from inside commands.Desired behavior
Cypress.env("BASE_URL")
returnshttp://localhost:5001
(the environment variable value) both when called from commands as well as tests, instead of returning a different result depending on the runtime.Test code to reproduce
I have this command:
This
cypress.json
file:And I'm calling Cypress like so:
Where the scripts look like this:
Versions
The text was updated successfully, but these errors were encountered: