Skip to content

nightwatchjs-community/cucumber-nightwatch

Repository files navigation

Cucumber-js Nightwatch.js Integration Example

Test

This example is for using Nightwatch.js(V2) with Cucumber-js.

Motivation

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.

Getting Started

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.

Usage

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

Dependencies

Cucumber-js

  • @cucumber/cucumber
  • @cucumber/pretty-formatter
  • dotenv

Nightwatch.js

  • nightwatch
  • chromedriver
  • geckodriver

TypeScript (Optional for non TS setup)

  • typescript
  • ts-node
  • @types/node
  • @tsconfig/node16
  • @types/nightwatch

Linter and formatter (Optional)

  • eslint
  • @typescript-eslint/eslint-plugin
  • @typescript-eslint/parser"
  • prettier
  • eslint-config-prettier

About

Example for using Nightwatch.js with cucumber-js CLI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published