TL;DR:
I am trying to override the baseUrl
value from cypress.json
using my cypress.env.json
file, but I can't seem to figure out how. Is there a way to do this?
Background
Setting environment variables in the cypress.json
file and later overriding them in cypress.env.json
is as easy as pie. In cypress.json
:
{
"env": {
"someVariable": "originalValue"
}
}
... and in cypress.env.json
:
{
"someVariable": "newValue"
}
Regarding configuration variables, the documentation states:
If your environment variables match a standard configuration key, then instead of setting an
environment variable
they will instead override the configuration value.
However, if I try setting baseUrl
from cypress.json
...
{
"baseUrl": "http://example.com/setFromCypress.json",
"env": {
"someVariable": "originalValue"
}
}
... and overriding it in cypress.env.json
...
{
"baseUrl": "http://example.com/setFromCypress.env.json",
"someVariable": "newValue"
}
... then someVariable
is overriden, but the existing baseUrl
remains unchanged (and a baseUrl
appears inside the object placed at the env
key):
I have no problem when setting baseUrl
in cypress.json
and later overriding it in the command line using CYPRESS_BASE_URL
:
$ export CYPRESS_BASE_URL=http://example.com/setFromCommandLine
Then, the original baseUrl
is overriden:
To summarize: Am I missing something in the documentation, or is something missing in the documentation?