Scenario Outline
Sometimes you have several scenarios that follow exactly the same pattern of steps, just with different input values or expected outcomes. For example, suppose we’re testing each of the fixed amount withdrawal buttons on the ATM:
| Feature: Withdraw Fixed Amount |
| |
| The "Withdraw Cash" menu contains several fixed amounts to |
| speed up transactions for users. |
| |
| Scenario: Withdraw fixed amount of $50 |
| Given I have $500 in my account |
| When I choose to withdraw the fixed amount of $50 |
| Then I should receive $50 cash |
| And the balance of my account should be $450 |
| |
| |
| |
| Scenario: Withdraw fixed amount of $100 |
| Given I have $500 in my account |
| When I choose to withdraw the fixed amount of $100 |
| Then I should receive ... |
Get The Cucumber Book, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.