BDD Gherkin Language
5 exercises — practise the English structure of Gherkin scenarios: Given/When/Then, declarative style, Background, Scenario Outlines, and avoiding common mistakes.
0 / 5 completed
Quick reference: Gherkin keywords
- Given — system state or precondition before the action (declarative, not UI steps)
- When — the triggering action or event under test
- Then — one observable, measurable outcome per step
- Background — shared Given steps that run before every scenario in the file
- Scenario Outline + Examples — parameterised scenario with a data table for multiple runs
1 / 5
A QA engineer is writing a Gherkin scenario for a checkout flow. Which step most correctly uses the When keyword?
When describes the action or event that triggers the behaviour being tested.
Options A, B, and C all describe states or preconditions — they correctly belong in Given clauses, not When. The Given keyword establishes context; When describes the specific trigger action; and Then describes the observable outcome. "When the user clicks the Confirm Order button" is the triggering event that causes the system to do something, making it the only correct When step here.
Key vocabulary:
• Given — establishes the initial system state or precondition before the action
• When — describes the action, event, or trigger that the scenario is testing
• Then — describes the observable outcome or expected system response
• Scenario — a single concrete example of a feature's behaviour in Gherkin
Options A, B, and C all describe states or preconditions — they correctly belong in Given clauses, not When. The Given keyword establishes context; When describes the specific trigger action; and Then describes the observable outcome. "When the user clicks the Confirm Order button" is the triggering event that causes the system to do something, making it the only correct When step here.
Key vocabulary:
• Given — establishes the initial system state or precondition before the action
• When — describes the action, event, or trigger that the scenario is testing
• Then — describes the observable outcome or expected system response
• Scenario — a single concrete example of a feature's behaviour in Gherkin