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

Nesting Steps

Finding the right level of detail, or abstraction, to use in your scenarios is a skill that takes some time to master. What many people don’t realize is that different levels of detail are appropriate for different scenarios in the same system—sometimes in the same feature—depending on what it is they’re describing.

As an example, here’s a scenario for the user of our ATM authenticating with their PIN:

 Scenario​: Successful login with PIN
  Given I have pushed my card in the slot
  When I enter my PIN
  And I press ​"OK"
  Then I should see the main menu

It’s entirely appropriate for us to go into this much detail about the authentication process in this scenario, because that’s where our focus is. Now consider our cash ...

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