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

Spoken Languages

Remember earlier we said that you can write your Gherkin features in the spoken language of your stakeholders? Here’s how.

Putting a # language: comment on the first line of a feature file tells Cucumber which spoken language that feature is written in. If you omit this header, Cucumber will default to English, as you’ve already seen.

Here’s an example of a feature written in Norwegian:

 # language: no
 Egenskap​: Summering
  For å unngå at firmaet går konkurs
  Må regnskapsførere bruke en regnemaskin for å legge sammen tall
 
 Scenario​: to tall
  Gitt at jeg har tastet inn 5
  Og at jeg har tastet inn 7
  Når jeg summerer
  Så skal resultatet være 12

If you’re wondering whether Cucumber knows how to speak your language, ...

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