-
Notifications
You must be signed in to change notification settings - Fork 59
Running Tests
Disclaimer: The following page was tested using Windows. There will probably need some configuration changes for Mac and Linux. Most changes can be resolved by changing the package.json
file.
When creating this repo, I wanted to make it easy to run tests using a simple command line command. You can run cucumber by executing the following command
.\node_modules\.bin\cucumber-js.cmd
but using the repos package.json
file you could also execute
npm run test
I've added the ability to change browsers in this repo as well. If a default browser is not specified, chrome will be browser that runs. You could run a new browser with the command
./node_modules/.bin/cucumber-js.cmd --world-parameters '{\"browser\": \"firefox\"}'
or the package.json
file has scripts you can execute
npm run test-chrome
npm run test-ie
npm run test-edge
npm run test-firefox
npm run test-opera
npm run test-safari
If you want to run a JSON Cucumber report you can use the following command
./node_modules/.bin/cucumber-js.cmd --format json:./reports/report.json
or you can use the built in scripts
npm run test-report
If you want to run a JSON Cucumber report and specify the the browser you can use the following command
./node_modules/.bin/cucumber-js.cmd --format json:./reports/report.json --world-parameters '{\"browser\": \"edge\"}'
or if you use the built in scripts
npm run test-chrome-report
npm run test-ie-report
npm run test-edge-report
npm run test-firefox-report
npm run test-opera-report
npm run test-safari-report
https://github.com/cucumber/cucumber-js/blob/master/docs/cli.md