-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Cannot override Cypress environment variables #798
Comments
Thank you for opening a comprehensive issue. We'll take a look but there are a ton of tests around this in various places that express all 4 ways of setting environment variables. For instance here is one: |
It turns out that baseUrl is a config variable, not an environment variable. |
This was referenced Mar 19, 2020
This was referenced Mar 22, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this a Feature or Bug?
Bug
Current behavior:
Cypress cannot load environments from two of the four methods described in the doc:
https://docs.cypress.io/guides/guides/environment-variables.html
Option 1 and Option 3 works fine. Option 2 and Option 4 doesn't work (only tested on baseUrl).
cypress.json
{}
cypress.env.json (no effect)
{
"baseUrl": "http://localhost:3000"
}
CYPRESS_baseUrl=http://localhost:3000 ./node_modules/.bin/cypress run (works as expected)
cypress run --env baseUrl=http://localhost:3000 (did not work)
Desired behavior:
All four methods work.
How to reproduce:
specify --env or use cypress.env.json
Test code:
Additional Info (images, stack traces, etc)
The text was updated successfully, but these errors were encountered: