查询用例详情 - ShowTestCaseDetailNew
功能介绍
此接口用于查询用例详情数据,根据传入的用例uri精确查询并返回用例详情
调用方法
请参见如何调用API。
URI
GET /v4/testcases/{case_uri}
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| case_uri | 是 | String | 用例id |
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| version_uri | 是 | String | 分支uri |
| project_uuid | 是 | String | 项目UUID,项目唯一标识,固定长度32位字符(字母和数字)。获取方式请参见获取项目ID。 |
| task_uri | 否 | String | 任务 |
| refresh | 否 | Boolean | 是否刷新缓存 |
| is_recycle | 否 | Boolean | 是否回收站资源 |
请求参数
无
响应参数
状态码:200
| 参数 | 参数类型 | 描述 |
|---|---|---|
| value | TestCaseDetailVo object | 请求返回的数据 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| uri | String | 资源URI |
| type | String | 参数解释: 资源类型 取值范围:
|
| author | String | 创建人 |
| name | String | 名称 |
| rank | Integer | 级别 |
| preparation | String | 前置条件 |
| remark | String | 备注 |
| stage | String | 测试阶段 |
| activity | String | 测试类型 |
| keywords | String | 关键词 |
| market | String | apitest标记是否代码已提交 |
| designer | String | 设计者 |
| tags | String | 标签 |
| execute_parameter | String | 执行参数 |
| region | String | 逻辑region |
| owner | String | 处理人id,IteratorTestCase字段 |
| issue | SimpleIssueVo object | 需求信息 |
| last_modifier | String | 最后修改人 |
| last_modified | String | 最后修改时间 |
| last_modified_timestamp | Long | 修改时间时间戳 |
| last_change_time | String | 最后变更时间 |
| version_uri | String | 版本URI |
| origin_uri | String | 源资源URI |
| parent_uri | String | 父资源URI |
| parent_path | String | 父资源路径 |
| creation_version_uri | String | 创建版本URI |
| creation_date | String | 创建时间 |
| creation_date_timestamp | Long | 创建时间时间戳 |
| author_name | String | 创建人名称 |
| comment | String | 备注 |
| number | String | 编号 |
| case_type | Integer | 参数解释: 用例类型 取值范围:
|
| platform_type | Integer | 执行平台类型 |
| service_type | Integer | 参数解释: 服务类型 取值范围:
|
| service_type_name | String | 服务类型名称 |
| test_type | Integer | 参数解释: 测试类型 取值范围:
|
| test_type_name | String | 测试类型名称 |
| design_note | String | 设计描述 |
| test_step | String | 测试步骤 |
| expect_output | String | 期望结果 |
| env_type | String | 测试环境类型 |
| exe_platform | String | 执行平台 |
| testcase_project | String | 测试工程 |
| svn_script_path | String | 脚本路径 |
| map_restrict | String | 约束条件 |
| network_script_name | String | 网络脚本名 |
| auto_type | Integer | 自动化类型,非自动化:0, 是自动化:1 |
| to_be_auto_exec | Integer | 被自动化执行 |
| last_result | String | 最后一次结果 |
| last_result_uri | String | 最后一次结果Uri |
| feature_uri | String | 目录Uri |
| feature_name | String | 目录名称 |
| interface_name | String | 测试接口名 |
| snp_no | String | 网络问题ID |
| dr_relation_id | String | 关联需求编号 |
| issue_name | String | 需求名称 |
| test_base_num | String | 测试基数 |
| automatically_executed | Integer | 是否被自动化执行 |
| first_execute_time | String | 第一次执行时间 |
| detect_type | String | 检测类型 |
| execute_param | String | 执行参数 |
| test_feature | String | 分析领域 |
| is_contract_testcase | Integer | 是否是契约用例,0:表示非契约用例, 1:表示契约用例 |
| time_cost | Double | 总共耗时 |
| be_auto_type_time | String | 记录用例由非自动化变为自动化类型的时间 |
| compare_number | String | 配对用例编号 |
| scene_flag | String | 场景标识 |
| base_flag | String | 场景标识 |
| para_validator | String | 区别是否从yaml中生成的用例,默认false |
| knet_node_id | String | knet节点id |
| last_exe_author | String | 最后一次执行用户 |
| cloud_carrier | String | 运营商 |
| market_place | String | 应用市场 |
| test_mind_id | String | 脑图id |
| test_mind_url | String | 脑图url |
| commit_url | String | git提交url |
| test_pattern_number | String | 测试模式编号 |
| test_factor_number | String | 测试因子编号 |
| status_code | String | 状态Code |
| result_code | String | 结果Code |
| release_id | String | 迭代ID |
| label_id | String | 标签ID |
| labels | String | 用例标签名称列表 |
| module_id | String | 模块ID |
| module_name | String | 模块名称 |
| module_path | String | 模块path |
| module_path_name | String | 模块路径名称 |
| execute_latest_time | String | 最后执行时间 |
| execute_duration | String | 执行时长 |
| execute_times | Integer | 执行次数 |
| is_keyword | Integer | 是否关键用例 |
| release_dev | String | 测试版本号 |
| new_created | String | 是否用户新增用例 |
| project_id | String | 项目UUID,项目唯一标识,固定长度32位字符(字母和数字)。获取方式请参见获取项目ID。 |
| creation_version_name | String | 创建版本名称,原逻辑marshall添加字段 |
| feature_path | String | 特性路径,原逻辑marshall添加字段 |
| testcase_uri | String | 实体用例Uri,IteratorTestCase字段 |
| owner_name | String | 处理人名称 |
| iterator_case_uri | String | 迭代用例Uri,IteratorTestCase字段 |
| script_link | String | 脚本链接scriptLink |
| custom_field_1 | String | 自定义字段1 |
| custom_field_2 | String | 自定义字段2 |
| custom_field_3 | String | 自定义字段3 |
| custom_field_4 | String | 自定义字段4 |
| custom_field_5 | String | 自定义字段5 |
| custom_field_6 | String | 自定义字段6 |
| custom_field_7 | String | 自定义字段7 |
| custom_field_8 | String | 自定义字段8 |
| custom_field_9 | String | 自定义字段9 |
| custom_field_10 | String | 自定义字段10 |
| custom_field_11 | String | 自定义字段11 |
| custom_field_12 | String | 自定义字段12 |
| custom_field_13 | String | 自定义字段13 |
| custom_field_14 | String | 自定义字段14 |
| custom_field_15 | String | 自定义字段15 |
| custom_field_16 | String | 自定义字段16 |
| custom_field_17 | String | 自定义字段17 |
| custom_field_18 | String | 自定义字段18 |
| custom_field_19 | String | 自定义字段19 |
| custom_field_20 | String | 自定义字段20 |
| custom_field_21 | String | 自定义字段21 |
| custom_field_22 | String | 自定义字段22 |
| custom_field_23 | String | 自定义字段23 |
| custom_field_24 | String | 自定义字段24 |
| custom_field_25 | String | 自定义字段25 |
| last_modifier_name | String | 更新人名称 |
| version_name | String | 迭代 |
| steps | Array of TestCaseStepVo objects | 测试步骤 |
| associate_defect | Boolean | 是否关联缺陷 |
| associate_issue | Boolean | 是否关联需求 |
| defect_list | Array of NameAndIdVo objects | 缺陷关联信息 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| test_step | String | 测试步骤 |
| expect_result | String | 预期结果 |
| step_actual | String | 步骤的实际结果 |
| step_result | String | 步骤结果 |
状态码:400
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | 参数解释 接口调用失败错误码 取值范围 不涉及 |
| error_msg | String | 参数解释 接口调用失败错误信息 取值范围 不涉及 |
状态码:401
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | 参数解释 接口调用失败错误码 取值范围 不涉及 |
| error_msg | String | 参数解释 接口调用失败错误信息 取值范围 不涉及 |
状态码:404
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | 参数解释 接口调用失败错误码 取值范围 不涉及 |
| error_msg | String | 参数解释 接口调用失败错误信息 取值范围 不涉及 |
状态码:500
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | 参数解释 接口调用失败错误码 取值范围 不涉及 |
| error_msg | String | 参数解释 接口调用失败错误信息 取值范围 不涉及 |
请求示例
get https://{endpoint}/v4/testcases/v80b00010i5dji80?version_uri=v90100010gpop318&project_uuid=a5eb0d410ea341a192f7c12483568985&_=1750319602168 响应示例
状态码:200
OK
{
"value" : {
"uri" : "v80b00010i5dji80",
"type" : "TestCase",
"author" : "fe2b1b7779a447ee9b650ecc43a18c81",
"name" : "测试用例3",
"rank" : 2,
"stage" : "1",
"designer" : "fe2b1b7779a447ee9b650ecc43a18c81",
"region" : "roma-dev-2-arm",
"last_modifier" : "fe2b1b7779a447ee9b650ecc43a18c81",
"last_modified" : "2025-06-19 15:08:16",
"last_modified_timestamp" : 1750316896000,
"last_change_time" : "2025-06-16 15:10:25",
"version_uri" : "v90100010gpop318",
"parent_uri" : "v90100010gpop318",
"parent_path" : "/a5eb0d410ea341a192f7c12483568985/v90100010gpop318/",
"creation_version_uri" : "v90100010gpop318",
"creation_date" : "2025-06-16 15:10:25",
"creation_date_timestamp" : 1750057825000,
"author_name" : "TMSS02",
"number" : "106",
"case_type" : 0,
"platform_type" : 0,
"service_type" : 0,
"service_type_name" : "手工测试",
"test_type" : 0,
"test_step" : "[\"1\"]",
"expect_output" : "[\"1\"]",
"auto_type" : 0,
"to_be_auto_exec" : 0,
"feature_name" : "其他",
"dr_relation_id" : "1429920",
"automatically_executed" : 0,
"is_contract_testcase" : 0,
"time_cost" : 0,
"last_exe_author" : "fe2b1b7779a447ee9b650ecc43a18c81",
"status_code" : "7",
"result_code" : "0",
"labels" : [ ],
"execute_latest_time" : "2025-06-19 15:08:16",
"execute_duration" : "00:00:00.000",
"execute_times" : 0,
"is_keyword" : 0,
"last_modifier_name" : "fe2b1b7779a447ee9b650ecc43a18c81",
"steps" : [ {
"test_step" : "1",
"expect_result" : "1"
} ],
"associate_defect" : false,
"associate_issue" : true,
"defect_list" : [ {
"id" : "1429059",
"name" : "Bug02"
}, {
"id" : "1429058",
"name" : "Bug03"
}, {
"id" : "1429057",
"name" : "新建bug"
}, {
"id" : "1429056",
"name" : "bug001"
}, {
"id" : "1429055",
"name" : "bug002"
}, {
"id" : "1429054",
"name" : "bug003"
}, {
"id" : "1429053",
"name" : "bug004"
}, {
"id" : "1429052",
"name" : "bug005"
}, {
"id" : "1429051",
"name" : "bug006"
}, {
"id" : "1429050",
"name" : "bug007"
}, {
"id" : "1429060",
"name" : "Bug001"
} ]
}
} 状态码
| 状态码 | 描述 |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Not Found |
| 500 | Internal Server Error |
错误码
请参见错误码。