cucumber / cucumber-js

Cucumber for JavaScript
https://cucumber.io
MIT License
5.02k stars 1.09k forks source link

Playright + BDD + typescript - How to pass the env variables via CLI #2305

Closed varshanharshank closed 1 year ago

varshanharshank commented 1 year ago

In my project, we want to pass multiple env variables to run Playright BDD scripts

The below command, it is running all smoke test cases in chrome browser npx cucumber-js test --tags '@smoke'

i have to pass env variable to run the above script in msedge or firefox , how to pass it via CLI.

Same like other customer variables(tokenid, secrect...) i have to pass via CLi. how to pass it out

davidjgoss commented 1 year ago

In terms of providing arbitrary config variables via the CLI, you can do this with world parameters.

For your use case with varying the browser here, I'd recommend looking at profiles so you can do something like:

npx cucumber-js --profile firefox --tags '@smoke'