Executions
This chapter focuses on services for the executions.
Updates from version 1.2.0:
-
There are 3 types of execution: standard, scripted and keyword.
-
The "script" property is from now available only for scripted execution.
-
There is no longer "language" property in execution. The language for scripted execution is always GHERKIN while there is no defined language for standard and keyword executions.
Get execution
A GET
to /executions/{id}
returns the execution with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the execution |
HTTP request
GET /api/rest/latest/executions/56 HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 3101
{
"_type" : "execution",
"id" : 56,
"name" : "sample test case 56",
"execution_order" : 4,
"execution_status" : "BLOCKED",
"last_executed_by" : "User-5",
"last_executed_on" : "2017-07-24T10:00:00.000+00:00",
"execution_mode" : "AUTOMATED",
"reference" : "SAMP_EXEC_56",
"dataset_label" : "sample dataset",
"execution_steps" : [ {
"_type" : "execution-step",
"id" : 22,
"execution_status" : "SUCCESS",
"action" : "<p>First action</p>",
"expected_result" : "<p>First result</p>",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/execution-steps/22"
}
}
}, {
"_type" : "execution-step",
"id" : 23,
"execution_status" : "BLOCKED",
"action" : "<p>Second action</p>",
"expected_result" : "<p>Second result</p>",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/execution-steps/23"
}
}
}, {
"_type" : "execution-step",
"id" : 27,
"execution_status" : "SUCCESS",
"action" : "<p>The Action</p>",
"expected_result" : "<p>The Result</p>",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/execution-steps/27"
}
}
} ],
"comment" : "<p>I have no comment</p>",
"prerequisite" : "<p>Being alive.</p>",
"description" : "<p>This is nice.</p>",
"importance" : "LOW",
"nature" : {
"code" : "NAT_SECURITY_TESTING"
},
"type" : {
"code" : "TYP_EVOLUTION_TESTING"
},
"test_case_status" : "APPROVED",
"test_plan_item" : {
"_type" : "iteration-test-plan-item",
"id" : 15,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/15"
}
}
},
"automated_execution_extender" : {
"_type" : "automated-execution-extender",
"id" : 778,
"result_url" : "http://1234:4567/jenkins/report",
"result_status" : "BLOCKED",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/automated-execution-extenders/778"
}
}
},
"custom_fields" : [ {
"code" : "CUF_TXT",
"label" : "cuf text",
"value" : "cuf text value"
}, {
"code" : "CUF_TXT_2",
"label" : "cuf text 2",
"value" : "cuf text value 2"
} ],
"test_case_custom_fields" : [ {
"code" : "TC_CUF_TXT",
"label" : "tc cuf text",
"value" : "tc cuf text value"
}, {
"code" : "TC_CUF_TXT_2",
"label" : "tc cuf text 2",
"value" : "tc cuf text value 2"
} ],
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/executions/56"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/87"
},
"test_plan_item" : {
"href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/15"
},
"execution-steps" : {
"href" : "http://localhost:8080/api/rest/latest/executions/56/execution-steps"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/executions/56/attachments"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity |
|
|
the id of the execution |
|
|
the name of the execution |
|
|
the order of the execution |
|
|
the status of the execution |
|
|
the user who last executed this execution |
|
|
the date this execution was last executed |
|
|
the execution mode of the execution |
|
|
the reference of this execution |
|
|
the label of the dataset used in this execution |
|
|
the steps of this execution |
|
|
the comment of this execution |
|
|
the prerequisite of this execution |
|
|
the description of this execution |
|
|
the importance of this execution |
|
|
the nature of this execution |
|
|
the type of this execution |
|
|
the status of the test case referenced by this execution |
|
|
the test plan item referenced by this execution |
|
|
the automated execution extender referenced by this execution (will be hidden if execution mode is manual) |
|
|
the denormalized custom fields of this execution |
|
|
the custom fields of the referenced test case |
|
|
the attachments of this execution |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to this execution |
|
link to the project of this execution |
|
link to the test plan item of this execution |
|
link to the execution steps of this execution |
|
link to the attachments of this execution |
Create execution for iteration test plan item
A POST
to /iteration-test-plan-items/{id}/executions
creates a new execution for the iteration test plan item with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the test plan element |
HTTP request
POST /api/rest/latest/iteration-test-plan-items/265/executions HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 2206
{
"_type" : "execution",
"id" : 25,
"name" : "Christmas turkey test flight",
"execution_order" : 0,
"execution_status" : "READY",
"last_executed_by" : null,
"last_executed_on" : null,
"execution_mode" : "MANUAL",
"reference" : "CHR-T024",
"dataset_label" : "",
"execution_steps" : [ {
"_type" : "execution-step",
"id" : 50,
"execution_status" : "READY",
"action" : "<p>arm the slingshot</p>",
"expected_result" : "<p>slingshot is armed</p>",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/execution-steps/50"
}
}
}, {
"_type" : "execution-step",
"id" : 51,
"execution_status" : "READY",
"action" : "<p>install the turkey</p>",
"expected_result" : "<p>the turkey groans and is in place</p>",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/execution-steps/51"
}
}
}, {
"_type" : "execution-step",
"id" : 52,
"execution_status" : "READY",
"action" : "<p>release the slingshot</p>",
"expected_result" : "<p>the turkey groans, at a distance though</p>",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/execution-steps/52"
}
}
} ],
"comment" : null,
"prerequisite" : "",
"description" : "<p>Will test the aerodynamic profile of a sample turkey</p>",
"importance" : "LOW",
"nature" : {
"code" : "NAT_PERFORMANCE_TESTING"
},
"type" : {
"code" : "TYP_COMPLIANCE_TESTING"
},
"test_case_status" : "WORK_IN_PROGRESS",
"custom_fields" : [ ],
"test_case_custom_fields" : [ ],
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/executions/25"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
},
"test_plan_item" : {
"href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/1"
},
"execution-steps" : {
"href" : "http://localhost:8080/api/rest/latest/executions/25/execution-steps"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/executions/25/attachments"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity, etc |
Links
Relation | Description |
---|---|
|
the link to this execution |
|
the link to the execution project |
|
the test plan item of this execution |
|
the link to the execution steps |
|
the attachments to the test plan element |
Modify an execution
A PATCH
to /executions/{id}
modifies the execution with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the execution |
HTTP request
PATCH /api/rest/latest/executions/83?fields=execution_status,comment,prerequisite,%20custom_fields,%20test_case_custom_fields HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 347
Host: localhost:8080
{
"_type" : "execution",
"custom_fields" : [ {
"code" : "TXT_STATUS",
"value" : "allright"
}, {
"code" : "TAGS_RELATED",
"value" : [ "see this", "also that" ]
} ],
"execution_status" : "RUNNING",
"comment" : "<p>the comment was modified...</p>",
"prerequisite" : "<p>impossible modification of the prerequisite</p>"
}
Request fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity (mandatory) |
|
|
the new status of that execution |
|
|
the new comment of the execution |
|
|
an array of custom fields |
|
|
the code of the custom field to modify |
|
|
the value of the custom field. It should match the type of the field (text, date etc). If the field accepts only a single value the content is a string, if it accepts multiple values (eg, tags) the content is an array of strings. |
Request parameters
Parameter | Description |
---|---|
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1176
{
"_type" : "execution",
"id" : 83,
"execution_status" : "RUNNING",
"comment" : "<p>the comment was modified...</p>",
"prerequisite" : "<p>... but the prerequisite was not</p>",
"custom_fields" : [ {
"code" : "TXT_STATUS",
"label" : "text",
"value" : "allright"
}, {
"code" : "TAGS_RELATED",
"label" : "see also",
"value" : [ "see this", "also that" ]
} ],
"test_case_custom_fields" : [ {
"code" : "TC_TEXT",
"label" : "test case cuf",
"value" : "I'm from the test case"
}, {
"code" : "TC_LABELS",
"label" : "labels",
"value" : [ "was", "not", "updated" ]
} ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/executions/83"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
},
"test_plan_item" : {
"href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/1"
},
"execution-steps" : {
"href" : "http://localhost:8080/api/rest/latest/executions/83/execution-steps"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/executions/83/attachments"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity, etc |
Links
Relation | Description |
---|---|
|
the link to this execution |
|
the link to the execution project |
|
the link to the test plan item of this execution |
|
the link to the execution steps |
|
the link to the attachments |
Delete an execution
A DELETE
to /executions/{id}
delete one execution with the given id.
Path parameters
Parameter | Description |
---|---|
|
the list of ids of the execution |
HTTP request
DELETE /api/rest/latest/executions/44 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Get steps of execution
A GET
to /executions/{id}/execution-steps
returns all the execution steps of the execution with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the execution |
HTTP request
GET /api/rest/latest/executions/10/execution-steps?size=1&page=1 HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
number of the page to retrieve (optional) |
|
size of the page to retrieve (optional) |
|
which attributes of the returned entities should be sorted on (optional) |
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1918
{
"_embedded" : {
"execution-steps" : [ {
"_type" : "execution-step",
"id" : 10,
"execution_status" : "SUCCESS",
"action" : "<p>This is the first action.</p>",
"expected_result" : "<p>This is the first result.</p>",
"comment" : "<p>And that is the comment</p>",
"last_executed_by" : "User-8U122",
"last_executed_on" : "2017-07-31T10:00:00.000+00:00",
"execution_step_order" : 0,
"referenced_test_step" : null,
"execution" : {
"_type" : "execution",
"id" : 7,
"execution_status" : "SUCCESS",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/executions/7"
}
}
},
"custom_fields" : [ {
"code" : "CUF_TAG",
"label" : "Tag Cuf",
"value" : [ "tag_1", "tag_2", "tag_3" ]
} ],
"test_step_custom_fields" : [ {
"code" : "CUF_TXT",
"label" : "Basic Text Cuf",
"value" : "The Value"
} ],
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/execution-steps/10"
}
}
} ]
},
"_links" : {
"first" : {
"href" : "http://localhost:8080/api/rest/latest/executions/10/execution-steps?page=0&size=1"
},
"prev" : {
"href" : "http://localhost:8080/api/rest/latest/executions/10/execution-steps?page=0&size=1"
},
"self" : {
"href" : "http://localhost:8080/api/rest/latest/executions/10/execution-steps?page=1&size=1"
},
"next" : {
"href" : "http://localhost:8080/api/rest/latest/executions/10/execution-steps?page=2&size=1"
},
"last" : {
"href" : "http://localhost:8080/api/rest/latest/executions/10/execution-steps?page=2&size=1"
}
},
"page" : {
"size" : 1,
"totalElements" : 3,
"totalPages" : 3,
"number" : 1
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the list of elements for that page |
|
|
the page size for that query |
|
|
total number of elements the user is allowed to read |
|
|
how many pages can be browsed |
|
|
the page number |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to the first page (optional) |
|
link to the previous page (optional) |
|
link to this page |
|
link to the next page (optional) |
|
link to the last page (optional) |
Attach issue to an execution
A POST
to /executions/{id}/issues
attach an issue to an execution with given id. The identifier of the remote issue must be specified; however the bugtracker on which it is hosted is implied by the configuration of the Squash-TM project of the execution.
The actual format of the remote identifier depends on the type of bugtracker you are referencing. For example for issues hosted on Mantis the remote identifier is the ID, while for JIRA the remote identifier is the issue key. You can verify which format is expected in Squash-TM by testing first with the UI, eg in the table of known issues of an iteration.
Note that you cannot declare a new issue this way - post it straight to the bugtracker instead !
Path parameters
Parameter | Description |
---|---|
|
the id of the execution |
HTTP request
POST /api/rest/latest/executions/15/issues HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 51
Host: localhost:8080
{
"_type" : "issue",
"remoteIssueId" : "9999"
}
Request fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity |
|
|
the identifier of the issue |
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 354
{
"_type" : "issue",
"id" : 30,
"remoteIssueId" : "9999",
"execution" : {
"_type" : "execution",
"id" : 15,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/executions/15"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/issues/30"
}
}
}