更新时间:2024-09-12 GMT+08:00
分享

设置用例结果

功能介绍

设置用例结果

URI

POST /v4/{project_uuid}/versions/{version_uri}/testcases/{case_uri}/results

表1 路径参数

参数

是否必选

参数类型

描述

project_uuid

String

项目id

version_uri

String

版本uri

case_uri

String

用例uri

请求参数

表2 请求Body参数

参数

是否必选

参数类型

描述

uri

String

主键

name

String

结果名字

description

String

描述

result

String

用例结果

status

String

任务状态

preparation

String

前置条件

steps

Array of TestCaseStepResultInfo objects

用例步骤结果信息

release_dev

String

版本号

task_uri

String

任务URI

task_result_uri

String

测试套结果URI

表3 TestCaseStepResultInfo

参数

是否必选

参数类型

描述

result

String

步骤结果值

actual_result

String

步骤实际结果

expect_result

String

步骤期望结果

test_step

String

用例操作步骤

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

status

String

success|error;

result

ResultValueTestResultVo object

请求的返回的数据对象

error

ApiError object

失败时的error信息

request_id

String

由接口调用方传入,建议使用UUID保证请求的唯一性。

server_address

String

本次请求的受理的服务地址

表5 ResultValueTestResultVo

参数

参数类型

描述

total

Integer

起始记录数 大于 实际总条数时, 值为0, 分页请求才有此值

value

TestResultVo object

实际的数据类型:单个对象,集合 或 NULL

reason

String

业务失败的提示内容

page_size

Integer

每页展示条数

page_no

Integer

页码

has_more

Boolean

是否有更多

表6 TestResultVo

参数

参数类型

描述

uri

String

结果URI

name

String

用例结果名称

author

String

创建人ID

rank

Integer

级别

result

Integer

测试结果Code

round

Integer

执行批次

preparation

String

前置条件

description

String

描述

region

String

逻辑Region

steps

Array of ResultStepVo objects

测试步骤信息

number

String

用例结果编号

author_name

String

创建人名称

begin_time

String

执行开始时间

begin_time_timestamp

Long

执行开始时间时间戳

end_time

String

执行结束时间

end_time_timestamp

Long

执行结束时间时间戳

creation_date

String

创建时间

creation_date_timestamp

Long

创建时间时间戳

last_modified

String

最后修改时间

last_modified_timestamp

Long

最后修改时间

last_change_time

String

最后变更时间

last_change_time_timestamp

Long

最后变更时间

dfx_test_result

String

DFX测试结果

failure_cause

String

失败原因

parent_uri

String

父节点URI(分支用例URI或迭代用例URI)

test_case_uri

String

分支用例URI

test_case_name

String

用例名称

task_uri

String

测试任务URI

result_name

String

测试结果

test_result_ae

String

是否自动化执行

executor_id

String

执行人ID

executor_name

String

执行人名称

task_id

String

执行机任务ID

execute_id

String

执行ID

time_cost

Integer

执行耗时

step_txt

String

测试步骤

step_expect

String

测试步骤期望结果

step_actual

String

测试步骤实际结果

step_result

String

测试步骤结果

release_dev

String

版本号

creation_version_uri

String

创建版本URI

version_uri

String

版本URI

project_id

String

项目ID

report_url

String

第三方过来的执行结果,返回跳转到第三方的url

test_case_number

String

测试用例编号

service_type

String

测试类型

表7 ResultStepVo

参数

参数类型

描述

result

String

结果

test_step

String

测试步骤

expect_result

String

预期结果

actual_result

String

实际结果

result_name

String

测试结果名称

表8 ApiError

参数

参数类型

描述

code

String

业务失败的错误码

reason

String

业务失败的提示内容

状态码: 400

表9 响应Body参数

参数

参数类型

描述

error_code

String

接口调用失败错误码

error_msg

String

接口调用失败错误信息

状态码: 401

表10 响应Body参数

参数

参数类型

描述

error_code

String

接口调用失败错误码

error_msg

String

接口调用失败错误信息

状态码: 404

表11 响应Body参数

参数

参数类型

描述

error_code

String

接口调用失败错误码

error_msg

String

接口调用失败错误信息

状态码: 500

表12 响应Body参数

参数

参数类型

描述

error_code

String

接口调用失败错误码

error_msg

String

接口调用失败错误信息

请求示例

初始化用例执行记录

post https://{endpoint}/v4/3d2378e0fc504c638f48b21377d6add1/versions/v91i0000vrpquiv5/testcases/v91i0000vrpquj5f/results

{
  "result" : "0",
  "description" : "",
  "steps" : [ {
    "test_step" : "<p>在Chrome浏览器输入https://{url}/home,并使用合法账号登录</p>",
    "expect_result" : "<p>检查登录之后正常跳转至DevCloud首页,页面的布局排版正确</p>",
    "actual_result" : "",
    "result" : ""
  } ],
  "status" : "7",
  "preparation" : "",
  "task_uri" : "v91i0000vrpquj69",
  "task_result_uri" : "v9200000vrro98vl",
  "release_dev" : ""
}

响应示例

状态码: 200

OK

{
  "status" : "success",
  "result" : {
    "value" : {
      "uri" : "v9220000vrro99lu",
      "creation_date" : "2024-09-12 11:19:18",
      "creation_date_timestamp" : 1726111158974,
      "time_cost" : 0,
      "project_uuid" : "3d2378e0fc504c638f48b21377d6add1"
    }
  }
}

状态码

状态码

描述

200

OK

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

错误码

请参见错误码

相关文档