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

Format and Syntax

Gherkin files use the feature file extension. They’re saved as plain text, meaning they can be read and edited with simple tools. In this respect, Gherkin is very similar to file formats like Markdown, Textile, and YAML.

Keywords

A Gherkin file is given its structure and meaning using a set of special keywords. There’s an equivalent set of these keywords in each of the supported spoken languages, but for now let’s take a look at the English ones:

  • Feature
  • Background
  • Scenario
  • Given
  • When
  • Then
  • And
  • But
  • *
  • Scenario Outline
  • Examples

We’ll spend the rest of this chapter exploring how to use the most common of these keywords, which will be enough to get you started writing your own Cucumber features. We’ll come back to look at the remaining keywords ...

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