Cucumber is a framework for BDD, where the test specification is done in natural language, while the implementation of each specification's phrase (i.e. step) is done in code. The step's code may be done in Java, Ruby, C#, or any other language in fact.
Xray provides the tooling for making the specification inside JIRA (the implementation code is out of Xray's scope).
In this workflow, Tests are created/managed always in JIRA.
Note that Cucumber steps and related code may in fact be implemented before the first step, or may even not be needed to be implemented for a given Test if all the sentences are already implemented as code.
See Automated Tests (Import/Export) for more info on how Cucumber feature files are generated and how to import back results to Xray. |
This worfklow can apply to legacy/existing projects, that already have Cucumber tests in some version control system (e.g. GIT, SVN), possibly alongside software's implementation.
There are also cases where users prefer to edit Cucumber tests in some other tool; even so, they can take advantage of Xray.
Existing Cucumber tests are initialy imported to JIRA, or can even be imported at a regular basis if needed. Editing of Cucumber tests can then proceed only on JIRA side, or can be done simultaneously in JIRA and in some other tool. However, it is recommended to keep the edition of tests only on one side, preferably JIRA.
As of Xray v2.3.x, step 2) is not idempotent. This means that if you try to import multiple times Cucumber Tests using the endpoint Importing Cucumber Tests - REST, you may end up with repeated entities in JIRA. |
Most probably you're trying to submit a cucumber json results file without having previously created the Cucumber Tests (i.e. scenario/scenario outline) in JIRA.
You need to first have these Test issues created beforehand in JIRA, with the correct specification. Then you need to export those Tests to one or more cucumber .feature files, so you're able to run them in your CI environment.
Following this workflow is important because whenever you export the features from JIRA, along with respective Cucumber scenarios/scenario outlines, the scenarios will be tagged with some labels that will allow Xray to map the results back to the proper entities in JIRA.
No. It's not possible to properly recreate the Cucumber Scenario/Scenario Outline/Background from a cucumber result file in JSON format.
Our recommendation is to manage it in JIRA and always edit the Cucumber Scenarios/Scenario Outlines/Backgrounds there.