Plan a test suite run
The following flow demonstrates how to use the REST API to plan a test suite run.
Entity relationship diagram
We need to access the following entities for this flow, and understand the relationships between these entities.
The following shows the relations in the flow.
Entity | Relationships in this flow | Description of relationship | Reference / relationship fields |
---|---|---|---|
Tests | Manual Tests, Gherkin Tests, and Test Suites | This aggregate resource collection represents types of tests, including manual tests, Gherkin tests, automated tests, and test suites. | subtype |
Manual Tests | Tests |
The manual test is a subtype of the tests aggregate resource collection. The manual test can also be accessed in the manual_tests resource collection. There is no field that relates back to the aggregate resource collection, tests. |
None |
Manual Tests | Steps |
Manual test steps are stored in the internal repository. Steps are accessed as a script resource under the corresponding test in the tests resource collection. |
tests\<test_ID>\script
|
Gherkin Tests | Tests |
The Gherkin test is a subtype of the tests aggregate resource collection. The Gherkin test can also be accessed in the gherkin_tests resource collection. There is no field that relates back to the aggregate resource collection, tests. |
None |
Gherkin Tests | Scripts |
Gherkin test scripts are stored in the internal repository. Scripts are accessed as a script resource under the corresponding test in the tests resource collection. |
tests\<test_ID>\script
|
Runs | Manual Test Runs and Test Suite Runs | This aggregate resource collection represents types of test runs, including manual runs and test suite runs. | subtype |
Suite Run | Runs |
The test suite run is a subtype of the runs aggregate resource collection. The test suite run can also be accessed in the suite_run resource collection. There is no field that relates back to the aggregate resource collection, runs. |
None |
Suite Run | Manual Test Runs |
Manual test runs that are associated with the test suite run are accessed using the array runs_in_suite. The array contains the IDs of associated tests and their run type (such as run_manual). |
runs_in_suite |
Releases | Manual Runs |
Runs can be associated with releases. |
release |
List Nodes | Manual Runs | Run statuses are in the list_node resource collection. | native_status |
Flow
Using the tests created in the Create a test suite with manual and Gherkin tests flow, we create a test suite run.
We POST a planned test suite run called MyTestSuiteRun. To create the run, we must supply:
-
The name (MyTestSuiteRun) and ID (1067) of the test suite we are "running."
-
The native status we want to assign to the run. Statuses are accessed in the list_node resource collection. In this flow, we will assign status 1095, which corresponds to list_node.run_native_status.planned.
-
The release associated with the planned test suite run.
POST .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/suite_run
Payload
{"data":[
{ "test":{"id":1067,"type":"test_suite"},
"native_status":{"id":1095,"type":"list_node"},
"name":"MyTestSuiteRun",
"release":{"id":1001,"type":"release"}
}
]
}
The test suite run is created with ID 1196.
{ "total_count": 1, "data": [ { "type": "run_suite", "id": "1196" } ], "exceeds_total_count": false }
See also: