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

导出测试用例

功能介绍

导出测试用例

URI

POST /v4/{project_id}/versions/{version_uri}/testcases/export

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目uri

version_uri

String

分支或者迭代uri

请求参数

表2 请求Body参数

参数

是否必选

参数类型

描述

owners

Array of strings

处理者

authors

Array of strings

创建者

ranks

Array of strings

用例等级

test_case_uris

Array of strings

用例Uris

service_type

Integer

服务类型

task_uri

String

任务/测试套Uri

feature_uri

String

目录Uri

key_word

String

关键字

sort_field

String

排序字段

sort_type

String

升序/降序

start_index

String

起始位置

end_index

String

结束位置

start_time

String

创建日期范围起始时间

end_time

String

创建日期范围结束时间

last_exe_authors

Array of strings

最后一次执行用户

module_ids

Array of strings

模块id

release_ids

Array of strings

迭代id

status_codes

Array of strings

用例状态

result_codes

Array of strings

执行结果Code

issue_id

String

需求id

execute_start_time

String

最近执行时间范围起始时间

execute_end_time

String

最近执行时间范围结束时间

label_ids

Array of strings

标签Id

include_sub_issue

Boolean

是否查询子需求关联的用例,默认true

include_sub_feature

Boolean

是否查询子目录的用例,默认true

case_type

Integer

用例类型

associated_issue

Boolean

是否关联需求(null:不限,false:未关联,true:已关联)

associated_defects

Boolean

是否关联缺陷(null:不限,false:未关联,true:已关联)

is_keyword

Boolean

是否组合关键字

issue_tree_search

Boolean

是否是需求树点击的查询关联用例

service_types

Array of integers

服务类型集合

stage_type

Integer

阶段过程(2:测试设计,3:测试执行,4:质量报告)

custom_field_info

Array of QueryCustomFieldsInfo objects

用例自定义字段信息

is_async

Boolean

是否异步执行

test_designs

Array of booleans

是否来自测试设计(null或者[true, false]:不限,[true]:来自测试设计,[false]:否来自测试设计)

not_assign_task

Boolean

该字段为false,则查询全量用例,为true表示查询未分配测试套的用例

test_types

Array of strings

类型

review_status

Integer

用例评审状态

表3 QueryCustomFieldsInfo

参数

是否必选

参数类型

描述

id

Integer

测试用例自定义字段Id

values

Array of strings

测试用例自定义字段值

field_name

String

自定义字段名,优先取id再取fieldName

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

status

String

success|error

result

ResultValueString object

请求的返回的数据对象

error

ApiError object

失败时的error信息

request_id

String

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

server_address

String

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

表5 ResultValueString

参数

参数类型

描述

value

String

testbird key

表6 ApiError

参数

参数类型

描述

code

String

业务失败的错误码

reason

String

业务失败的提示内容

状态码: 400

表7 响应Body参数

参数

参数类型

描述

error_code

String

接口调用失败错误码

error_msg

String

接口调用失败错误信息

状态码: 401

表8 响应Body参数

参数

参数类型

描述

error_code

String

接口调用失败错误码

error_msg

String

接口调用失败错误信息

状态码: 404

表9 响应Body参数

参数

参数类型

描述

error_code

String

接口调用失败错误码

error_msg

String

接口调用失败错误信息

状态码: 500

表10 响应Body参数

参数

参数类型

描述

error_code

String

接口调用失败错误码

error_msg

String

接口调用失败错误信息

请求示例

{
  "projectUUId" : "907d6252400e4dafb33f489ba1510a1b",
  "start_index" : 1,
  "end_index" : 2,
  "key_word" : "",
  "sort_field" : "",
  "sort_type" : "",
  "test_case_uris" : [ ],
  "is_async" : true,
  "feature_uri" : "907d6252400e4dafb33f489ba1510a1b"
}

响应示例

状态码: 200

OK

{
  "status" : "success",
  "result" : {
    "value" : "907d6252400e4dafb33f489ba1510a1bv9230000vrql8rjp"
  }
}

状态码

状态码

描述

200

OK

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

错误码

请参见错误码

相关文档