I am using this link as a reference to pass configuration to my cypress tests : https://docs.cypress.io/api/plugins/configuration-api.html#Switch-between-multiple-configuration-files
My sample config file looks like this:
{
"env": {
"country": "US",
"testenv": "staging",
"US": {
"baseUrl" : "somevalue"
}
}
Now I want to override the country value from the command line, I tried using
cypress open --env country="Germany"
but it still doesn't pickup the value passed in command line and still takes the value from configuration file. Any help on this is much appreciated!
I ran into same problem and resolved it using the following approach:
I am using following command:
npm run dev -- --config video=false
This gets converted into following by node:
cypress open -C config.json "--config" "video=false"
This ONLY works when I don't have the video flag present in my config.json
. So I can't start with a default value for a parameter that I would like to override.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.