Gherkin Syntax
Scenario-Oriented Acceptance Criteria
Gherkin Syntax
Write scenarios in the following format:
Feature: Account Holder withdraws cash
Scenario: Account has sufficient funds
Given The account balance is$100
And the card is valid
And the machine contains enough money
When the Account Holder requests$20
Then the ATM should dispense$20
And the account balance should be$80
And the card should be returned
Rules
There should only ever be one When clause
You can have multiple Given and Then clauses
- These are specified after the first clause with the keyword And
Keep technical details out of the language
- This allows your scenarios to transcend the technology supporting
- You don't want to have to re-write all of your criteria when the technology changes, because the technology is always changing