Test Case Folders
This chapter focuses on services for the test case folders.
Get all test case folders
A GET
to /test-case-folders
returns all the test case folders that the user is allowed to read.
HTTP request
GET /api/rest/latest/test-case-folders?page=1&size=3 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) |
|
which type of the element should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1414
{
"_embedded" : {
"test-case-folders" : [ {
"_type" : "test-case-folder",
"id" : 100,
"name" : "top-secret",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/100"
}
}
}, {
"_type" : "test-case-folder",
"id" : 101,
"name" : "confidential",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/101"
}
}
}, {
"_type" : "test-case-folder",
"id" : 102,
"name" : "restricted access",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/102"
}
}
} ]
},
"_links" : {
"first" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders?page=0&size=3"
},
"prev" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders?page=0&size=3"
},
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders?page=1&size=3"
},
"next" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders?page=2&size=3"
},
"last" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders?page=3&size=3"
}
},
"page" : {
"size" : 3,
"totalElements" : 10,
"totalPages" : 4,
"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) |
Get test case folders tree by project
A GET
to /test-case-folders/tree/{ids}
returns the test case folders by projects that the user is allowed to read.
HTTP request
GET /api/rest/latest/test-case-folders/tree/10,11 HTTP/1.1
Accept: application/json
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 697
[ {
"_type" : "project",
"id" : 10,
"name" : "project-1",
"folders" : [ {
"_type" : "test-case-folder",
"id" : 100,
"name" : "folder1",
"url" : "http://localhost:8080/api/rest/latest/test-case-folders/100",
"children" : [ ]
}, {
"_type" : "test-case-folder",
"id" : 101,
"name" : "folder2",
"url" : "http://localhost:8080/api/rest/latest/test-case-folders/101",
"children" : [ ]
} ]
}, {
"_type" : "project",
"id" : 11,
"name" : "project-2",
"folders" : [ {
"_type" : "test-case-folder",
"id" : 102,
"name" : "folder3",
"url" : "http://localhost:8080/api/rest/latest/test-case-folders/102",
"children" : [ ]
} ]
} ]
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity |
|
|
id of project |
|
|
name of project |
|
|
all folders for the given project |
|
|
the type of the entity |
|
|
id of the test case folder |
|
|
name of the test case folder |
|
|
url of the test case folder |
|
|
children folders |
Create test case folder
A POST
to /test-case-folders
creates a new test case folder. The parent object and the name are required; refer to the complete reference of Get test case folder for the other attributes.
HTTP request
POST /api/rest/latest/test-case-folders HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 257
Host: localhost:8080
{
"_type" : "test-case-folder",
"name" : "Test case folder 1",
"description" : "Description Test case folder 1",
"custom_fields" : [ {
"code" : "cuf1",
"value" : "Cuf1 Value"
} ],
"parent" : {
"_type" : "project",
"id" : 14
}
}
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 1351
{
"_type" : "test-case-folder",
"id" : 33,
"name" : "Test case folder 1",
"project" : {
"_type" : "project",
"id" : 14,
"name" : "Test Project 1",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
}
}
},
"parent" : {
"_type" : "project",
"id" : 14,
"name" : "Test Project 1",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
}
}
},
"created_by" : "admin",
"created_on" : "2017-06-15T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2017-06-15T10:00:00.000+00:00",
"description" : "Description Test case folder 1",
"custom_fields" : [ {
"code" : "cuf1",
"label" : "Lib Cuf1",
"value" : "Cuf1 Value"
}, {
"code" : "cuf2",
"label" : "Lib Cuf2",
"value" : "true"
} ],
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/33"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
},
"content" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/33/content"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/33/attachments"
}
}
}
Get test case folder
A GET
to /test-case-folders/{id}
returns the test case folder with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the test case folder |
HTTP request
GET /api/rest/latest/test-case-folders/24 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: 1277
{
"_type" : "test-case-folder",
"id" : 24,
"name" : "Recipes : A-F",
"project" : {
"_type" : "project",
"id" : 10,
"name" : "Recipes inventory",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/10"
}
}
},
"path" : "/Recipes inventory/Recipes : A-F",
"parent" : {
"_type" : "project",
"id" : 10,
"name" : "Recipes inventory",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/10"
}
}
},
"created_by" : "User-1",
"created_on" : "2011-09-30T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2017-06-16T10:00:00.000+00:00",
"description" : "<p>All recipes in alphabetical order from A to F inclusive</p>",
"custom_fields" : [ ],
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/24"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/10"
},
"content" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/24/content"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/24/attachments"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the id of the entity |
|
|
the type of the entity |
|
|
name of the entity |
|
|
project of the entity |
|
|
the location of the entity (either a folder or the project if located at the root of the library) |
|
|
the path of the entity |
|
|
user that created the entity |
|
|
timestamp of the creation (ISO 8601) |
|
|
user that modified the entity the most recently |
|
|
timestamp of last modification (ISO 8601) |
|
|
description of that entity (html) |
|
|
the attachments of that entity |
|
|
related links |
|
|
the custom fields of this execution step |
Links
Relation | Description |
---|---|
|
the link to this folder |
|
the link to its project |
|
the link to its content |
|
the link to its attachments |
Modify test case folder
A Patch
to /test-case-folders/{id}
modifies the test case folder with the given id.
HTTP request
PATCH /api/rest/latest/test-case-folders/33 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 247
Host: localhost:8080
{
"_type" : "test-case-folder",
"name" : "Update - Test case folder 1",
"description" : "Update - Description Test case folder 1",
"custom_fields" : [ {
"code" : "cuf1",
"label" : "Lib Cuf1",
"value" : "Cuf1 new value"
} ]
}
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1369
{
"_type" : "test-case-folder",
"id" : 33,
"name" : "Update - Test case folder 1",
"project" : {
"_type" : "project",
"id" : 14,
"name" : "Test Project 1",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
}
}
},
"parent" : {
"_type" : "project",
"id" : 14,
"name" : "Test Project 1",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
}
}
},
"created_by" : "admin",
"created_on" : "2017-06-15T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2017-06-15T10:00:00.000+00:00",
"description" : "Update - Description Test case folder 1",
"custom_fields" : [ {
"code" : "cuf1",
"label" : "Lib Cuf1",
"value" : "Cuf1 Value"
}, {
"code" : "cuf2",
"label" : "Lib Cuf2",
"value" : "true"
} ],
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/33"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
},
"content" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/33/content"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/33/attachments"
}
}
}
Delete test case folder
A DELETE
to /test-case-folders/{ids}
deletes one or several test case folder with the given id(s). Remember that deleting a folder entails that its content is deleted as well. Also note that test cases that are called by other test cases will not be deleted, unless those test cases are deleted in the same batch.
Path parameters
Parameter | Description |
---|---|
|
the list of ids of the test case folders |
HTTP request
DELETE /api/rest/latest/test-case-folders/21,22 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Get test case folder contents
A GET
to /test-case-folders/{id}/content
returns the content of the test case folder with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the test-case-folder |
HTTP request
GET /api/rest/latest/test-case-folders/180/content 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), available values : root or nested (more info in Parameter 'include' section) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1259
{
"_embedded" : {
"content" : [ {
"_type" : "test-case",
"id" : 13,
"name" : "walk test",
"reference" : "",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/13"
}
}
}, {
"_type" : "scripted-test-case",
"id" : 150,
"name" : "fly test",
"reference" : "",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/150"
}
}
}, {
"_type" : "keyword-test-case",
"id" : 180,
"name" : "swim test",
"reference" : "",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/180"
}
}
}, {
"_type" : "test-case-folder",
"id" : 1467,
"name" : "other, non-natural motions",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/1467"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/180/content?page=0&size=20"
}
},
"page" : {
"size" : 20,
"totalElements" : 4,
"totalPages" : 1,
"number" : 0
}
}
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) |