Skip to content

Gherkin Feature

You can upload your gherkin files to Calliope through the manual upload or API upload Read more about Gherkin here.

Languages

Gherkin can be written in 70+ languages according to their documentation. If you write your Gherkin in a language that is not English that is totally fine. You will have to specify that on the top of the feature (see the documentation) to make it work with importing your feature files. This will only impact the keyword of the feature. If you use the English keywords you can keep using the default language.

Gherkin feature file

Download our example file here: example_gherkin_feature.feature

Feature

  • Feature Stored as container classification.
  • Background Stored as a result. Will be added as the first step to every scenario in the feature.
  • Rule Stored as container classification.
  • Scenario Stored as container classification.
  • Scenario Outline We go through all Examples and for every row in the Examples table we create a container with the steps of the scenario outline as results.
  • Comments will be added to the keyword directly underneath the comment, more about this in the comment section

Scenario Outline

A scenario outline will be read as a container with multiple scenarios. From the outline, the name is still taken.

Scenarios

  • The scenario name we save in the title of the scenario container
  • Examples If there are Examples in a scenario we treat it as a Scenario Outline.
  • Datatables A data table on a step we will be added as a table on the result of the step.

Steps

Steps are rewritten as results

  • keyword Used in the beginning of the result title.
  • The step name is used as the result title.

The result will always be unknown because this is not a report. This is a way for testers to upload an empty report that they can manually edit.

Comments

Valid comments

You can place Comments in feature files. These are added to the keyword that is directly underneath the comment, so for example:

# This is a comment
Scenario: this is a scenario
    Given this scenario has a comment
    When the user looks up the report
    Then the comment is added to the Scenario container
In this case, the comment will be added to the Scenario description. You can see this by hovering over the scenario or opening the results of the scenario. You can place comments anywhere, in-between steps, in-between Scenario outlines Examples, above Rules. You name it. Comments above other comments will be added as well.
Scenario: this is a scenario
    Given this scenario has a comment
    #comment nr.1
    #comment nr.2
    #comment nr.3
    When the user looks up the report
    Then the comments will be added to the When step
All 3 comments will be added on the When step in this case. The comments in steps are displayed on the result description of the step.

Invalid comments

If there is a white line between a comment and a Keyword it will be ignored.

# This is a comment

Scenario: this is a scenario
    Given this scenario has a comment
    When the user looks up the report
    Then the comment will be added to the Scenario container
In this case, the comment will be ignored.