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 Feature File Authoring

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

Overview

A specification-by-example pattern using Gherkin natural language syntax to describe application behavior as executable scenarios.

Description

Feature File Authoring uses the Gherkin language to write human-readable test specifications in .feature files. Each file describes a Feature with one or more Scenarios. Scenarios consist of Given (preconditions), When (actions), and Then (expected outcomes) steps. Tags (@tagName) allow filtering scenarios for selective execution.

This approach bridges the communication gap between technical and non-technical team members: product owners write scenarios in natural language, developers implement step definitions, and the scenarios serve as both documentation and executable tests.

Usage

Write feature files for behavior-driven development when scenarios need to be understood by non-technical stakeholders. Place .feature files in the configured feature_path directory.

Theoretical Basis

Gherkin follows the Given-When-Then (GWT) pattern from BDD:

  1. Given establishes the initial context (preconditions)
  2. When describes the action or event being tested
  3. Then specifies the expected outcome
  4. And/But extends any step with additional conditions

Related Pages

Implemented By

Page Connections

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