Page History
Cucumber .feature files can be exported from Xray to be executed externally.
Xray takes into account requirement issues to generate .feature files. A generated .feature file is related at most with a single Requirement. When available, the requirement information is outputted to describe the Feature section in the .feature file.
The Background section of the .feature file is filled with the Pre-Condition Issue when associated with one or more Test issues. When a Requirement is associated with Tests and those Tests have different Pre-Condition issues, multiple .feature files will be generated, one for each distinct Pre-Condition indirectly associated with the Requirement issue (by the Test issues).
The Scenarios correspond to the Cucumber Test issues. For each Test associated with a Requirement, it's scenario is outputted to the .feature file.
Cucumber feature files and executed externally. They can be generated from the following Xray issues:
- Test
- Test Set
- Test Execution
- Test Plan
Or, from an Issue mapped as a Requirement issue type.
If the language defined to export the cucumber .feature files is not the default (en) i.e., En), then a language tag will be added.
...
Xray generates Cucumber .feature files according to the context issue and according to the following rules:
Test:
- A single Cucumber feature file is generated for each requirement associated with this testTest.
- The feature includes contains the feature header description of the associated requirement, if present.
- The feature includes contains the background of the Test, if present in the Pre-Condition associated with it.
- The feature includes contains the Scenario/Scenario Outline defined in this testTest.
Test Set, Test Execution, Test Plan or Requirement issue:
- A single Cucumber feature file is generated for each different tuple (Requirement, Pre-Condition).
- A Test Execution does not contain repeated tests.
- If a test Test is not associated with a requirement, then it will be exported to as an independent feature file.
- If a test Test is associated with more than one requirement, then a feature file will be generated for each featurerequirement. The generated .feature files will contain repeated test scenarios.
- The feature includes contains the feature header description of the associated requirement, if present.
- The feature includes contains the common background of the Tests, if present in the Pre-Condition.
- The feature includes contains the Scenario/Scenario Outline for all the tests.
Feature File Format
[ #language: { language } ] [ @{ Test Execution issue Key } ] [ @{ Requirement issue Key } ] Feature: [{ Requirement Issue Summary }] [{ Requirement Issue Description }] [Background: { Pre-Conditions }] [# { Test Issue Description }] @{ Test Issue Key } [@{ SubRequirement Issue Key 1 } ... @{ SubRequirement Issue Key N }] [@{ Test Set Issue Key 1 } ... @{ Test Set Issue Key N }] [@{ Test Issue Label 1 } ... @{ Test Issue Label N}] Scenario [Outline]: { Test Issue Summary } {Test Issue Steps} ... |
Feature File Naming Convention
<sequential_id_one_based>[_<issue_requirement_key>][_<issue_precondition_key>] |
...
generates the following 9 feature files feature files:
.FEATUREFile | Requirements | Pre-Condition | Tests | filenameFilename |
---|---|---|---|---|
1 | R1 | C1 | T1, T10 | 1_R1_C1.feature |
2 | R1 | - | T2 | 2_R1.feature |
3 | R2 | C1 | T4, T7 | 3_R2_C1.feature |
4 | R2 | C3 | T5 | 4_R2_C3.feature |
5 | R2 | - | T8 | 5_R2.feature |
6 | R3 | - | T8 | 6_R3.feature |
7 | R3 | C1 | T7 | 7_R3_C1.feature |
8 | - | C2 | T3, T9 | 8_C2.feature |
9 | - | - | T6 | 9.feature |
...