You are reading the documentation for gurkencheck 0.0.4. Go to the latest version.

gurkencheck A linter for Gherkin feature files.

no-undeclared-variables

Every <placeholder> in a step needs a column to fill it in.

What it does

A placeholder with no matching column is never substituted. The step runs with the angle brackets still in the text, which almost never matches a step definition and is confusing when it does. Usually it is a typo or a column that was renamed.

Turning it on

Add this to your .gurkencheckrc:

{
  "no-undeclared-variables": "on"
}

Settings

This rule has no settings. Switch it on with "no-undeclared-variables": "on".

Examples

Passes
Feature: Logging in

  Scenario Outline: Logging in as <role>
    Given I am a <role>

    Examples:
      | role  |
      | admin |
Fails
Feature: Logging in

  Scenario Outline: Logging in as <role>
    Given I am a <rol>

    Examples:
      | role  |
      | admin |

gurkencheck reports: Step variable "rol" does not exist in the examples table