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 ...

Get The Cucumber Book now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.