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

调试用例

功能介绍

调试用例

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

POST /v1/{project_id}/test-suites/{test_suite_id}/tasks/{task_id}/cases/{case_id}/debug

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID,获取方式请参见获取项目ID

最小长度:0

最大长度:64

test_suite_id

Integer

测试工程id

最小值:0

最大值:2147483647

task_id

Integer

任务id

最小值:0

最大值:2147483647

case_id

Integer

用例id

最小值:0

最大值:2147483647

请求参数

表2 请求Body参数

参数

是否必选

参数类型

描述

status

Integer

状态(9:启动调试)

最小值:0

最大值:2147483647

cluster_id

Integer

资源组id

最小值:0

最大值:2147483647

cluster_type

String

资源组类型(共享资源组:shared-cluster-internet;私有资源组:private-cluster)

最小长度:0

最大长度:1024

without_package

Integer

套餐包VUM不足的情况下用户选择是不是要走按需计费模式(当前版本固定值:0)

最小值:0

最大值:2147483647

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

code

String

响应码

最小长度:0

最大长度:1024

message

String

响应消息

最小长度:0

最大长度:1024

extend

String

扩展信息

最小长度:0

最大长度:1024

result

Array of DebugCaseResult objects

结果

数组长度:0 - 1024

表4 DebugCaseResult

参数

参数类型

描述

body

String

响应内容

errorReason

String

错误原因

最小长度:0

最大长度:1024

header

DebugCaseResultHeader object

请求头

name

String

请求名称

最小长度:0

最大长度:1024

responseTime

Integer

响应时间

最小值:0

最大值:1024

result

Integer

调试结果(1:成功;)

最小值:0

最大值:2147483647

returnBody

String

响应正文

最小长度:0

最大长度:40960

returnHeader

DebugCaseReturnHeader object

响应头

statusCode

String

响应状态码

最小长度:0

最大长度:1024

url

String

请求地址

最小长度:0

最大长度:1024

表5 DebugCaseResultHeader

参数

参数类型

描述

Connection

String

连接

最小长度:0

最大长度:1024

Content-Type

String

内容类型

最小长度:0

最大长度:1024

Host

String

主机

最小长度:0

最大长度:1024

表6 DebugCaseReturnHeader

参数

参数类型

描述

Connection

String

连接

最小长度:0

最大长度:1024

Content-Length

String

内容长度

最小长度:0

最大长度:1024

Content-Type

String

内容类型

最小长度:0

最大长度:1024

Date

String

时间

最小长度:0

最大长度:1024

Vary

String

兼容性保留,当前版本未使用

最小长度:0

最大长度:1024

请求示例

调试一个用例,用例的id是1,使用共享资源组启动调试。

https://cpts.{region}.domain-example.com/v1/projectId/test-suites/testSuiteId/tasks/0/cases/1/debug

{
  "status" : 9,
  "cluster_id" : 0,
  "cluster_type" : "shared-cluster-internet",
  "without_package" : 1
}

响应示例

状态码: 200

success

{
  "code" : "SVCSTG.CPTS.0000000",
  "message" : "success",
  "extend" : null,
  "result" : [ {
    "body" : "",
    "errorReason" : "",
    "header" : {
      "Content-Type" : "application/json",
      "Host" : "100.93.1.72:8443"
    },
    "name" : "Msg-84012",
    "responseTime" : 24,
    "result" : 1,
    "returnBody" : "",
    "returnHeader" : {
      "Content-Length" : "0",
      "Content-Type" : "text/plain; charset=utf-8",
      "Date" : "Mon, 19 Sep 2022 07:29:46 GMT"
    },
    "statusCode" : "200 OK",
    "url" : "GET https://100.93.1.72:8443/goserver/reflect"
  } ]
}

状态码

状态码

描述

200

success

501

unknown error

错误码

请参见错误码

分享:

    相关文档

    相关产品