1
votes

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!

1
Can you please update your question to show full CLI command you are using to start cypress with these env value override?Alexander Staroselsky
Done. Thank You for the edits.Vall

1 Answers

1
votes

Not sure what happens in your case. Here is the resolved settings when doing just npx cypress open

enter image description here

Now when I run with $ npx cypress open --env country=Canada here is the resolved settings tab

enter image description here