Automated Test Result Import
This chapter focuses on services for the automated test result import.
Import automated test suite results
A POST to /import/results/{iteration_id} imports a new automated test suite into the specified iteration.
The request payload must contain a list of test results, each identified by its reference field.
For details about the expected payload structure and behavior, see the Import Automated Test Results from Pipelines documentation.
Examples of integrating this endpoint into a CI/CD pipeline are available in the CI/CD How-To Guide.
Path parameters
| Parameter | Description |
|---|---|
|
the id of the iteration |
HTTP request
POST /api/rest/latest/import/results/100 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 979
Host: localhost:8080
{
"automated_test_suite" : {
"attachments" : [ {
"name" : "report.html",
"content" : "Base64-encoded content here..."
} ]
},
"tests" : [ {
"reference" : "testSuite.testClass.testRef1",
"dataset_name" : "admin_dataset",
"status" : "FAILURE",
"duration" : 35000,
"failure_details" : [ "1 is not equal to 2" ],
"attachments" : [ {
"name" : "screenshot.png",
"content" : "Base64-encoded content here..."
} ],
"test_steps" : [ {
"status" : "SUCCESS"
}, {
"status" : "FAILURE",
"attachments" : [ {
"name" : "step_screenshot.png",
"content" : "Base64-encoded content here..."
} ]
} ],
"custom_fields" : [ {
"code" : "NUMERIC",
"value" : 200
}, {
"code" : "TEXT",
"value" : "description"
}, {
"code" : "CHECKBOX",
"value" : "true"
}, {
"code" : "TAGS_RELATED",
"value" : [ "tag1", "tag2" ]
} ]
} ]
}
Request fields
| Path | Type | Description |
|---|---|---|
|
|
Info about the test suite execution. (optional) |
|
|
Test suite status : BLOCKED, CANCELLED, SUCCESS, RUNNING, SKIPPED or FAILURE. If not provided, it will be auto-calculated. (optional) |
|
|
Files attached to the suite. (optional) |
|
|
File name with its extension, among txt, html, xml or doc (e.g., report.html). (optional) |
|
|
Base64-encoded content, with a maximum size defined by the SquashTM instance. (optional) |
|
|
Individual test results. (mandatory) |
|
|
Automated test reference used for matching. The value must exactly match the "Automated Test Reference" field of the target Test Case in SquashTM). (mandatory) |
|
|
Dataset name used in SquashTM. (optional) |
|
|
Test status : BLOCKED, CANCELLED, SUCCESS, RUNNING, SKIPPED, FAILURE, or READY. (mandatory) |
|
|
Test duration in milliseconds. (optional) |
|
|
List of failure messages. (optional) |
|
|
Files related to the test. (optional) |
|
|
File name with its extension (e.g., report.html). Allowed extensions are determined by the SquashTM configuration. (optional) |
|
|
Base64-encoded content, with a maximum size defined by the SquashTM instance. (optional) |
|
|
Details of individual test steps. The number of these steps must be equal to the number of test steps in the corresponding test case. (optional) |
|
|
Test step status: BLOCKED, CANCELLED, SUCCESS, RUNNING, SKIPPED, FAILURE, or READY. (optional) |
|
|
Files related to the test step. (optional) |
|
|
File name with its extension (e.g., report.html). Allowed extensions are determined by the SquashTM configuration. (optional) |
|
|
Base64-encoded content, with a maximum size defined by the SquashTM instance. (optional) |
|
|
Custom fields related to the test. (optional) |
|
|
Code of the custom field as defined in SquashTM. (optional) |
|
|
Value of the custom field. The type depends on the configuration of the field in SquashTM. (optional) |
HTTP response
HTTP/1.1 204 No Content