Executions
This chapter focuses on services for the 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;charset=UTF-8
Content-Length: 3092
{
"_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:00Z",
"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 date this execution was last executed |
|
|
the user who last executed this execution |
|
|
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 |
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&fields=execution_status%2Ccomment%2Cprerequisite%2C+custom_fields%2C+test_case_custom_fields HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 451
{
"_type" : "execution",
"custom_fields" : [ {
"code" : "TXT_STATUS",
"value" : "allright"
}, {
"code" : "TAGS_RELATED",
"value" : [ "see this", "also that" ]
} ],
"test_case_custom_fields" : [ {
"code" : "TC_TEXT",
"value" : "I'm from the test case"
} ],
"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. |
|
|
the original custom fields of the test case run by this execution |
|
|
the code of the test case custom field |
|
|
the value of the test case custom field. It applies the same rules than the execution custom_fields |
Request parameters
Parameter | Description |
---|---|
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
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 |
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&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) |
|
level of depth of the content that should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1909
{
"_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:00Z",
"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?size=1&page=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 client 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) |