no-multiline-steps Always on
A step has to fit on one line.
What it does#
Gherkin reads one step per line. Wrapping a long step onto a second line does not continue it - the parser stops there. If a step needs more text, use a doc string or a data table underneath it.
Turning it on#
Add this to your .gurkencheckrc:
// Always on. Listing it is accepted and does nothing;
// asking for it to be off is an error.
{
"no-multiline-steps": "on"
}
Settings#
This rule has no settings. Switch it on with "no-multiline-steps": "on".
Examples#
Passes
Feature: Logging in
Scenario: A known user sees a welcome message
Given I am a known user
Then I see the message:
"""
Welcome back. You last signed in
three days ago.
"""
Fails
Feature: Logging in
Scenario: A known user sees a welcome message
Given I am a known user
Then I see the message Welcome back, you last
signed in three days ago
gurkencheck reports: Steps should begin with "Given", "When", "Then", "And" or "But". Multiline steps are disallowed