Note: Publishing test results to create Living Documentation is only available in Behave Pro for Jira Cloud and for projects connected to a git repository

Test results from Cucumber can be visualized within Jira and Behave Pro to demonstrate development progress, release state, and Living Documentation of the software's functionality.

Creating an API key

To upload Cucumber test results, first you have to create an API key that will be used for authentication during the upload. Creating API key can be done by navigating to Behave Pro settings in your Jira project, then click the Configure button in the Living Documentation section.

Next, follow the API key setup. Make sure you have copied your API key, you will not be able to see it again. After you have created it, you will be able to see list of your API keys as shown below.

If you want to delete your API key, click on the three dots icon and select Revoke. This will permanently delete your API key.

Uploading test results

You can start uploading test result via a http request. You can use any command line tool to do that (curl, wget, etc.). For example, you can use the following curl command as shown below.

curl -L -X PUT \

-H "X-API-KEY: your_api_key” \

-H "X-COMMIT-ID: your_commit_sha" \

--data-binary @./target/cucumber-reports/cucumber.json

If you are using Powershell you can use the following command:

Invoke-WebRequest `

-Method PUT `

-Headers @{'X-COMMIT-ID'='your_commit_id';'X-API-KEY'='your_api_key'} `

-Infile ./target/cucumber-reports/cucumber.json

Note: Make sure your tool to send the test report follows the http 307 redirects. When using curl this can be done via -L option. The Invoke-WebRequest follows redirects by default.

Note: If you are using Jira Server or Jira Data Center, the URL to upload the test results is the domain name of your Jira followed by /rest/behavepro/1.0/bdd

For example:

Note: If you get an error "Can not deserialize instance of out of START_ARRAY token" then you need to upload the report as a raw file and not a JSON request. Unset the "Content-Type" header in your request, or set it to "application/octet-stream".

You have to send the test report as the body in the request and you will have to send the following headers:

  • X-API-KEY: This is the API key you have created in previous step.
  • X-COMMIT-ID: This is the sha of your commit. This must be the long version of the commit sha (40 characters).

The following headers are purely optional. It will affect how the test results will be displayed on the test results panel.

  • X-BUILD-ID: This is the build ID that will be shown on the user interface. If you are using matrix build then this build ID should be the same across all of your matrix jobs.
  • X-BUILD-URL: This will be shown on the user interface. This can be the url that links to your build. If you are running this manually (not in CI/CD) this can be any url.

To learn more about uploading test results from matrix jobs, you can read about it here.

Viewing test results

To see the scenarios with test results you need to click on the three dots icon and select the acceptance criteria from the dropdown on the issue page.

You will be able to see the scenarios with status of the test results. To see more details about the test results you need to click on the green tag (or red if the test has failed) as shown below.

After clicking on the test result, the details are displayed.

Did this answer your question?