Topic: Gherkin keyword and defenition [personal]

Keywords

Feature
Background
Scenario
Given
When
Then
And
But
*
Scenario Outline
Examples

Re: Gherkin keyword and defenition [personal]

cucumber filename.feature --dry-run

The --dry-run switch tells Cucumber to parse the file without executing it. It
will tell you if your Gherkin isn’t valid.

Re: Gherkin keyword and defenition [personal]

Feature
Each Gherkin file begins with the Feature keyword. This keyword doesn’t really affect the behavior of your Cucumber tests at all; it just gives you a convenient place to put some summary documentation about the group of tests that follow.

example:
Feature: [name]
[description]

Feature must be followed by one of the following:
• Scenario
• Background
• Scenario Outline

Last edited by moiseszaragoza (2012-05-25 12:31:25)

Re: Gherkin keyword and defenition [personal]

Scenarios
all follow the same pattern:
1. Get the system into a particular state.
2. Poke it (or tickle it, or ...).
3. Examine the new state.

example:
Scenario: Successful withdrawal from an account in credit
Given I have $100 in my account # the context
When I request $20 # the event(s)
Then $20 should be dispensed # the outcome(s)

Re: Gherkin keyword and defenition [personal]

Background
A background section in a feature file allows you to specify a set of steps that are common to every scenario in the file.