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

Comments

As well as the description fields that follow Feature and Scenario keywords, Cucumber allows you to precede these keywords with comments.

Like in Ruby, comments start with a # character. Unlike in Ruby, comments have to be the first and only thing on a line (well, apart from whitespace).

Here’s an example:

 # This feature covers the account transaction and hardware-driver modules
 Feature​: Withdraw Cash
  In order to buy beer
  As an account holder
  I want to withdraw cash from the ATM
 
 # Can't figure out how to integrate with magic wand interface
 Scenario​: Withdraw too much from an account in credit
  Given I have $50 in my account
 # When I wave my magic wand
  And I ...

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