no-dupe-scenario-names
Makes sure no two scenarios share a name.
What it does
Scenario names show up in reports. When two are identical you cannot tell which one failed. You can look for duplicates across the whole project, or only inside each file.
Turning it on
Add this to your .gurkencheckrc:
{
"no-dupe-scenario-names": ["on", "anywhere"]
}
Settings
| Setting | Value | If you leave it out | What it does |
|---|---|---|---|
the value |
"anywhere" or "in-feature" | "anywhere" |
"anywhere" compares every scenario in the project. "in-feature" only compares scenarios within the same file. This rule takes a single value rather than an object. |
Examples
Passes
Feature: Logging in
Scenario: A known user logs in
Given I am a known user
Scenario: An unknown user is turned away
Given I am not a known user
Fails
Feature: Logging in
Scenario: A known user logs in
Given I am a known user
Scenario: A known user logs in
Given I am a known user on a phone
gurkencheck reports: Scenario name is already used in: LoggingIn.feature:3