Test Cases
This chapter focuses on services for the test cases.
Updates from version 1.2.0:
-
There are 3 types of test case: standard, scripted and keyword.
-
The "kind" property is no longer available in test case. The test case type is, instead, specified/defined by "_type" property.
-
The "script" property is from now available only for scripted test case.
-
There is no longer "language" property in test case. The language for scripted test case is always GHERKIN while there is no defined language for standard and keyword test cases.
Get all test cases
A GET
to /test-cases
returns all the test-cases that the user is allowed to read.
Type ('all', 'standard', 'scripted' or 'keyword') can be added as filter parameter to return the test cases with specific type.
HTTP request
GET /api/rest/latest/test-cases?page=1&size=2&fields=name,reference,script 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: 1640
{
"_embedded" : {
"test-cases" : [ {
"_type" : "test-case",
"id" : 1,
"name" : "sample standard test case",
"reference" : "TC1",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/1"
}
}
}, {
"_type" : "scripted-test-case",
"id" : 2,
"name" : "sample script test case",
"reference" : "TC2",
"script" : "This is a new Gherkin test",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/2"
}
}
}, {
"_type" : "keyword-test-case",
"id" : 3,
"name" : "sample keyword test case",
"reference" : "TC3",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/3"
}
}
} ]
},
"_links" : {
"first" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases?fields=name,reference,script&page=0&size=2"
},
"prev" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases?fields=name,reference,script&page=0&size=2"
},
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases?fields=name,reference,script&page=1&size=2"
},
"next" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases?fields=name,reference,script&page=2&size=2"
},
"last" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases?fields=name,reference,script&page=2&size=2"
}
},
"page" : {
"size" : 2,
"totalElements" : 5,
"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) |
Get test case
A GET
to /test-cases/{id}
returns the test case with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the test case |
HTTP request
GET /api/rest/latest/test-cases/238 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: 6080
{
"_type" : "test-case",
"id" : 238,
"name" : "walking test",
"reference" : "TC1",
"project" : {
"_type" : "project",
"id" : 14,
"name" : "sample project",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
}
}
},
"path" : "/sample project/sample folder/walking test",
"parent" : {
"_type" : "test-case-folder",
"id" : 237,
"name" : "sample folder",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/237"
}
}
},
"created_by" : "User-1",
"created_on" : "2017-06-15T10:00:00.000+00:00",
"last_modified_by" : "User-1",
"last_modified_on" : "2017-06-15T10:00:00.000+00:00",
"importance" : "LOW",
"status" : "WORK_IN_PROGRESS",
"nature" : {
"code" : "NAT_USER_TESTING"
},
"type" : {
"code" : "TYP_EVOLUTION_TESTING"
},
"prerequisite" : "<p>You must have legs with feet attached to them (one per leg)</p>\n",
"description" : "<p>check that you can walk through the API (literally)</p>\n",
"automated_test" : {
"_type" : "automated-test",
"id" : 2,
"name" : "script_custom_field_params_all.ta",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/automated-tests/2"
}
}
},
"automated_test_technology" : "Cucumber",
"scm_repository_url" : "https://github.com/test/repo01 (master)",
"scm_repository_id" : 2,
"automated_test_reference" : "repo01/src/resources/script_custom_field_params_all.ta#Test_case_238",
"uuid" : "2f7194ca-eb2e-4378-a82d-ddc207c866bd",
"custom_fields" : [ {
"code" : "CF_TXT",
"label" : "test level",
"value" : "mandatory"
}, {
"code" : "CF_TAGS",
"label" : "see also",
"value" : [ "walking", "bipedal" ]
} ],
"steps" : [ {
"_type" : "action-step",
"id" : 165,
"action" : "<p>move ${first_foot} forward</p>\n",
"expected_result" : "<p>I just advanced by one step</p>\n",
"index" : 0,
"custom_fields" : [ {
"code" : "CF_TXT",
"label" : "test level",
"value" : "mandatory"
}, {
"code" : "CF_TAGS",
"label" : "see also",
"value" : [ "basic", "walking" ]
} ],
"verified_requirements" : [ ],
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-steps/165"
}
}
}, {
"_type" : "action-step",
"id" : 166,
"action" : "<p>move ${second_foot} forward</p>\n",
"expected_result" : "<p>and another step !</p>\n",
"index" : 1,
"custom_fields" : [ {
"code" : "CF_TXT",
"label" : "test level",
"value" : "mandatory"
}, {
"code" : "CF_TAGS",
"label" : "see also",
"value" : [ "basic", "walking" ]
} ],
"verified_requirements" : [ ],
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-steps/166"
}
}
}, {
"_type" : "call-step",
"id" : 167,
"delegate_parameter_values" : false,
"called_test_case" : {
"_type" : "test-case",
"id" : 239,
"name" : "victory dance",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/239"
}
}
},
"called_dataset" : null,
"index" : 2,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-steps/167"
}
}
}, {
"_type" : "call-step",
"id" : 168,
"delegate_parameter_values" : false,
"called_test_case" : {
"_type" : "unauthorized-resource",
"resource_type" : "test-case",
"resource_id" : 240,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240"
}
}
},
"called_dataset" : null,
"index" : 3,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-steps/168"
}
}
} ],
"parameters" : [ {
"_type" : "parameter",
"id" : 1,
"name" : "first_foot",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/parameters/1"
}
}
}, {
"_type" : "parameter",
"id" : 2,
"name" : "second_foot",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/parameters/2"
}
}
} ],
"datasets" : [ {
"_type" : "dataset",
"id" : 1,
"name" : "right handed people",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/1"
}
}
}, {
"_type" : "dataset",
"id" : 2,
"name" : "left handed people",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/2"
}
}
} ],
"verified_requirements" : [ {
"_type" : "requirement-version",
"id" : 255,
"name" : "Must have legs",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-versions/255"
}
}
}, {
"_type" : "unauthorized-resource",
"resource_type" : "requirement-version",
"resource_id" : 256,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-versions/256"
}
}
} ],
"script_auto" : "/ta-tests/script_custom_field_params_all.ta",
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/238"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
},
"steps" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/238/steps"
},
"parameters" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/238/parameters"
},
"datasets" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/238/datasets"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/238/attachments"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the id of the entity |
|
|
the type of the entity |
|
|
name of the test case |
|
|
project of the test case |
|
|
the location of the test case (either a folder or the project if located at the root of the library) |
|
|
the path of the test case |
|
|
user that created the test case |
|
|
timestamp of the creation (ISO 8601) |
|
|
user that modified the test case the most recently |
|
|
timestamp of last modification (ISO 8601) |
|
|
a shorter identifier for that test case |
|
|
code of the importance |
|
|
code of the status |
|
|
code of the nature |
|
|
code of the type of test case |
|
|
description of the test case (html) |
|
|
prerequisites that should be met before the execution of the test script (html) |
|
|
automated test of the test case (optional) |
|
|
automation script of the test case |
|
|
automated test technology of the test case |
|
|
scm repository url of the test case |
|
|
scm repository id of the test case |
|
|
automated test reference of the test case |
|
|
uuid of the test case |
|
|
array of custom fields |
|
|
code of the custom field |
|
|
label of the custom field |
|
|
the value of the custom field. The value is either a string (for most custom fields), or an array of strings (for multivalued custom fields eg a tag list) |
|
|
the step list that constitute the script. Please refer to the test steps documentation. |
|
|
the list of parameters. Please refer to the parameters documentation. |
|
|
the list of datasets. Please refer to the datasets documentation. |
|
|
the list of verified requirements. Please refer to the requirements documentation. |
|
|
the list of attachments. |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to this test case |
|
link to its project |
|
link to the test script |
|
link to the parameters |
|
link to the datasets |
|
link to the attachments |
Create test case
A POST
to /test-cases
creates a new test case. By default the created test case will be of "standard" type, to create a "scripted"
or a "keyword" test case, you need to specify additional property in your payload : "_type": "scripted-test-case" or "keyword-test-case".
-
Create a standard test case
HTTP request
POST /api/rest/latest/test-cases HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 129
Host: localhost:8080
{
"_type" : "test-case",
"name" : "Christmas turkey test flight",
"parent" : {
"_type" : "project",
"id" : 15
}
}
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 1961
{
"_type" : "test-case",
"id" : 240,
"name" : "Christmas turkey test flight",
"reference" : "",
"project" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"path" : "/Christmas Eve/Christmas turkey test flight",
"parent" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"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",
"importance" : "LOW",
"status" : "WORK_IN_PROGRESS",
"nature" : {
"code" : "NAT_FUNCTIONAL_TESTING"
},
"type" : {
"code" : "TYP_EVOLUTION_TESTING"
},
"prerequisite" : "",
"description" : null,
"automated_test" : null,
"automated_test_technology" : null,
"scm_repository_url" : null,
"scm_repository_id" : null,
"automated_test_reference" : null,
"uuid" : "ce0746e4-8946-4cb1-a9e7-8f61ae35acac",
"custom_fields" : [ ],
"steps" : [ ],
"parameters" : [ ],
"datasets" : [ ],
"verified_requirements" : [ ],
"script_auto" : "",
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
},
"steps" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/steps"
},
"parameters" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/parameters"
},
"datasets" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/datasets"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/attachments"
}
}
}
-
Create a scripted test case
HTTP request
POST /api/rest/latest/test-cases HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 177
Host: localhost:8080
{
"_type" : "scripted-test-case",
"name" : "Christmas turkey test flight",
"parent" : {
"_type" : "project",
"id" : 15
},
"script" : "this is Gherkin script"
}
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 2009
{
"_type" : "scripted-test-case",
"id" : 240,
"name" : "Christmas turkey test flight",
"reference" : "",
"project" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"path" : "/Christmas Eve/Christmas turkey test flight",
"parent" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"created_by" : "admin",
"created_on" : "2020-04-02T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-02T10:00:00.000+00:00",
"importance" : "LOW",
"status" : "WORK_IN_PROGRESS",
"nature" : {
"code" : "NAT_FUNCTIONAL_TESTING"
},
"type" : {
"code" : "TYP_EVOLUTION_TESTING"
},
"prerequisite" : "",
"description" : null,
"automated_test" : null,
"automated_test_technology" : null,
"scm_repository_url" : null,
"scm_repository_id" : null,
"automated_test_reference" : null,
"uuid" : "e1f0f11e-6252-4e07-94ef-f09b89d1acff",
"custom_fields" : [ ],
"steps" : [ ],
"parameters" : [ ],
"datasets" : [ ],
"script" : "this is Gherkin script",
"verified_requirements" : [ ],
"script_auto" : "",
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
},
"steps" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/steps"
},
"parameters" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/parameters"
},
"datasets" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/datasets"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/attachments"
}
}
}
-
Create a keyword test case
HTTP request
POST /api/rest/latest/test-cases HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 154
Host: localhost:8080
{
"_type" : "keyword-test-case",
"name" : "Christmas turkey test flight",
"parent" : {
"_type" : "project",
"id" : 15
},
"steps" : [ ]
}
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 1969
{
"_type" : "keyword-test-case",
"id" : 240,
"name" : "Christmas turkey test flight",
"reference" : "",
"project" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"path" : "/Christmas Eve/Christmas turkey test flight",
"parent" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"created_by" : "admin",
"created_on" : "2020-04-03T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-03T10:00:00.000+00:00",
"importance" : "LOW",
"status" : "WORK_IN_PROGRESS",
"nature" : {
"code" : "NAT_FUNCTIONAL_TESTING"
},
"type" : {
"code" : "TYP_EVOLUTION_TESTING"
},
"prerequisite" : "",
"description" : null,
"automated_test" : null,
"automated_test_technology" : null,
"scm_repository_url" : null,
"scm_repository_id" : null,
"automated_test_reference" : null,
"uuid" : "ba881958-4faa-4fd9-8baf-8c7f55730057",
"custom_fields" : [ ],
"steps" : [ ],
"parameters" : [ ],
"datasets" : [ ],
"verified_requirements" : [ ],
"script_auto" : "",
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
},
"steps" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/steps"
},
"parameters" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/parameters"
},
"datasets" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/datasets"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/attachments"
}
}
}
-
Create a test case with automation attributes
HTTP request
POST /api/rest/latest/test-cases HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 250
Host: localhost:8080
{
"_type" : "keyword-test-case",
"name" : "Christmas turkey test flight",
"parent" : {
"_type" : "project",
"id" : 15
},
"automated_test_technology" : "Robot Framework",
"scm_repository_id" : 6,
"automated_test_reference" : ""
}
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 2014
{
"_type" : "keyword-test-case",
"id" : 240,
"name" : "Christmas turkey test flight",
"reference" : "",
"project" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"path" : "/Christmas Eve/Christmas turkey test flight",
"parent" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"created_by" : "admin",
"created_on" : "2020-04-03T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-03T10:00:00.000+00:00",
"importance" : "LOW",
"status" : "WORK_IN_PROGRESS",
"nature" : {
"code" : "NAT_FUNCTIONAL_TESTING"
},
"type" : {
"code" : "TYP_EVOLUTION_TESTING"
},
"prerequisite" : "",
"description" : null,
"automated_test" : null,
"automated_test_technology" : "Robot Framework",
"scm_repository_url" : "https://github.com/test/repo01 (master)",
"scm_repository_id" : 6,
"automated_test_reference" : "",
"uuid" : "f674e68a-5ff5-4888-bf15-079a015c716b",
"custom_fields" : [ ],
"steps" : [ ],
"parameters" : [ ],
"datasets" : [ ],
"verified_requirements" : [ ],
"script_auto" : "",
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
},
"steps" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/steps"
},
"parameters" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/parameters"
},
"datasets" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/datasets"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/attachments"
}
}
}
Modify test case
A PATCH
to /test-cases/{id}
modifies the test case with the given id.
-
Modify a standard test case
HTTP request
PATCH /api/rest/latest/test-cases/240 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 70
Host: localhost:8080
{
"_type" : "test-case",
"name" : "Christmas turkey test launch"
}
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1961
{
"_type" : "test-case",
"id" : 240,
"name" : "Christmas turkey test launch",
"reference" : "",
"project" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"path" : "/Christmas Eve/Christmas turkey test launch",
"parent" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"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",
"importance" : "LOW",
"status" : "WORK_IN_PROGRESS",
"nature" : {
"code" : "NAT_FUNCTIONAL_TESTING"
},
"type" : {
"code" : "TYP_EVOLUTION_TESTING"
},
"prerequisite" : "",
"description" : null,
"automated_test" : null,
"automated_test_technology" : null,
"scm_repository_url" : null,
"scm_repository_id" : null,
"automated_test_reference" : null,
"uuid" : "a282226d-dea4-4f6b-8f2f-37d371ce25a8",
"custom_fields" : [ ],
"steps" : [ ],
"parameters" : [ ],
"datasets" : [ ],
"verified_requirements" : [ ],
"script_auto" : "",
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
},
"steps" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/steps"
},
"parameters" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/parameters"
},
"datasets" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/datasets"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/attachments"
}
}
}
-
Modify a scripted test case
HTTP request
PATCH /api/rest/latest/test-cases/240 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 117
Host: localhost:8080
{
"_type" : "scripted-test-case",
"name" : "Christmas turkey test launch",
"script" : "this is Christmas Eve"
}
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2008
{
"_type" : "scripted-test-case",
"id" : 240,
"name" : "Christmas turkey test launch",
"reference" : "",
"project" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"path" : "/Christmas Eve/Christmas turkey test launch",
"parent" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"created_by" : "admin",
"created_on" : "2020-04-02T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-02T10:00:00.000+00:00",
"importance" : "LOW",
"status" : "WORK_IN_PROGRESS",
"nature" : {
"code" : "NAT_FUNCTIONAL_TESTING"
},
"type" : {
"code" : "TYP_EVOLUTION_TESTING"
},
"prerequisite" : "",
"description" : null,
"automated_test" : null,
"automated_test_technology" : null,
"scm_repository_url" : null,
"scm_repository_id" : null,
"automated_test_reference" : null,
"uuid" : "f57cb3db-c9ff-490f-82ed-93c82de09cd6",
"custom_fields" : [ ],
"steps" : [ ],
"parameters" : [ ],
"datasets" : [ ],
"script" : "this is Christmas Eve",
"verified_requirements" : [ ],
"script_auto" : "",
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
},
"steps" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/steps"
},
"parameters" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/parameters"
},
"datasets" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/datasets"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/attachments"
}
}
}
-
Modify a keyword test case
HTTP request
PATCH /api/rest/latest/test-cases/240 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 78
Host: localhost:8080
{
"_type" : "keyword-test-case",
"name" : "Christmas turkey test launch"
}
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1969
{
"_type" : "keyword-test-case",
"id" : 240,
"name" : "Christmas turkey test launch",
"reference" : "",
"project" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"path" : "/Christmas Eve/Christmas turkey test launch",
"parent" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"created_by" : "admin",
"created_on" : "2020-04-03T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-03T10:00:00.000+00:00",
"importance" : "LOW",
"status" : "WORK_IN_PROGRESS",
"nature" : {
"code" : "NAT_FUNCTIONAL_TESTING"
},
"type" : {
"code" : "TYP_EVOLUTION_TESTING"
},
"prerequisite" : "",
"description" : null,
"automated_test" : null,
"automated_test_technology" : null,
"scm_repository_url" : null,
"scm_repository_id" : null,
"automated_test_reference" : null,
"uuid" : "9104d799-657c-46ae-b038-ade9934f162d",
"custom_fields" : [ ],
"steps" : [ ],
"parameters" : [ ],
"datasets" : [ ],
"verified_requirements" : [ ],
"script_auto" : "",
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
},
"steps" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/steps"
},
"parameters" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/parameters"
},
"datasets" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/datasets"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/attachments"
}
}
}
-
Modify a test case with automation attributes
HTTP request
PATCH /api/rest/latest/test-cases/240 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 225
Host: localhost:8080
{
"_type" : "scripted-test-case",
"name" : "Christmas turkey test launch",
"script" : "this is Christmas Eve",
"automated_test_technology" : "Cucumber 4",
"scm_repository_id" : 6,
"automated_test_reference" : ""
}
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2048
{
"_type" : "scripted-test-case",
"id" : 240,
"name" : "Christmas turkey test launch",
"reference" : "",
"project" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"path" : "/Christmas Eve/Christmas turkey test launch",
"parent" : {
"_type" : "project",
"id" : 15,
"name" : "Christmas Eve",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"created_by" : "admin",
"created_on" : "2020-04-02T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2020-04-02T10:00:00.000+00:00",
"importance" : "LOW",
"status" : "WORK_IN_PROGRESS",
"nature" : {
"code" : "NAT_FUNCTIONAL_TESTING"
},
"type" : {
"code" : "TYP_EVOLUTION_TESTING"
},
"prerequisite" : "",
"description" : null,
"automated_test" : null,
"automated_test_technology" : "Cucumber 4",
"scm_repository_url" : "https://github.com/test/repo01 (master)",
"scm_repository_id" : 6,
"automated_test_reference" : "",
"uuid" : "58753894-76ad-40f2-9b34-658f5e74a58f",
"custom_fields" : [ ],
"steps" : [ ],
"parameters" : [ ],
"datasets" : [ ],
"script" : "this is Christmas Eve",
"verified_requirements" : [ ],
"script_auto" : "",
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
},
"steps" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/steps"
},
"parameters" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/parameters"
},
"datasets" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/datasets"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/attachments"
}
}
}
Get datasets of test case
A GET
to /test-cases/{id}/datasets
returns all the datasets of the test case with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the test case |
HTTP request
GET /api/rest/latest/test-cases/238/datasets 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
Content-Length: 1804
{
"_embedded" : {
"datasets" : [ {
"_type" : "dataset",
"id" : 1,
"name" : "big_cake",
"parameters" : [ {
"_type" : "parameter",
"id" : 1,
"name" : "cocoa_purity"
}, {
"_type" : "parameter",
"id" : 2,
"name" : "number_of_layers"
} ],
"parameter_values" : [ {
"parameter_test_case_id" : 238,
"parameter_value" : "98%",
"parameter_name" : "cocoa_purity",
"parameter_id" : 1
}, {
"parameter_test_case_id" : 238,
"parameter_value" : "4",
"parameter_name" : "number_of_layers",
"parameter_id" : 2
} ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/1"
}
}
}, {
"_type" : "dataset",
"id" : 2,
"name" : "biscuit",
"parameters" : [ {
"_type" : "parameter",
"id" : 1,
"name" : "cocoa_purity"
}, {
"_type" : "parameter",
"id" : 2,
"name" : "number_of_layers"
} ],
"parameter_values" : [ {
"parameter_test_case_id" : 238,
"parameter_value" : "80%",
"parameter_name" : "cocoa_purity",
"parameter_id" : 1
}, {
"parameter_test_case_id" : 238,
"parameter_value" : "1",
"parameter_name" : "number_of_layers",
"parameter_id" : 2
} ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/2"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/238/datasets?page=0&size=20"
}
},
"page" : {
"size" : 20,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the datasets of this test case |
|
|
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 parameters of test case
A GET
to /test-cases/{id}/parameters
returns all the parameters of the test case with the given id.
Path parameters
Parameter | Description |
---|---|
|
the id of the test case |
HTTP request
GET /api/rest/latest/test-cases/238/parameters 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
Content-Length: 1396
{
"_embedded" : {
"parameters" : [ {
"_type" : "parameter",
"id" : 1,
"name" : "cocoa_purity",
"description" : "<p>how refined the cocoa cream should be</p>",
"test_case" : {
"_type" : "keyword-test-case",
"id" : 238,
"name" : "Chocolate cake",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/238"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/parameters/1"
}
}
}, {
"_type" : "parameter",
"id" : 2,
"name" : "number_of_layers",
"description" : "<p>how many times should the base pattern be repeated</p>",
"test_case" : {
"_type" : "keyword-test-case",
"id" : 238,
"name" : "Chocolate cake",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/238"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/parameters/2"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/238/parameters?page=0&size=20"
}
},
"page" : {
"size" : 20,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the parameters of this test case |
|
|
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 steps of test case
A GET
to /test-cases/{id}/steps
returns all the steps of the test case with the given id.
-
In case of a standard test case :
Path parameters
Parameter | Description |
---|---|
|
the id of the test case |
HTTP request
GET /api/rest/latest/test-cases/239/steps 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
Content-Length: 2510
{
"_embedded" : {
"steps" : [ {
"_type" : "action-step",
"id" : 167,
"action" : "<p>Quick step forward</p>\n",
"expected_result" : "<p>So does your opponent</p>\n",
"index" : 0,
"custom_fields" : [ {
"code" : "CHK_BODY_FEINT",
"label" : "requires body feint",
"value" : "false"
} ],
"verified_requirements" : [ ],
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-steps/167"
}
}
}, {
"_type" : "action-step",
"id" : 168,
"action" : "<p>Another quick step forward, albeit smaller</p>\n",
"expected_result" : "<p>Opponent doubles his steps too then lunges forward for an attack</p>\n",
"index" : 1,
"custom_fields" : [ {
"code" : "CHK_BODY_FEINT",
"label" : "requires body feint",
"value" : "true"
} ],
"verified_requirements" : [ ],
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-steps/168"
}
}
}, {
"_type" : "action-step",
"id" : 169,
"action" : "<p>Strong Quarte parry, possibly with a slight retreat.</p>\n",
"expected_result" : "<p>Opponent's attack gets blocked by your blade.</p>\n",
"index" : 2,
"custom_fields" : [ {
"code" : "CHK_BODY_FEINT",
"label" : "requires body feint",
"value" : "false"
} ],
"verified_requirements" : [ ],
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-steps/169"
}
}
}, {
"_type" : "call-step",
"id" : 170,
"delegate_parameter_values" : true,
"called_test_case" : {
"_type" : "test-case",
"id" : 240,
"name" : "Compound riposte",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240"
}
}
},
"called_dataset" : null,
"index" : 3,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-steps/170"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/239/steps?page=0&size=20"
}
},
"page" : {
"size" : 20,
"totalElements" : 4,
"totalPages" : 1,
"number" : 0
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the steps of this test case |
|
|
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) |
-
In case of a keyword test case :
Path parameters
Parameter | Description |
---|---|
|
the id of the test case |
HTTP request
GET /api/rest/latest/test-cases/2/steps 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
Content-Length: 1332
{
"_embedded" : {
"steps" : [ {
"_type" : "keyword-step",
"id" : 180,
"keyword" : "GIVEN",
"action" : "first \"good\" action word",
"datatable" : "",
"docstring" : "",
"comment" : "",
"index" : 0,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-steps/180"
}
}
}, {
"_type" : "keyword-step",
"id" : 181,
"keyword" : "WHEN",
"action" : "second action with \"5\" words",
"datatable" : "",
"docstring" : "",
"comment" : "",
"index" : 1,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-steps/181"
}
}
}, {
"_type" : "keyword-step",
"id" : 182,
"keyword" : "THEN",
"action" : "third action <attribute> word",
"datatable" : "",
"docstring" : "",
"comment" : "",
"index" : 2,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-steps/182"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/2/steps?page=0&size=20"
}
},
"page" : {
"size" : 20,
"totalElements" : 3,
"totalPages" : 1,
"number" : 0
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the steps of this test case |
|
|
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) |
Delete test case
A DELETE
to /test-cases/{ids}
deletes one or several test cases/folders with the given id(s).
When a lot of test case should be deleted, the system will determine which of them are really deletable according to the business rules. Once this sorting is done only the deletable items will actually be deleted.
The service returns a list of messages that indicates the result of the operation. If everything goes as expected, this list will be empty. In the case where certain elements could not be deleted (for business rules), the service will return one or more messages which will indicate it to you. Note that these messages are the same as those displayed in the user interface.
Optionally we can pass in parameter 'dry-run = true'. In this case only the diagnostics and messages are returned, but no test case will be deleted.
Path parameters
Parameter | Description |
---|---|
|
the list of ids of the test case |
HTTP request
DELETE /api/rest/latest/test-cases/2,3?dry-run=true HTTP/1.1
Content-Type: application/json
Accept: application/json
Accept-Language: fr_FR_FR
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
indicates if you really want to delete the test case or you just want to do a simulation: if dryRun = true : to do just a delete simulation, if dryRun = false or null: for delete test case |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 322
[ "Les cas de test suivants ne seront pas supprimés : Test-Case3<br/>parce qu'ils sont appelés par les cas de test suivants :\",\n Test-Case 1, Test-Case 4, Test-Case2<br/>\",\nLe cas de test :Test-Case3<br/>est référencé dans au moins une itération. Après sa suppression, il ne pourra plus être exécuté.<br/>" ]
Link requirements to a test case
A POST
to test-cases/{id}/coverages/{requirementIds}
links the requirements to the test case.
Path parameters
Parameter | Description |
---|---|
|
the id of the test case |
|
the ids of the requirements to link |
HTTP request
POST /api/rest/latest/test-cases/240/coverages/12,13,14 HTTP/1.1
Accept: application/json
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2664
{
"_type" : "test-case",
"id" : 240,
"name" : "My test case",
"reference" : "",
"project" : {
"_type" : "project",
"id" : 15,
"name" : "My project",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
}
}
},
"parent" : {
"_type" : "test-case-folder",
"id" : 305,
"name" : "My folder",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-case-folders/305"
}
}
},
"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",
"importance" : "LOW",
"status" : "WORK_IN_PROGRESS",
"nature" : {
"code" : "NAT_FUNCTIONAL_TESTING"
},
"type" : {
"code" : "TYP_EVOLUTION_TESTING"
},
"prerequisite" : "",
"description" : null,
"automated_test" : null,
"automated_test_technology" : null,
"scm_repository_url" : null,
"scm_repository_id" : null,
"automated_test_reference" : null,
"uuid" : "471699ac-32bf-4998-896b-fd0b67edf2a7",
"custom_fields" : [ {
"code" : "AUTOMATED",
"label" : "test_is_automated",
"value" : "false"
} ],
"steps" : [ ],
"parameters" : [ ],
"datasets" : [ ],
"verified_requirements" : [ {
"_type" : "requirement-version",
"id" : 12,
"name" : "My first requirement",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-versions/12"
}
}
}, {
"_type" : "requirement-version",
"id" : 13,
"name" : "My second requirement",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-versions/13"
}
}
}, {
"_type" : "requirement-version",
"id" : 14,
"name" : "My third requirement",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/requirement-versions/14"
}
}
} ],
"script_auto" : "",
"attachments" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/15"
},
"steps" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/steps"
},
"parameters" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/parameters"
},
"datasets" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/datasets"
},
"attachments" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/240/attachments"
}
}
}
Unlink requirements from a test case
A DELETE
to test-cases/{id}/coverages/{requirementIds}
unlinks the requirements from the test case.
Path parameters
Parameter | Description |
---|---|
|
the id of the test case |
|
the ids of the requirements to unlink |
HTTP request
DELETE /api/rest/latest/test-cases/543/coverages/350,351 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080