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

Interacting with User Input

Sometimes a command-line application needs to ask the user a question. Aruba supports this, allowing you to write scenarios that include a user responding to requests for information from the command-line application. We’ve been getting feedback from user testing of our calculator that a significant number of our users want to be able to perform additions without saving them to a file first. Let’s write another scenario to describe that use case:

 Scenario​: Add two numbers interactively
  When the calculator is run with no input
  And I enter the calculation ​"2+2"
  Then the output should be ​"4"

Run cucumber to generate the new step definition snippets, and ...

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