Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Nightwatchjs Nightwatch Cucumber Runner Configuration

From Leeroopedia
Knowledge Sources
Domains Testing, BDD, Configuration
Last Updated 2026-02-12 00:00 GMT

Overview

A configuration pattern that switches the test runner from the default engine to Cucumber, mapping feature file paths and execution options.

Description

Cucumber Runner Configuration tells Nightwatch to use Cucumber as its test runner instead of the default Mocha-like engine. This involves setting test_runner.type to cucumber and configuring options like feature_path (glob path to .feature files), auto_start_session (whether to auto-create a WebDriver session), and parallel (number of worker threads for parallel execution).

The configuration also specifies src_folders pointing to step definition directories, so Nightwatch knows where to find the code that implements Gherkin steps.

Usage

Configure the Cucumber runner in nightwatch.conf.js (or a separate config file) before running BDD tests. Use a separate config file when maintaining both E2E and BDD test configurations.

Theoretical Basis

The runner configuration bridges two systems:

  1. test_runner.type selects the execution engine (cucumber vs default)
  2. feature_path tells Cucumber where to find .feature files
  3. src_folders tells Nightwatch where to find step definitions
  4. auto_start_session controls WebDriver lifecycle management

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment