O'Reilly logo

The Cucumber Book, 2nd Edition by Steve Tooke, Aslak Hellesoy, Matt Wynne

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required