Updates a test in QAComplete.
Use the operation to update individual fields of an existing test in QAComplete.
To add a new test, use the …/tests (POST)
operation.
To update all the fields of a test, use the …/tests/{Id} (PUT)
operation.
Authentication
Basic authentication using a user’s login and password. See Authentication for details.
Security Rights
The authenticating user must belong to a security group that has the Update privilege for Test Library.
Request Format
To update the test, send a PATCH request to the following URL:
URL parameters
ProjectId : integer, required
The ID of the project, to which the test belongs.
Id : integer, required
The ID of the test you want to update.
Body parameters
In the request body, pass the RequestTestPatch
JSON object that specifies the test’s fields to update:
"Title": "string",
"Status": "string",
"Active": "boolean",
"AssigneeUserId": "int",
"CustomFields": [
{
"Id": "string",
"Name": "string",
"Value": "string"
}
],
"Description": "string",
"ExecutionType": "string",
"FolderId": "int",
"OwnerUserId": "int",
"Priority": "string",
"TestSteps": [
{
"Id": "int",
"Seq": "int",
"IsStoppedOnFail": "boolean",
"Step": "string",
"ExpectedResult": "string",
"ScriptSourceId": "int"
}
],
"TestType": "string"
}
Some string property values (for example, Status
) are based on the choice lists defined in your QAComplete project. You can find these values in the Test Management > Test Library > Tools > Manage Choice Lists panel in QAComplete.
The property values you do not specify remain unchanged.
Title : string, required
The title of the test.
Status : string, required
The status of the test. Possible values are based on the choice list.
Active : boolean
Specifies whether the test is enabled (active).
AssigneeUserId : integer
The ID of the user to whom the test is assigned. 0 if the test is not assigned to anyone.
CustomFields : array of objects
An array of CustomFields
objects that describe custom fields and their values:
{
"Id": "string",
"Name": "string",
"Value": "string"
}
Id : string, required
The unique identifier of the custom field. Must be in the CustomN
format, where N
is the custom field’s number (index).
Name : string
The field name.
Value : string
The field value.
Description : string
The test description. Can include an HTML markup. If no description is specified, empty string.
ExecutionType : string
Specifies how the test will run. Possible values are based on the choice list. If no execution type is assigned, empty string.
FolderId : integer
The ID of the folder to which the test belongs.
OwnerUserId : integer
The ID of the user who owns the test.
Priority : string
Specifies the test priority. Possible values are based on the choice list. If no priority is assigned, empty string.
TestSteps : array of objects
An array of RequestTestStep
objects that describe the test steps.
"Id": "int",
"Seq": "int",
"IsStoppedOnFail": "boolean",
"Step": "string",
"ExpectedResult": "string",
"ScriptSourceId": "int"
}
Id : integer, required
The unique identifier of the step among other test steps in the Test Library.
ExpectedResult : string
Describes the expected outcome of the actions a tester performs during the step. Can contain an HTML markup.
IsStoppedOnFail : boolean
Specifies whether the test will stop if the step fails. Default value: False.
ScriptSourceId : integer
Reserved.
Seq : integer, required
The ordinal number of the step in the test. Default value: 0.
Step : string, required
Describes instructions for a tester to follow during the step. Can contain an HTML markup.
TestType : string
Type of the test. Possible values are based on the choice list. If no type is assigned, empty string.
A sample request:
PATCH http://yourserver.com/rest-api/service/api/v2/projects/11873/tests/8 HTTP/1.1
Host: yourserver.com
Connection: keep-alive
Content-Type: application/json
Accept: application/json
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==
Content-Length: 85
{
"Title": "Test input data",
"Status": "Approved",
"AssigneeUserId": "25264"
}
A sample request made by using cURL:
curl -u [email protected]:p@ssword -d {"Title": "Test input data", "Status": "Approved", "AssigneeUserId": "25264"} -H "Content-Type: application/json" -H "Accept: application/json" http://yourserver.com/service/api/v2/projects/11873/tests/8
Response Format
On success, the operation responds with HTTP status code 200 and returns a JSON object with the updated test information.
A sample response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 1271
{
"id": 1,
"title": "Test input data",
"status": "Approved",
"project_id": 11873,
"__permissions": {
"acl": 7
},
"active": true,
"assigned_to_name": "Smith, John",
"assignee_user_id": 25264,
"avg_run_time": 0,
"create_user_id": 25264,
"custom_fields": [],
"date_created": "2015-07-31T10:19:10.5870000",
"date_last_escalated": "0001-01-01T00:00:00.0000000",
"date_updated": "2015-09-09T09:28:27.0000000",
"description": "Test input data",
"execution_type": "",
"folder_id": 0,
"import_id": 0,
"last_escalation_rule_id": 0,
"last_run_by_user_id": 0,
"last_run_date": "0001-01-01T00:00:00.0000000",
"last_run_test_set": 0,
"nbr_escalations": 0,
"nbr_events": 0,
"nbr_fail_status": 0,
"nbr_files": 0,
"nbr_files_not_secured": 0,
"nbr_notes": 0,
"nbr_pass_status": 0,
"nbr_steps": 0,
"nbr_times_run": 0,
"original_id": 0,
"owner_name": "Smith, John",
"owner_user_id": 25264,
"priority": "3-Low",
"test_type": "Regression",
"script_name": "",
"script_source_id": 0,
"test_steps": []
"update_user_id": 25264,
"user_name": "Smith, John",
"version": 4
}
The ID of the QAComplete project that contains the tests.
An array of test steps that belong to the test.
The unique identifier of the step among other test steps in the Test Library.
The title of the test to which the step belongs.
The ordinal number of the step in the test.
Specifies whether the test will stop if the step fails.
Describes instructions for a tester to follow during the step. Can contain an HTML markup.
The date when the step was created.
The date when the test was created.
The date when the step was last modified.
The date when the test was last modified.
The ID of the user who created the step.
The ID of the user who created the test.
The ID of the last user who modified the step.
The ID of the last user who modified the test.
Reserved.
The number of files attached to the step.
The number of files attached to the test.
Reserved.
The ID of the test to which the step belongs.
The unique identifier of the test.
Specifies how the test will run. Possible values are based on the choice list.
Specifies whether the test is enabled (active).
The ID of the folder to which the test belongs.
Specifies the test priority. Possible values are based on the choice list.
The test description. Can include an HTML markup.
The ID of the user who owns the test.
The name of the user, to whom the test is assigned, in the Last name, First name format.
The ID of the user to whom the test is assigned. 0 if the test is not assigned to anyone.
The title of the test.
Type of the test. Possible values are based on the choice list.
The version of the test.
The test’s average run time, in seconds.
The date when the test was last processed by an escalation rule.
The name of the folder to which the test belongs.
The ID of the operation that imported the test from an external file to the Test Library. If the test was not imported, is 0.
The ID of the escalation rule that processed the test last. 0 if no escalation rule processed the test.
The name of the user who run the test last, in the Last name, First name format.
The ID of the user, who ran the test last.
The date when the test ran last.
The ID of the test set, as part of which the test ran last.
The number of times the test was processed by escalation rules.
Reserved.
The number of times the test failed.
Reserved.
The number of notes attached to the test.
The number of times the test passed.
The number of steps the test has.
The number of times the test ran.
The original ID of the test as it was specified in an external file before the test was imported to QAComplete. If the test was not imported, 0.
The name of the user, who owns the test, in the Last name, First name format.
The name of the last user, who updated the test, in the Last name, First name format.
An array of objects that describe the test’s custom fields and their values.
The expected outcome of the actions a tester performs during the step. Can contain an HTML markup.
The authenticating user’s rights to access tests.
Access rights:
- 0 - None
- 1 - Read
- 2 - Update
- 3 - Read and update
- 4 - Delete
- 5 - Read and delete
- 7 - Full access
The latest note attached to the test. Can include an HTML markup.
The name of the test set, as part of which the test ran last.
The name of the escalation rule that processed the test last.
The test’s average run time, in the hh:mm:ss format.
The status of the test. Possible values are based on the choice list.
Error responses
If the operation fails, it returns the appropriate status code and (optionally) the error description in the response body.
If the project with the specified ProjectId does not exist or the authenticating user does not have rights to access the project, the operation returns the Access is denied
error.
If the test with the specified Id does not exist, the operation returns the File or directory not found
error.