Gherkin¶
Gherkin is a language that developers use to define tests. Since this language uses plain English, it's meant to describe use cases for a software system in a way that can be read and understood by almost anyone.
This syntax promotes behavior-driven development (BDD) because it allows developers, managers, business analysts and other parties involved to understand the requirements of the project and the life-cycle.
The language makes it easy to create simple documentation of the code that's being written. Gherkin also provides scripts for test automation and supports dozens of languages.
The primary keywords are:
-
Feature
-
Rule
(as of Gherkin 6) -
Example
(orScenario
) -
Given
,When
,Then
,And
,But
for steps (or*
) -
Background
-
Scenario Outline
(orScenario Template
) -
Examples
(orScenarios
)
Feature: Guess the word