This example is for using Nightwatch.js(V2) with Cucumber-js.
It uses the Cucumber-js CLI runner itself, instead of nightwatch CLI. See Github discussion.
It is different with nightwatchjs/cucumberjs-boilerplate, which uses Nightwatch.js CLI and build-in Cucumber test runner.
You can fork this example as a start point.
This example uses TypeScript, but the cucumber & nightwatch configuration can be same if you are only using JavaScript.
npm run test
Chose a browser
NIGHTWATCH_BROWSER=chrome npm run test
Pass cucumber-js Options
npm run test -- --tags "@google" --retry 2 --parallel 4
- @cucumber/cucumber
- @cucumber/pretty-formatter
- dotenv
- nightwatch
- chromedriver
- geckodriver
- typescript
- ts-node
- @types/node
- @tsconfig/node16
- @types/nightwatch
- eslint
- @typescript-eslint/eslint-plugin
- @typescript-eslint/parser"
- prettier
- eslint-config-prettier