Cucumber is a tool that executes plain-text functional descriptions as automated tests. The language that Cucumber understands is called Gherkin, which is a business-readable, domain-specific language that describes the software’s behavior without detailing how that behavior is implemented. It is a line-oriented language and uses indentation to define structure. Line endings terminate statements (e.g., steps). Either spaces or tabs may be used for indentation (but spaces are more portable). Most lines start with a keyword.
For more information on the Cucumber Basics, please consult the Wiki and Tutorials at: http://cucumber.io
Gherkin Tests are divided in two Scenario Types:
- Scenario: a set of instructions exclusively composed of constant values, which, when executed by a tool, will only give a static result (e.g., 2 + 3 = 5)
- Scenario Outline: a generic set of instructions containing variables, which, when executed by a tool, will prompt varied results according to the specified input.
The Scenario Types are inferred from the Scenario specification, i.e., the behavior to be reproduced by the Cucumber tool in entered in the Steps field.
Edit Scenario Description
To edit a scenario, click in the scenario description editor, and it will enter in edit mode. The edit mode is easily identified by its background color and the Save and Cancel buttons at the bottom of the textbox.
Gherkin keyword suggestions are displayed if press CTRL+Space keys.
After having the step keyword, BDD step suggestions are also be displayed if press CTRL+Space. The suggested BDD steps come from the existing BDD steps in the project's BDD steps library.
Once you are done editing the scenario description you should press the Save button.
If the inserted scenario description is invalid Gherkin, it will still be saved as it is but a warning will be displayed next to the editor when in view mode.
Export to Cucumber
Cucumber Tests in Jira can be exported to feature files ready to be executed in Cucumber. The generated feature files follow the rules defined in Export Cucumber Features and take into account the context of the Jira Test issue.
This action will prompt a FeatureBundle zip file containing a single Cucumber feature file for every Requirement associated with the target Test, to be generated and downloaded.
To export a Cucumber Test issue to feature files,
Step 1: Open the Cucumber Test issue view page.
Step 2: Select ... > Xray - Export to Cucumber. The file will be downloaded to the browser.