Test Suites
This chapter focuses on services for the test suites.
Note : A Test Suite is a partition of an Iteration, more specifically its test plan is a partition of that of the Iteration it belongs to. Technically they share the same instances of IterationTestPlanItem; however the lifecycle of those items is managed by the Iteration only. Therefore, in the context of a Test Suite the semantic of PUTing or DELETEing an item changes slightly : those operations becomes 'attach' or 'detach' items. An item is available to a Test Suite only if it has been created first within the Iteration.
Get test suite
A GET
to /test-suites/{id}
returns the test suite with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the test suite |
HTTP request
GET /api/rest/latest/test-suites/9 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: 2700
{
"_type" : "test-suite",
"id" : 9,
"name" : "sample test suite",
"description" : "<p>this is a sample test suite</p>",
"status" : "READY",
"parent" : {
"_type" : "iteration",
"id" : 101,
"name" : "second iteration",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/101"
}
}
},
"created_by" : "admin",
"created_on" : "2017-07-12T10:00:00.000+0000",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-12T10:00:00.000+0000",
"custom_fields" : [ {
"code" : "CF_TXT",
"label" : "cuf text",
"value" : "the_value"
}, {
"code" : "CF_TAG",
"label" : "cuf tag",
"value" : [ "tag_1", "tag_2" ]
} ],
"test_plan" : [ {
"_type" : "iteration-test-plan-item",
"id" : 80,
"execution_status" : "READY",
"referenced_test_case" : {
"_type" : "test-case",
"id" : 90,
"name" : "first test case",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/90"
}
}
},
"referenced_dataset" : {
"_type" : "dataset",
"id" : 5,
"name" : "dataset",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/5"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/80"
}
}
}, {
"_type" : "iteration-test-plan-item",
"id" : 41,
"execution_status" : "SUCCESS",
"referenced_test_case" : {
"_type" : "test-case",
"id" : 91,
"name" : "test case 2",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/91"
}
}
},
"referenced_dataset" : {
"_type" : "dataset",
"id" : 9,
"name" : "dataset",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/9"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/41"
}
}
} ],
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-suites/9"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
},
"iteration" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/101"
},
"test-plan" : {
"href" : "http://localhost:8080/api/rest/latest/test-suites/9/test-plan"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-suites/9/attachments"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the id of the test suite |
|
|
the type of the entity |
|
|
the name of the test suite |
|
|
the description of the test suite |
|
|
the status of the test suite |
|
|
the parent entity of the test suite |
|
|
the user who created the test suite |
|
|
the date the test suite was created |
|
|
the user who last modified the test suite |
|
|
the date the test suite was last modified |
|
|
the custom fields of the test suite |
|
|
the iteration test plan items of the test suite |
|
|
the attachments of the test suite |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to this test suite |
|
link to the project the test suite belongs to |
|
link to the iteration the test suite belongs to |
|
link the test plan of the test suite |
|
link the test plan of the test suite |
Create test suite
A POST
to /test-suites
creates a new test suite with or without test plan .
HTTP request
POST /api/rest/latest/test-suites HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 430
{
"_type" : "test-suite",
"name" : "sample test suite",
"description" : "<p>this is a sample test suite</p>",
"parent" : {
"_type" : "iteration",
"id" : 101
},
"custom_fields" : [ {
"code" : "CF_TXT",
"label" : "cuf text",
"value" : "the_value"
} ],
"test_plan" : [ {
"_type" : "iteration-test-plan-item",
"id" : 80
}, {
"_type" : "iteration-test-plan-item",
"id" : 41
} ]
}
Request fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity |
|
|
the name of the iteration |
|
|
the description of the test suite |
|
|
the parent iteration of this test suite |
|
|
the iteration test plan items of the test suite (optional) |
|
|
the custom fields of this iteration |
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
Content-Length: 2700
{
"_type" : "test-suite",
"id" : 9,
"name" : "sample test suite",
"description" : "<p>this is a sample test suite</p>",
"status" : "READY",
"parent" : {
"_type" : "iteration",
"id" : 101,
"name" : "second iteration",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/101"
}
}
},
"created_by" : "admin",
"created_on" : "2017-07-12T10:00:00.000+0000",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-12T10:00:00.000+0000",
"custom_fields" : [ {
"code" : "CF_TXT",
"label" : "cuf text",
"value" : "the_value"
}, {
"code" : "CF_TAG",
"label" : "cuf tag",
"value" : [ "tag_1", "tag_2" ]
} ],
"test_plan" : [ {
"_type" : "iteration-test-plan-item",
"id" : 80,
"execution_status" : "READY",
"referenced_test_case" : {
"_type" : "test-case",
"id" : 90,
"name" : "first test case",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/90"
}
}
},
"referenced_dataset" : {
"_type" : "dataset",
"id" : 5,
"name" : "dataset",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/5"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/80"
}
}
}, {
"_type" : "iteration-test-plan-item",
"id" : 41,
"execution_status" : "SUCCESS",
"referenced_test_case" : {
"_type" : "test-case",
"id" : 91,
"name" : "test case 2",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/91"
}
}
},
"referenced_dataset" : {
"_type" : "dataset",
"id" : 9,
"name" : "dataset",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/9"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/41"
}
}
} ],
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-suites/9"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
},
"iteration" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/101"
},
"test-plan" : {
"href" : "http://localhost:8080/api/rest/latest/test-suites/9/test-plan"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-suites/9/attachments"
}
}
}
Modify test suite
A PATCH
to /test-suites/{id}
modifies the test suite with de given id. You can modify description, status, and/or custom fields.
Path parameters
Parameter | Description |
---|---|
|
the id of the test suite |
HTTP request
PATCH /api/rest/latest/test-suites/9 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Content-Length: 229
{
"_type" : "test-suite",
"description" : "<p>modified description sample test suite</p>",
"status" : "SUCCESS",
"custom_fields" : [ {
"code" : "CF_TXT",
"label" : "cuf text",
"value" : "the_new_value"
} ]
}
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 2717
{
"_type" : "test-suite",
"id" : 9,
"name" : "sample test suite",
"description" : "<p>modified description sample test suite</p>",
"status" : "SUCCESS",
"parent" : {
"_type" : "iteration",
"id" : 101,
"name" : "second iteration",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/101"
}
}
},
"created_by" : "admin",
"created_on" : "2017-07-12T10:00:00.000+0000",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-12T10:00:00.000+0000",
"custom_fields" : [ {
"code" : "CF_TXT",
"label" : "cuf text",
"value" : "the_new_value"
}, {
"code" : "CF_TAG",
"label" : "cuf tag",
"value" : [ "tag_1", "tag_2" ]
} ],
"test_plan" : [ {
"_type" : "iteration-test-plan-item",
"id" : 80,
"execution_status" : "READY",
"referenced_test_case" : {
"_type" : "test-case",
"id" : 90,
"name" : "first test case",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/90"
}
}
},
"referenced_dataset" : {
"_type" : "dataset",
"id" : 5,
"name" : "dataset",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/5"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/80"
}
}
}, {
"_type" : "iteration-test-plan-item",
"id" : 41,
"execution_status" : "SUCCESS",
"referenced_test_case" : {
"_type" : "test-case",
"id" : 91,
"name" : "test case 2",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/91"
}
}
},
"referenced_dataset" : {
"_type" : "dataset",
"id" : 9,
"name" : "dataset",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/9"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/41"
}
}
} ],
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-suites/9"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
},
"iteration" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/101"
},
"test-plan" : {
"href" : "http://localhost:8080/api/rest/latest/test-suites/9/test-plan"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-suites/9/attachments"
}
}
}
Delete test suite
A DELETE
to /test-suites/{ids}
deletes one or several test suites with the given id(s).
Path parameters
Parameter | Description |
---|---|
|
the list of ids of the test suites |
HTTP request
DELETE /api/rest/latest/test-suites/169 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Detach item of test suite
A DELETE
to /test-suites/{idTestSuite}/test-plan/{ids}
Detached one or several test plan item of test suite with the given id(s).
Path parameters
Parameter | Description |
---|---|
|
the id of the test suite |
|
the id(s) of the test plan item |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 2009
{
"_type" : "test-suite",
"id" : 9,
"name" : "sample test suite",
"description" : "<p>modified description sample test suite</p>",
"status" : "SUCCESS",
"parent" : {
"_type" : "iteration",
"id" : 101,
"name" : "second iteration",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/101"
}
}
},
"created_by" : "admin",
"created_on" : "2017-07-12T10:00:00.000+0000",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-12T10:00:00.000+0000",
"custom_fields" : [ {
"code" : "CF_TXT",
"label" : "cuf text",
"value" : "the_new_value"
}, {
"code" : "CF_TAG",
"label" : "cuf tag",
"value" : [ "tag_1", "tag_2" ]
} ],
"test_plan" : [ {
"_type" : "iteration-test-plan-item",
"id" : 80,
"execution_status" : "READY",
"referenced_test_case" : {
"_type" : "test-case",
"id" : 90,
"name" : "first test case",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/90"
}
}
},
"referenced_dataset" : {
"_type" : "dataset",
"id" : 5,
"name" : "dataset",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/5"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/80"
}
}
} ],
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-suites/9"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
},
"iteration" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/101"
},
"test-plan" : {
"href" : "http://localhost:8080/api/rest/latest/test-suites/9/test-plan"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-suites/9/attachments"
}
}
}
Get plans of test suite
A GET
to /test-suites/{id}/test-plan
returns all the test plans of the test suite with the given id.
HTTP request
GET /api/rest/latest/test-suites/44/test-plan 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 fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 4467
{
"_embedded" : {
"test-plan" : [ {
"_type" : "iteration-test-plan-item",
"id" : 1,
"execution_status" : "BLOCKED",
"referenced_test_case" : {
"_type" : "test-case",
"id" : 1,
"name" : "sample test case 1",
"reference" : "",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/1"
}
}
},
"referenced_dataset" : {
"_type" : "dataset",
"id" : 1,
"name" : "sample dataset 1",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/1"
}
}
},
"last_executed_by" : "User-1",
"last_executed_on" : "2017-07-13T10:00:00.000+0000",
"assigned_to" : "User-1",
"executions" : [ {
"_type" : "execution",
"id" : 11,
"execution_status" : "FAILURE",
"last_executed_by" : "User-1",
"last_executed_on" : "2017-07-13T10:00:00.000+0000",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/executions/11"
}
}
}, {
"_type" : "execution",
"id" : 21,
"execution_status" : "BLOCKED",
"last_executed_by" : "User-1",
"last_executed_on" : "2017-07-13T10:00:00.000+0000",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/executions/21"
}
}
} ],
"iteration" : {
"_type" : "iteration",
"id" : 1,
"name" : "sample iteration 1",
"reference" : "IT1",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/1"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/1"
}
}
}, {
"_type" : "iteration-test-plan-item",
"id" : 2,
"execution_status" : "SUCCESS",
"referenced_test_case" : {
"_type" : "test-case",
"id" : 2,
"name" : "sample test case 2",
"reference" : "",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/2"
}
}
},
"referenced_dataset" : {
"_type" : "dataset",
"id" : 2,
"name" : "sample dataset 2",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/2"
}
}
},
"last_executed_by" : "User-2",
"last_executed_on" : "2017-07-15T10:00:00.000+0000",
"assigned_to" : "User-2",
"executions" : [ {
"_type" : "execution",
"id" : 12,
"execution_status" : "SUCCESS",
"last_executed_by" : "User-2",
"last_executed_on" : "2017-07-07T10:00:00.000+0000",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/executions/12"
}
}
}, {
"_type" : "execution",
"id" : 22,
"execution_status" : "BLOCKED",
"last_executed_by" : "User-2",
"last_executed_on" : "2017-07-15T10:00:00.000+0000",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/executions/22"
}
}
}, {
"_type" : "execution",
"id" : 32,
"execution_status" : "RUNNING",
"last_executed_by" : "User-2",
"last_executed_on" : "2017-07-20T10:00:00.000+0000",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/executions/32"
}
}
} ],
"iteration" : {
"_type" : "iteration",
"id" : 2,
"name" : "sample iteration 2",
"reference" : "IT2",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/2"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/2"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-suites/44/test-plan?page=0&size=20"
}
},
"page" : {
"size" : 20,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
}
}