Versions Compared

Key

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

...

Expand
titlePOST /rest/raven/1.0/import/execution/bundle
Panel
borderColor#ccc
borderStylesolid

Import the execution results created with the Cucumber JSON output formatter. For more information, please check the Cucumber reports documentation.

Request

multipart/form-data:

"filePart" : a MultipartFormParam containing a compressed zip file to import or a JSON file to import.

Tip
titleExample Request
curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@cucumber_results.zip" http://yourserver/rest/raven/1.0/import/execution/bundle

Responses

200 OK : application/json : Successful. The results where successfully imported to Jira.

Code Block
titleExample Output
{
    "testExecIssue": {
           "id": "10000",
           "key": "DEMO-123",
           "self": "http://www.example.com/jira/rest/api/2/issue/10000"
     }
}

400 BAD_REQUEST : application/json : No execution results where provided.

401 UNAUTHORIZED : application/json : The Xray license is not valid.

500  INTERNAL SERVER ERROR : application/json : An internal error occurred when importing execution results.

...

How results are mapped to Test entities

Whenever importing results from some frameworks (i.e. JUnit, TestNG, NUnit, Robot framework), Xray can identify the automated test from the report/results file, based on an hardcoded criteria (such as the class name plus the class method corresponding to the automated test). However, depending on the test automation framework, it's possible to specify the Test issue key to which report the results in the test's code.

This means that in some scenarios, Xray is able to create (Generic) Test entities, if needed. These may be used afterwards, based on their Generic Definition field, if results related with those automated tests are reported once again. However, as mentioned earlier, it's also possible to enforce the Test entity to which report to.

Whenever processing results from a automation framework, for For each automated test result,

  1. If the Test key is provided and...
    1. it exists, then create a Test Run for that Test
    2. it doesn't exist, then don't create any Test Run (since for some reason the explicitly identified Test does not exist)
  2. if no Test key is provided...
    1. try to find a Test in the identified project  with the same Generic Test Definition (e.g. with the same class name+class method for example)
      1. if it exists, then create a Test Run for that Test
      2. if it doesn't exist, then search for a a Test with the same Generic Test Definition in all JIRA projects
        1. if it exists, then create a Test Run for that Test
        2. it doesn't exist, then create a Test in the identified project


For some frameworks, including Cucumber and Behave, Tests must exist previously to the submission of results related to them.

The reason for it,resides mainly in the fact that is not possible to create the complete Test specification from the results file.