文档

GetTestcaseList - 获取用例库测试用例列表

获取测试用例库中的测试用例列表,支持条件过滤

接口说明

获取测试用例库中的测试用例列表,支持条件过滤,使用 conditions 条件过滤相应的数据

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

当前API暂无授权信息透出。

请求语法

POST /organization/{organizationId}/testhub/testcases

请求参数

名称类型必填描述示例值
organizationIdstring

企业 id

5ebbc0228123212b59xxxxx
bodyobject

请求 Body

spaceIdentifierstring

用例库 id,用例库唯一标识

6d5984c7d92b23fa53d4743c37
directoryIdentifierstring

目录 id,目录唯一标识,如果不填写,则默认该用例库下所有用例

e27b8eace6501ce51cf5d56784
conditionsstring

过滤器条件

{\"conditionGroups\":[[{\"fieldIdentifier\":\"status\",\"operator\":\"CONTAINS\",\"value\":[\"cc961a18adf770c6e423ccc5\"],\"toValue\":null,,\"className\":\"status\",\"format\":\"list\"}]]}
nextTokenstring

分页标识,第一页默认不用填写,下一页的参数从上一次调用结果获取

2591861102250c4522380b33a6
maxResultstring

分页大小,默认为 20

20

返回参数

名称类型描述示例值
object
totalCountlong

总数

10
nextTokenstring

分页 Token,没有下一页则为空

""
maxResultslong

每页数量

20
requestIdstring

请求 id,每次请求都是唯一值,便于后续排查问题

ASSDS-ASSASX-XSAXSA-XSAXSAXS
errorMsgstring

错误信息

error
errorCodestring

错误码

Openapi.RequestError
successboolean

true 或者 false

true
testcaseobject []

工作项信息

identifierstring

测试用例 Id,测试用例唯一标识

e8bxxxxxxxxxxxxxxxx23
subjectstring

测试用例标题

测试工作项
assignedToobject

负责人信息

assignedToIdenttifierstring

负责人 id,负责人唯一标识

12xxxxx456
namestring

负责人姓名

人员名称
spaceobject

用例库信息

spaceIdentifierstring

用例库 id,用例库唯一标识

22c32972b853cd703dbf0efe4c
typestring

空间类型

TestRepo
categoryIdentifierstring

测试用例的类型 id

Req
gmtCreatelong

创建时间

1621578648000
customFieldsobject []

自定义字段数组

fieldIdentifierstring

字段 id,自定义字段唯一标识

85702b33f14bfa82cb458173ba
valuestring

自定义字段值

d7f112f9d023e2108fa1b0d8
fieldFormatstring

自定义字段格式

Input
fieldClassNamestring

自定义字段类型

User
tagsobject []

标签数据数组

tagIdentifierstring

标签 id,标签唯一标识

85702b33f14bxxxxxx58173ba
namestring

标签名称

标签名称

示例

正常返回示例

JSON格式

{
  "totalCount": 10,
  "nextToken": "\"\"",
  "maxResults": 20,
  "requestId": "ASSDS-ASSASX-XSAXSA-XSAXSAXS",
  "errorMsg": "error",
  "errorCode": "Openapi.RequestError",
  "success": true,
  "testcase": [
    {
      "identifier": "e8bxxxxxxxxxxxxxxxx23",
      "subject": "测试工作项",
      "assignedTo": {
        "assignedToIdenttifier": "12xxxxx456",
        "name": "人员名称"
      },
      "space": {
        "spaceIdentifier": "22c32972b853cd703dbf0efe4c",
        "type": "TestRepo"
      },
      "categoryIdentifier": "Req",
      "gmtCreate": 1621578648000,
      "customFields": [
        {
          "fieldIdentifier": "85702b33f14bfa82cb458173ba",
          "value": "d7f112f9d023e2108fa1b0d8",
          "fieldFormat": "Input",
          "fieldClassName": "User"
        }
      ],
      "tags": [
        {
          "tagIdentifier": "85702b33f14bxxxxxx58173ba",
          "name": "标签名称"
        }
      ]
    }
  ]
}

错误码

HTTP status code错误码错误信息描述
400Openapi.RequestErrorrequest errorOpenAPI请求数据错误
403Operate.NoPermissionNoPermission没有权限

访问错误中心查看更多错误码。

  • 本页导读 (0)
文档反馈