Konubinix' opinionated web of thoughts

Gherkin Language


  1. Given an initial situation
  2. And possibly other aspects of the initial situation
  3. When this is done
  4. And possibly another action
  5. Then something happens
  6. And possibly something else happens

You can automatize the execution of those tests by matching each phrase to some code and run this in your continuous integration system

Gherkin uses a set of special keywords to give structure and meaning to executable specifications


Gherkin is a business readable language which helps you to describe business behavior without going into details of implementation. It is a domain specific language for defining tests in Cucumber format for specifications. It uses plain language to describe use cases and allows users to remove logic details from behavior tests.


Before Gherkin

After Gherkin



Remember that, ideally, scenarios should be between 3-5 lines and communicate what the user is doing clearly to the whole team without going into the details of how it will be done. While steps can be reused that should not come at the expense of feature clarity.


Notes linking here