A set of focused scenarios can explain every step of ordering a pizza without showing how a customer completes an order. A journey scenario fills that gap: it follows a complete user journey through several behaviors to a useful outcome. It shows how the system works as a whole, not the detailed rules behind each step. section 6.5 section 10.7
Listing 10.5 Pay-on-collection journey
@journey Scenario: Pay-on-collection journey Given Reggie visits our website When he adds a pizza to his basket And he chooses to checkout as a guest And he enters valid contact details And he chooses pay-on-collection Then he receives an order confirmation
The pay-on-collection journey moves from visiting the website through checkout to order confirmation. Its steps make the overall flow readable without spelling out every rule for baskets, contact details, or payment. section 10.6
Listing 10.7 Restricted customer’s pay-on-collection journey
@journey Scenario: Restricted customer's pay-on-collection journey * Brian visits our website * he adds a pizza to his basket * he chooses to checkout as a guest * he enters valid contact details * the contact details are on the blocklist * he can't choose pay-on-collection
An alternative journey shows where the outcome changes: a customer whose contact details are on the blocklist cannot choose pay-on-collection. section 10.6
Keep a journey scenario focused on the big picture:
- Choose important journeys with business stakeholders; a user story map can help identify candidates. Write a typical path and, where useful, separate exceptions or alternative paths. section 10.6
- Use only enough assertions to establish that the flow works. Leave precise checks, such as financial calculations, to illustrative scenarios. section 6.5
- Keep journey scenarios few and separate from feature files for fine-grained illustrative scenarios. Each should help readers see how multiple behaviors deliver an outcome. section 6.5 section 10.7
A long manual test script is not automatically a journey scenario. If it dwells on the fine details of each behavior, assess those details for illustrative scenarios instead. Create a journey scenario from it only when the resulting flow adds to the big picture. section 11.3.2
