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 Dependency Setup

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

Overview

A dependency installation step that adds the Cucumber.js BDD framework alongside an existing test runner to enable Gherkin syntax support.

Description

Cucumber Dependency Setup installs the @cucumber/cucumber package, which provides the Gherkin parser, step definition registration functions (Given, When, Then, Before, After), and test execution engine. This is a prerequisite for BDD-style testing where test scenarios are written in natural language (Gherkin) and mapped to code via step definitions.

Nightwatch integrates with Cucumber as an alternative test runner, replacing its default Mocha-like runner. The Cucumber package must be version 7.3 or higher for compatibility.

Usage

Install this dependency when adopting BDD methodology or when the team wants to write test scenarios in Gherkin natural language format.

Theoretical Basis

BDD dependency setup follows the adapter pattern:

  1. Core framework (Nightwatch) provides browser automation
  2. BDD framework (Cucumber) provides Gherkin parsing and step matching
  3. Integration layer bridges both, making browser commands available in step definitions

Related Pages

Implemented By

Page Connections

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