Import Results - Automated upload using REST API
AIO Tests supports importing of the automation test execution reports through the Import Results API. This article covers the options available while importing results.
After mapping automated tests to AIO tests and executing the test suite, the results file is generated.
This results file can then be imported by passing the file as part of a multipart/form-data request.
Try it out:
AIO Tests Swagger
In this documentation, you’ll understand:
API Details:
TestNG
curl -X POST "https://tcms.aiojiraapps.com/aio-tcms/api/v1/project/AT/testcycle/AT-CY-Adhoc/import/results?type=Testng"
-H "accept: application/json;charset=utf-8"
-H "Content-Type: multipart/form-data"
-F "createNewRun=true"
-F "addCaseToCycle=true"
-F "createCase=true"
-F "file=@testng-results.xml;type=text/xml"
JUnit
curl -X POST "https://tcms.aiojiraapps.com/aio-tcms/api/v1/project/AT/testcycle/AT-CY-Adhoc/import/results?type=Junit"
-H "accept: application/json;charset=utf-8"
-H "Content-Type: multipart/form-data"
-F "createNewRun=true"
-F "addCaseToCycle=true"
-F "createCase=true"
-F "file=@TEST-featureTest.xml;type=text/xml"
The API assumes the cycle to be pre-existing, it can either be created from the AIO Tests interface or by using the Create Cycle API.
Explanation of Parameters :
Form Data parameters | Description | Default |
---|---|---|
file | File [results.xml] | Mandatory |
createNewRun | Helps control the creation of new runs for repeating tests in a suite execution. Repeating tests may be due to data driven cases or multiple invocation cases. | true |
addCaseToCycle | If mapped case is not already existing in the cycle being executed, adds the case to the cycle and reports results for the case. AIO Tests only considers mappings which start with “JiraProjName-TC”- and not all groups | true |
createCase | For cases where no key or automation key is found in AIO Tests, if createCase is set to true, a new case is created and added to cycle. |
|
updateDatasets | Only impacts tests based on datasets. If set to true, it adds/removes datasets from data driven tests. Can be set to false in retries where subset of datasets only may have been executed. |
|
forceUpdateCase | Only applies to Robot cases that include steps. Set to false to prevent steps from being updated from results file. Helpful if users dont want to update the steps from the file. | false |
defaultFolder | Assist users in configuring the folder ID to designate the default folder for cases generated via import. |
|
Explanation of Response :
Sample Response
Known Errors List (as part of errors.msg above):
Invalid xml: Unable to parse file. Please check if it is a valid results.xml file
.<Case key> is in Under Review/Draft status. Only published cases can be added to cycle
.<Case key> not found or you don't have privileges to add this case.
Case does not exist in the cycle. Set addCaseToCycle if you wish to add
.No case found with this automation key. Either map automation key or set createCase to true.
Unable to update automation data in the case. Insufficient permissions to edit cases in the project.
Response Errors
For further queries and suggestions, please feel free to reach out to our customer support service via help@aiotests.com.