Details
-
Story
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Xray must provide support for JUnit XML format when importing execution results.
<?xml version="1.0" ?> <testsuites> <testsuite errors="0" failures="0" id="0" name="my test suite" tests="1"> <testcase classname="some.class.name" name="Test1" time="123.345000"/> </testsuite> </testsuites>
https://confluence.xpand-addons.com/display/XRAY/Taking+advantage+of+JUnit+XML+reports
Xray must provide methods on the REST API to load this format and also on the JIRA interface.
JUnit’s Test Cases are identified by the pair of attributes “classname” and “name” attributes.
Test Cases are imported to Xray’s Generic Test issues, and the “classname” and “name” attributes are concatenated and mapped to the Generic Test Definition field of the Generic Test.
If a Test already exists in the project, with the same Generic Test Definition, then it is not created again.
Test Cases are imported to a new (or user-specified) Test Execution in the context of some project, along with their respective execution results.
JUnit’s Test Suites are not mapped to any special entity. However, the execution details screen will show the Test Suite related to a specific test result.
Test Cases | Test status |
---|---|
with failures | FAIL |
with errors | FAIL |
skipped | TODO |
without failures, errors, and weren’t skipped | PASS |
Note: Test Cases with the status FAIL may have an error/failure message which can be seen in the Test Run screen, under the Results section. This error message may come on several attributes (failure, error, system-out and system-err) underneath the "testcase" element, so we should concatenate the values that come on the given attributes.
REST API endpoint: /api/v1/import/execution/junit
PATH PARAMETERS
parameter | type | description |
---|---|---|
projectKey | String | key of the project where the test execution (if the testExecKey parameter wasn't provided) and the tests (if they aren't created yet) are going to be created. |
testExecKey | String | key of the Test Execution. |
testPlanKey | String | key of the Test Plan; if you specify the Test Plan, the Tests will be added automatically to the Test Plan if they're not part of it. |
testEnvironments | String | a string containing a list of test environments separated by ";" |
revision | String | source code and documentation version used in the test execution. |
fixVersion | String | the Fix Version associated with the test execution (it supports only one value). |