文档首页/ 测试计划 CodeArts TestPlan/ API参考/ API/ 自定义测试服务用例管理/ 根据任务批次id和用例uri查询用例结果
更新时间:2025-06-26 GMT+08:00
分享

根据任务批次id和用例uri查询用例结果

功能介绍

根据任务批次id和用例uri查询用例结果

调用方法

请参见如何调用API

URI

POST /v4/{project_id}/versions/{version_uri}/execute/results/batch-query

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目UUID,项目唯一标识,固定长度32位字符(字母和数字)。获取方式请参见获取项目ID

version_uri

String

版本URI

请求参数

表2 请求Body参数

参数

是否必选

参数类型

描述

uri

String

结果URI

task_uri

String

测试任务URI

task_id

String

执行id

release_dev

String

版本号

execute_id

String

测试套当次执行id,同一个测试套每次执行的id唯一

case_uris

Array of strings

测试套中用例的uri

page_no

Integer

当前页数

page_size

Integer

每页条数

sort_field

String

排序字段

sort_type

String

排序类型

响应参数

状态码:200

表3 响应Body参数

参数

参数类型

描述

status

String

状态

result

result object

请求返回结果

表4 result

参数

参数类型

描述

total

Integer

总数

value

Array of strings

结果值

page_size

Integer

页码

page_no

Integer

页数

状态码:400

表5 响应Body参数

参数

参数类型

描述

error_code

String

参数解释

接口调用失败错误码

取值范围

不涉及

error_msg

String

参数解释

接口调用失败错误信息

取值范围

不涉及

状态码:401

表6 响应Body参数

参数

参数类型

描述

error_code

String

参数解释

接口调用失败错误码

取值范围

不涉及

error_msg

String

参数解释

接口调用失败错误信息

取值范围

不涉及

状态码:404

表7 响应Body参数

参数

参数类型

描述

error_code

String

参数解释

接口调用失败错误码

取值范围

不涉及

error_msg

String

参数解释

接口调用失败错误信息

取值范围

不涉及

状态码:500

表8 响应Body参数

参数

参数类型

描述

error_code

String

参数解释

接口调用失败错误码

取值范围

不涉及

error_msg

String

参数解释

接口调用失败错误信息

取值范围

不涉及

请求示例

post https://{endpoint}/v4/a5eb0d410ea341a192f7c12483568985/versions/v90100010gpop318/execute/results/batch-query

{
  "uri" : "004t8dtr4e61",
  "task_uri" : "8r89rwq4q",
  "task_id" : "8r89rwq4q",
  "release_dev" : "1.0.1",
  "execute_id" : "0913f40a4a0a45a6b8917a69d3d5a7cd",
  "case_uris" : [ "v9230vr53cgl9a1g", "v9230vr53cgl9a1f" ],
  "page_no" : 1,
  "page_size" : 10,
  "sort_field" : "name",
  "sort_type" : "desc"
}

响应示例

状态码:200

OK

{
  "status" : "success",
  "result" : {
    "total" : 0,
    "value" : [ {
      "uri" : "001s91rs7kr",
      "name" : "master Result2020-10-09",
      "number" : "NumberTestCase001",
      "author" : "b088303066476b9eaefdb44aa23bca",
      "author_name" : "名称",
      "begin_time" : "2025-06-19 15:22:33",
      "begin_time_timestamp" : 1660617231016,
      "end_time" : "2025-06-19 15:22:33",
      "end_time_timestamp" : 1660617231016,
      "creation_date" : "creation_date_b284df1e6477",
      "creation_date_timestamp" : 1660617231016,
      "last_modified" : "2025-06-19 15:22:33",
      "last_modified_timestamp" : 0,
      "last_change_time" : "2025-06-19 15:22:33",
      "last_change_time_timestamp" : 1660617231016,
      "dfx_test_result" : "DFX测试结果",
      "failure_cause" : "失败原因",
      "parent_uri" : "002s8g637u51",
      "test_case_uri" : "002s8g637u51",
      "test_case_name" : "用例名称",
      "task_uri" : "002s8g637u51",
      "rank" : 0,
      "result" : 0,
      "result_name" : "result_name_bdf20d589fad",
      "round" : 0,
      "test_result_ae" : "test_result_ae_bd12529bd716",
      "executor_id" : "executor_id_2ecf59f28fcc",
      "executor_name" : "成功",
      "task_id" : "002s8g637u51",
      "execute_id" : "002s8g637u51",
      "time_cost" : 0,
      "preparation" : "前置条件",
      "description" : "描述",
      "test_step_model" : "table",
      "step_txt" : "测试步骤",
      "step_expect" : "测试步骤期望结果",
      "step_actual" : "测试步骤实际结果",
      "step_result" : "测试步骤结果",
      "release_dev" : "1.0.1",
      "creation_version_uri" : "8r89rwq4q",
      "version_uri" : "8r89rwq4q",
      "project_uuid" : "f548dd75dcd54c2ea91baaea9d37e6a0",
      "region" : "cn-north-7",
      "report_url" : "8r89rwq4q",
      "steps" : [ {
        "test_step" : "步骤1",
        "expect_result" : "预期结果1"
      } ],
      "test_case_number" : "测试用例编号",
      "service_type" : "0",
      "reason" : "",
      "reasonTypeName" : "",
      "execute_by" : "",
      "feature_uri" : "",
      "feature_name" : "",
      "feature_abs_path" : ""
    } ],
    "page_size" : 10,
    "page_no" : 1
  }
}

状态码

状态码

描述

200

OK

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

错误码

请参见错误码

相关文档