Context is the state of the system before the behavior being illustrated. In an example, it works with an action that triggers the behavior and an outcome that describes the resulting state. section 3.7
Keep context useful and focused:
- Include only concrete details needed to understand the rule; leave unrelated data, such as the pizza type when illustrating an address change, to examples about those behaviors. section 3.2
- When context and action seem ambiguous, ask which event directly triggers the outcome. The answer can depend on how the business works. section 8.3.5
- In Gherkin, Given steps establish context before a When step states the triggering event. section 8.3.2
Listing 8.4 Single action (contact details)
Given the customer is unauthenticated And they chose to collect their order When they provide contact details unacceptable for customer-collection Then they should be prevented from progressing
This scenario treats unauthenticated status and the customer’s choice to collect as context, leaving unacceptable contact details as the triggering action. section 8.3.5





























