Versions Compared

Key

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

Table of Contents

Overview

In this tutorial, we will create tests for Node.js, in Javascript, with Cucumber.js.

...

After being exported, the created .feature  feature(s) will contain references to the Test issue key and the covered "requirement" issue key,  if that's the case.

...

After running the tests and generating the Cucumber JSON  report, it 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?

There are two options here:

  1. use the "standard cucumber" endpoint
  2. use 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.



No Format
./node_modules/cucumber/bin/cucumber-js -f json:report.json 
curl -H "Content-Type: application/json" -X POST -u admin:admin --data @"merged-test-results.json" http://jiraserver.example.com/rest/raven/1.0/import/execution/cucumber

...