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

gurkencheck A linter for Gherkin feature files.

no-examples-in-scenarios

Reminds you that Examples belong to a Scenario Outline.

What it does

An Examples table only runs when it hangs off a Scenario Outline. Attached to a plain Scenario it is silently ignored, so your test never runs the rows you wrote.

Turning it on

Add this to your .gurkencheckrc:

{
  "no-examples-in-scenarios": "on"
}

Settings

This rule has no settings. Switch it on with "no-examples-in-scenarios": "on".

Examples

Passes
Feature: Logging in

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

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

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

    Examples:
      | role  |
      | admin |
      | guest |

gurkencheck reports: Cannot use "Examples" in a "Scenario", use a "Scenario Outline" instead