tnicola / cypress-parallel

Reduce up to 40% your Cypress suite execution time parallelizing the test run on the same machine.
MIT License
560 stars 117 forks source link

how to pass environment variables #189

Closed peacetrader closed 3 months ago

peacetrader commented 3 months ago

Hi, my script : "scripts": { "test-env": "cypress run --browser chrome --headed", "parallel-run": "cypress-parallel -s test-env -t 2 -d cypress/e2e/features/ -m false" }

We have a shell script which runs docker command runCypress.sh npm run parallel-run -- --env USERNAME=$id, PASSWORD=$password,TEST_ENV=$env

I pass the USERNAME, PASSWORD and TEST_ENV from command line ./runCypress.sh test john password When I run the shell script, it is ignoring the environment variables and not passing it to the command which results in unsuccessful login and not picking up test environment settings file

can someone pls help?. Thank you

peacetrader commented 3 months ago

Hi, I have found the solution npm run parallel-run -- -a '"--env USERNAME='$id', PASSWORD='$password',TEST_ENV='$env'"'