Topic: Gherkin keyword and defenition [personal]
Keywords
Feature
Background
Scenario
Given
When
Then
And
But
*
Scenario Outline
Examples
You are not logged in. Please login or register.
Rails Forum - Ruby on Rails Help and Discussion Forum » Tutorials » Gherkin keyword and defenition [personal]
Keywords
Feature
Background
Scenario
Given
When
Then
And
But
*
Scenario Outline
Examples
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.
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)
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)
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.
Hosting provided by aTech Media