Automated Test Result Import

This chapter focuses on services for the automated test result import.

post 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

Table 1. /api/rest/latest/import/results/{iteration_id}
Parameter Description

iteration_id

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

automated_test_suite

Object

Info about the test suite execution. (optional)

automated_test_suite.status

String

Test suite status : BLOCKED, CANCELLED, SUCCESS, RUNNING, SKIPPED or FAILURE. If not provided, it will be auto-calculated. (optional)

automated_test_suite.attachments

Array

Files attached to the suite. (optional)

automated_test_suite.attachments[].name

String

File name with its extension, among txt, html, xml or doc (e.g., report.html). (optional)

automated_test_suite.attachments[].content

String

Base64-encoded content, with a maximum size defined by the SquashTM instance. (optional)

tests

Array

Individual test results. (mandatory)

tests[].reference

String

Automated test reference used for matching. The value must exactly match the "Automated Test Reference" field of the target Test Case in SquashTM). (mandatory)

tests[].dataset_name

String

Dataset name used in SquashTM. (optional)

tests[].status

String

Test status : BLOCKED, CANCELLED, SUCCESS, RUNNING, SKIPPED, FAILURE, or READY. (mandatory)

tests[].duration

Number

Test duration in milliseconds. (optional)

tests[].failure_details

Array

List of failure messages. (optional)

tests[].attachments

Array

Files related to the test. (optional)

tests[].attachments[].name

String

File name with its extension (e.g., report.html). Allowed extensions are determined by the SquashTM configuration. (optional)

tests[].attachments[].content

String

Base64-encoded content, with a maximum size defined by the SquashTM instance. (optional)

tests[].test_steps

Array

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)

tests[].test_steps[].status

String

Test step status: BLOCKED, CANCELLED, SUCCESS, RUNNING, SKIPPED, FAILURE, or READY. (optional)

tests[].test_steps[].attachments

Array

Files related to the test step. (optional)

tests[].test_steps[].attachments[].name

String

File name with its extension (e.g., report.html). Allowed extensions are determined by the SquashTM configuration. (optional)

tests[].test_steps[].attachments[].content

String

Base64-encoded content, with a maximum size defined by the SquashTM instance. (optional)

tests[].custom_fields

Array

Custom fields related to the test. (optional)

tests[].custom_fields[].code

String

Code of the custom field as defined in SquashTM. (optional)

tests[].custom_fields[].value

Varies

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