Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

However, before moving into the actual implementation, you need to decide is which workflow we'll to use: do we you want to use Xray/Jira as the master for writing the declarative specification, or do we you want to manage those in Git?

This tutorial only showcases using how to use Xray/Jira as the master for editing the Cucumber Scenarios/Scenario Outlines.

...

If you have it, then you can just use the "Create Test" on that issue to create the Scenario/Scenario Outline and have it automatically linked back to the Story/"requirement.".

Otherwise, you can create the Test using the standard  (issue) Create action from Jira's top menu. 

...

In this case, we'll create a Cucumber Test, of Cucumber Type "Scenario.".

We can fill out the Gherkin statements immediately on the Jira issue create dialog or we can create the Test issue first and fill out the details on the next screen, from within the Test issue. In the latter case, we can take advantage of the built-in Gherkin editor which provides auto-complete of Gherkin steps.

...

After the Test is created it will impact the coverage of related "requirement," , if any.

The coverage and the test results can be tracked in the "requirement" side (e.g. user story). In this case, it changed from being UNCOVERED to NOTRUN (i.e. covered and with at least one test not run).

...

  • use the UI
  • use the REST API (more info here)
    • Code Block
      languagebash
      titleexample of a Bash script to export/generate the features from Xray
      #!/bin/bash
      
      curl -u admin:admin  "http://192jiraserver.168example.56.102com/rest/raven/1.0/export/test?keys=CALC-4763&fz=true" -o features.zip
      rm -f features/*.feature
      unzip -o features.zip  -d features
  • use one of the available CI/CD plugins (e.g. see an example of Integration with Jenkins)

...

After running the tests, results can be imported to Xray via the REST API, or the Import Execution Results action within the Test Execution, or by using one of the available CI/CD plugins (e.g. see an example of Integration with Jenkins).

...

Info
titleWhich Cucumber endpoint/"format" to use?

To import results, you can use two different endpoints/"formats" (endpoints described in Import Execution Results - REST):

  1. the "standard cucumber" endpoint
  2. the "multipart cucumber" endpoint

The standard cucumber endpoint (i.e. /import/execution/cucumber) is simpler but more restrictive: you cannot specify values for custom fields on the Test Execution that will be created.   This endpoint creates new Test Execution issues unless the Feature contains a tag having an issue key of an existing Test Execution.

The multipart cucumber endpoint will allow you to customize fields (e.g. Fix Version, Test Plan) , if you wish to do so , on the Test Execution that will be created. Note that this endpoint always creates new Test Executions (as of Xray v4.2).


In sum, if you want to customize the Fix Version, Test Plan and/or Test Environment of the Test Execution issue that will be created, you'll have to use the "multipart cucumber" endpoint.

...

Results are reflected on the covered item (e.g. Story). On its the issue screen, coverage now shows that the item is OK based on the latest testing results, that can also be tracked within the Test Coverage panel bellow. 

...