O'Reilly logo

Mastering Software Testing with JUnit 5 by Boni García

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

Cucumber in a nutshell

Cucumber executes tests specified written in language called Gherkin. It is a plaint-text natural language (for example, English or one of other 60+ languages supported by Cucumber) with a given structure. Gherkin has been designed to be used by non-programmers, typically customers, business analysis, managers, and so on.

The extension for Gherkin files is .feature.

In a Gherkin file, non-blank lines can start with a keyword, followed by text in natural language. The main keywords are the following:

  • Feature: High-level description of the software feature to be tested. It can be seen as a use case description.
  • Scenario: Concrete example that illustrates a business rule. Scenarios follow the same pattern:
    • Describe initial ...

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