Skip to content

测试单 (testtask)

测试单管理,支持获取测试单列表,支持获取产品/项目/执行下的测试单、创建测试单、修改测试单、删除测试单

动作概览

SDK 动作说明方法路径
list获取测试单列表,支持获取产品/项目/执行下的测试单GET/{scope}/{scopeID}/testtasks
create创建测试单POST/testtasks
update修改测试单PUT/testtasks/{testtaskID}
delete删除测试单DELETE/testtasks/{testtaskID}

获取测试单列表,支持获取产品/项目/执行下的测试单

  • SDK 调用:request("testtask/list", params)
  • HTTP:GET /{scope}/{scopeID}/testtasks
  • 动作类型:list

路径参数

参数说明
scope测试单范围
scopeID范围ID

查询参数

无查询参数。

请求体

无请求体。

返回值

  • 返回形态:list
  • 结果字段:testtasks
  • 分页字段:pager

SDK 示例

ts
import { request } from 'zentao-api';

const result = await request("testtask/list", {
  "scope": "<string>",
  "scopeID": 1
});

创建测试单

  • SDK 调用:request("testtask/create", params)
  • HTTP:POST /testtasks
  • 动作类型:create

路径参数

无路径参数。

查询参数

无查询参数。

请求体

请求体必填:是

Schema:

json
{
  "type": "object",
  "properties": {
    "productID": {
      "type": "integer",
      "description": "所属产品ID",
      "format": "int32"
    },
    "name": {
      "type": "string",
      "description": "测试单名称"
    },
    "build": {
      "type": "integer",
      "description": "提测构建/版本",
      "format": "int32"
    },
    "execution": {
      "type": "integer",
      "description": "所属执行",
      "format": "int32"
    },
    "type": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "类型(integrate 集成测试 | system 系统测试 | acceptance 验收测试 | performance 性能测试 | safety 安全测试)"
    },
    "owner": {
      "type": "string",
      "description": "负责人"
    },
    "status": {
      "type": "string",
      "description": "状态(wait 未开始 | doing 进行中 | done 已关闭 | blocked 被阻塞)"
    },
    "begin": {
      "type": "string",
      "description": "开始日期"
    },
    "end": {
      "type": "string",
      "description": "结束日期"
    },
    "desc": {
      "type": "string",
      "description": "描述"
    }
  },
  "required": [
    "productID",
    "name",
    "build",
    "begin",
    "end"
  ]
}

示例:

json
{
  "productID": 1,
  "name": "<string>",
  "build": 1,
  "execution": 1,
  "type": [
    "<string>"
  ],
  "owner": "<string>",
  "status": "<string>",
  "begin": "<string>",
  "end": "<string>",
  "desc": "<string>"
}

返回值

  • 返回形态:object

SDK 示例

ts
import { request } from 'zentao-api';

const result = await request("testtask/create", {
  "productID": 1,
  "name": "<string>",
  "build": 1,
  "execution": 1,
  "type": [
    "<string>"
  ],
  "owner": "<string>",
  "status": "<string>",
  "begin": "<string>",
  "end": "<string>",
  "desc": "<string>"
});

修改测试单

  • SDK 调用:request("testtask/update", params)
  • HTTP:PUT /testtasks/{testtaskID}
  • 动作类型:update

路径参数

参数说明
testtaskID测试单ID

查询参数

无查询参数。

请求体

请求体必填:是

Schema:

json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "测试单名称"
    },
    "build": {
      "type": "integer",
      "description": "提测构建/版本",
      "format": "int32"
    },
    "execution": {
      "type": "integer",
      "description": "所属执行",
      "format": "int32"
    },
    "type": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "类型(integrate 集成测试 | system 系统测试 | acceptance 验收测试 | performance 性能测试 | safety 安全测试)"
    },
    "owner": {
      "type": "string",
      "description": "负责人"
    },
    "status": {
      "type": "string",
      "description": "状态(wait 未开始 | doing 进行中 | done 已关闭 | blocked 被阻塞)"
    },
    "begin": {
      "type": "string",
      "description": "开始日期"
    },
    "end": {
      "type": "string",
      "description": "结束日期"
    },
    "desc": {
      "type": "string",
      "description": "描述"
    }
  },
  "required": [
    "name",
    "build",
    "begin",
    "end"
  ]
}

示例:

json
{
  "name": "<string>",
  "build": 1,
  "execution": 1,
  "type": [
    "<string>"
  ],
  "owner": "<string>",
  "status": "<string>",
  "begin": "<string>",
  "end": "<string>",
  "desc": "<string>"
}

返回值

  • 返回形态:object

SDK 示例

ts
import { request } from 'zentao-api';

const result = await request("testtask/update", {
  "testtaskID": 1,
  "name": "<string>",
  "build": 1,
  "execution": 1,
  "type": [
    "<string>"
  ],
  "owner": "<string>",
  "status": "<string>",
  "begin": "<string>",
  "end": "<string>",
  "desc": "<string>"
});

删除测试单

  • SDK 调用:request("testtask/delete", params)
  • HTTP:DELETE /testtasks/{testtaskID}
  • 动作类型:delete

路径参数

参数说明
testtaskID测试单ID

查询参数

无查询参数。

请求体

无请求体。

返回值

  • 返回形态:text

SDK 示例

ts
import { request } from 'zentao-api';

const result = await request("testtask/delete", {
  "testtaskID": 1
});

Released under the MIT License.