I am new to cypress and learning day by day, we are trying to implement e2e tests using cypress in angular project.
I am facing issues when I want to set env variables in cypress.json file through the command line
This is my cypress.json file
{
"defaultCommandTimeout": 10000,
"viewportWidth": 1440,
"viewportHeight": 900,
"env": {
"environment": "Stagging"
},
"fileServerFolder": ".",
"fixturesFolder": "./src/fixtures",
"integrationFolder": "./src/integration",
"pluginsFile": "./src/plugins/index",
"supportFile": "./src/support/index.ts",
"video": true,
"videosFolder": "../../../dist/cypress/apps/web/e2e/videos",
"screenshotsFolder": "../../../dist/cypress/apps/web/e2e/screenshots",
"chromeWebSecurity": false
}
I wanted to dynamically relace the Environment value, in my case from Stagging to dev. I am trying to use the following ng command
ng e2e --env environment=Dev
when I worked on POC, this option worked fine as they mentioned in cypress docs (https://docs.cypress.io/guides/guides/environment-variables.html#Setting)
can someone help me to solve this?