background-setup-only
Keeps a Background to setting things up.
What it does#
A Background runs before every scenario in the file, so an action or a check written there happens over and over, out of sight of the scenario it belongs to. Anything that is not setup belongs in the scenarios themselves. An And or a But counts as whatever keyword it carries on from, so a step following a When is reported too.
Turning it on#
Add this to your .gurkencheckrc:
{
"background-setup-only": "on"
}
Settings#
This rule has no settings. Switch it on with "background-setup-only": "on".
Examples#
Passes
Feature: Logging in
Background:
Given I am a known user
And the network is up
Scenario: Logging in
When I log in
Then I see my dashboard
Scenario: Logging out
When I log out
Then I see the front page
Fails
Feature: Logging in
Background:
Given I am a known user
When I log in
Scenario: A dashboard is shown
Then I see my dashboard
Scenario: Logging out is offered
Then I can log out
gurkencheck reports: Step "When I log in" is not a setup step, and a Background only sets things up