Test
# Execute Test Task
Request
POST /openapi/quality/testing/task
1
Body Parameter Description
| Parameter Name | Description | Type | Required |
|---|---|---|---|
project_key | Project Key | string | Yes |
test_name | Test Name | string | Yes |
repo_info | Runtime repository configuration; defaults to the test configuration when omitted | []RepoInfo | No |
inputs | Runtime inputs; unspecified inputs use values from the test configuration | []Input | No |
RepoInfo Parameter Description
| Parameter Name | Description | Type | Required |
|---|---|---|---|
codehost_name | Code host name | string | Yes |
repo_namespace | Repository namespace (organization/user) | string | Yes |
repo_name | Repository name | string | Yes |
branch | Branch name; required when enable_commit is false | string | No |
pr | Pull Request number | int | No |
prs | Pull Request number list | []int | No |
enable_commit | Whether to use a specified commit | bool | No |
commit_id | Commit ID; required when enable_commit is true | string | No |
Repositories in repo_info must already be configured in the test. Perforce repository overrides are not supported.
Input Parameter Description
| Parameter Name | Description | Type | Required |
|---|---|---|---|
key | Input name; must already be configured in the test | string | Yes |
value | Input value | string | No |
type | Input type | string | No |
is_credential | Whether the input is sensitive | bool | No |
file_id | File ID | string | No |
file_name | File name | string | No |
file_path | File path | string | No |
Body Parameter Example
{
"project_key": "demo",
"test_name": "test-demo",
"repo_info": [
{
"codehost_name": "github",
"repo_namespace": "koderover",
"repo_name": "zadig",
"branch": "main"
}
],
"inputs": [
{
"key": "ENV",
"value": "test"
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Success Response
| Parameter Name | Type | Description |
|---|---|---|
task_id | int | Test Task ID |
{
"task_id": 27
}
1
2
3
2
3
Failure Response
{
"code": 500,
"description": "mongo: no documents in result",
"message": "Internal Error: "
}
1
2
3
4
5
2
3
4
5
# Get Test Variables
Returns the runtime input definitions for a test. The value of a credential input is not returned; use has_value to determine whether a value is configured.
Request
GET /openapi/quality/testing/:testName?projectKey=<projectKey>
1
Path Parameter Description
| Parameter Name | Type | Description | Required |
|---|---|---|---|
testName | string | Test Name | Yes |
Query Parameter Description
| Parameter Name | Type | Description | Required |
|---|---|---|---|
projectKey | string | Project Key | Yes |
Success Response Description
| Parameter Name | Type | Description |
|---|---|---|
project_key | string | Project Key |
test_name | string | Test Name |
inputs | []TestInput | Runtime input definitions |
TestInput Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
key | string | Input name |
value | string | Default value; omitted for credential inputs |
type | string | Input type |
choice_option | []string | Available choices |
required | bool | Whether the input is required |
is_credential | bool | Whether the input contains sensitive information |
has_value | bool | Whether a value is configured |
description | string | Input description |
Success Response Example
{
"project_key": "demo",
"test_name": "test-demo",
"inputs": [
{
"key": "ENV",
"value": "test",
"type": "choice",
"choice_option": [
"test",
"production"
],
"required": true,
"is_credential": false,
"has_value": true,
"description": "Runtime environment"
},
{
"key": "PASSWORD",
"type": "string",
"required": true,
"is_credential": true,
"has_value": true
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Get Test Task Details
Request
GET /openapi/quality/testing/:testName/task/:taskID?projectKey=<projectKey>
1
Path Parameter Description
| Parameter Name | Type | Description | Required |
|---|---|---|---|
testName | string | Test Name | Yes |
taskID | int | Test Task ID | Yes |
Query Parameter Description
| Parameter Name | Type | Description | Required |
|---|---|---|---|
projectKey | string | Project Key | Yes |
Success Response Description
| Parameter Name | Type | Description |
|---|---|---|
test_name | Test Name | string |
task_id | Test Task ID | int |
creator | Creator | string |
create_time | Creation Time | int |
start_time | Task Start Execution Time | int |
end_time | Task End Execution Time | int |
status | Current Status:created:Test task createdrunning:Test task executingpassed:Test task passedskipped:Test task skippedfailed:Test task failedtimeout:Test task timeoutcancelled:Test task cancelledwaiting:Test task waitingqueued:Test task queued | string |
test_report | Test Report | Report |
Report Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
test_total | Total test cases | int |
failure_total | Failed test cases | int |
success_total | Successful test cases | int |
skiped_total | Skipped test cases | int |
error_total | Error test cases | int |
test_cases | Test case list | []TestCase |
TestCase Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
name | Case name | string |
time | Duration (seconds) | int |
failure | Failure info | Message |
skipped | Skip info | Empty struct, null value means this test case was executed, otherwise returns empty struct |
error | Error info | Message |
Message Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
message | Error message summary | string |
type | Type | string |
text | Error details | string |
Success Response Example
{
"test_name": "test-demo",
"task_id": 16,
"creator": "cici",
"create_time": 1689823467,
"start_time": 1689823470,
"end_time": 1689823491,
"status": "passed",
"test_report": {
"test_total": 24,
"failure_total": 0,
"success_total": 24,
"skiped_total": 0,
"error_total": 0,
"time": 13.872,
"test_type": "",
"name": "",
"test_cases": [
{
"name": "e2e Test Suites Scenario 1 - Regression testing of existing projects There is a project called voting in the test environment Can view environment",
"time": 0.155922912,
"failure": null,
"skipped": null,
"error": null
},
{
"name": "e2e Test Suites Scenario 1 - Regression testing of existing projects There is a project called voting in the test environment Can view Voting project information",
"time": 0.136967508,
"failure": null,
"skipped": null,
"error": null
},
{
"name": "e2e Test Suites Scenario 2 - Core onboarding process Through the system onboarding process, environments and some workflows are automatically generated Successfully automatically created environments and workflows, workflows can be triggered",
"time": 7.83081332,
"failure": null,
"skipped": null,
"error": null
}
]
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Failure Response
{
"code": 500,
"description": "failed to get pipeline task from db, taskID:1, pipelineName:tt-job, err: mongo: no documents in result",
"message": "Internal Error: "
}
1
2
3
4
5
2
3
4
5


