跳到主要内容

ONES TestCase Item API

危险

ONES API 已废弃。请使用Open API。

TestCaseItem​

library​

属性名属性名说明属性类型
keykeystring
uuiduuidstring
name用例库名字string
isPin是否置顶bool
namePinyin名字拼音string
createTime创建时间(时间戳)int64
members用户域userdomain
testcaseFieldConfig属性配置TestCaseFieldConfig

module​

属性名属性名说明属性类型
keykeystring
uuiduuidstring
name用例库名字string
path路径string
namePinyin名字拼音string
createTime创建时间(时间戳)int64
isDefault是否是无所属模块bool
positionpositionint64
parent父节点TestCaseModule
testcaseLibrary用例库TestCaseLibrary

case​

属性名属性名说明属性类型
keykeystring
uuiduuidstring
name用例库名字string
path路径string
namePinyin名字拼音string
createTime创建时间(时间戳)int64
isDefault是否是无所属模块bool
positionpositionint64
parent父节点TestCaseModule
testcaseLibrary用例库TestCaseLibrary

plan​

属性名属性名说明属性类型
keykeystring
uuiduuidstring
name用例库名字string
owner创建人User
namePinyin名字拼音string
createTime创建时间(时间戳)int64
stage测试阶段string
planStatus测试计划状态string
members用户域UserDomain
relatedProject关联项目Project
relatedSprint关联迭代Sprint
relatedIssueType关联任务类型IuuseType
todoCaseCount待测试用例数int
passedCaseCount通过用例数int
blockedCaseCount阻塞用例数int
skippedCaseCount跳过用例数int
failedCaseCount失败用例数int
assigns负责人User

plan_case

​

属性名属性名说明属性类型
keykeystring
note备注string
result用例状态string
createTime创建时间(时间戳)int64
warnStep警告步骤(暂时没用)string
relatedTasks关联任务string
testcasePlan测试计划TestCasePlan
testcaseCase用例TestCaseCase
executor执行人User

plan_case_step

​

属性名属性名说明属性类型
keykeystring
stepResult步骤执行结果string
actualResult实际结果string
testcasePlan测试计划string
testcaseCase用例TestCaseCase
testcaseCaseStep用例步骤User

field_config

​

属性名属性名说明属性类型
keykeystring
uuiduuidstring
name配置名称string
namePinyin配置名称的拼音string
createTime创建时间(时间戳)int64
isDefault是否是默认bool
testcaseLibraries用例库TestCaseLibrary

API 说明​


特殊说明:​

使用 GraphQL 查询,可以自行构建请求参数和筛选条件等等

GraphQL 使用方法请参考 GraphQL 文档


查询用例库​

查询用例库

URL​

https://your-host-name/project/api/project/team/:teamUUID/items/graphql

HTTP Method​

POST

是否需要登录​

manage_library_cases

传值方式​

JSON

请求参数列表​

参数名值类型值说明是否可以空
querystringGraphQL 请求脚本否

返回参数列表​

根据 GraphQL Query 返回

请求示例​

curl -X POST https://your-host-name/project/api/project/team/:teamUUID/items/graphql \
-H 'Content-Type: application/json' \
-H 'Ones-Auth-Token: ${token}' \
-H 'Ones-User-Id: ${user_uuid}' \
-H 'Referer: https://your-host-name' \
-H 'cache-control: no-cache' \
-d '{
"query": "\n query QUERY_LIBRARY_LIST {\n buckets (\n pagination: $pagination,\n groupBy: {\n testcaseLibraries: {}\n }\n ) {\n pageInfo {\n count\n totalCount\n startPos\n startCursor\n endPos\n endCursor\n hasNextPage\n }\n testcaseLibraries(\n orderBy: {\n isPin:DESC\n namePinyin:ASC\n }\n \n \n ){\n uuid,\n name,\n isPin,\n isSample,\n testcaseCaseCount,\n testcaseFieldConfig{\n key,\n uuid,\n name\n }\n }\n }\n }\n ",
"variables": {
"endCursor": "",
"pagination": {
"limit": 50
}
}
}'

返回示例​

{
"data": {
"buckets": [
{
"pageInfo": {
"count": 5,
"endCursor": "AK6VfLfjlPQEAAAAdGVzdGNhc2VfbGlicmFyeS1QU3pqbTdHTA==",
"endPos": 4,
"hasNextPage": false,
"startCursor": "AK6VfLfjlPQAAAAAdGVzdGNhc2VfbGlicmFyeS1MaHJHOFVoTQ==",
"startPos": 0,
"totalCount": 5
},
"testcaseLibraries": [
{
"isPin": false,
"isSample": false,
"name": "test1",
"testcaseCaseCount": 2000,
"testcaseFieldConfig": {
"key": "testcase_field_config-GbAeM9uH",
"name": "default",
"uuid": "GbAeM9uH"
},
"uuid": "LhrG8UhM"
},
{
"isPin": false,
"isSample": true,
"name": "order system",
"testcaseCaseCount": 2,
"testcaseFieldConfig": {
"key": "testcase_field_config-GbAeM9uH",
"name": "default",
"uuid": "GbAeM9uH"
},
"uuid": "V4o6KTJF"
},
{
"isPin": false,
"isSample": false,
"name": "lib2",
"testcaseCaseCount": 2000,
"testcaseFieldConfig": {
"key": "testcase_field_config-GbAeM9uH",
"name": "default",
"uuid": "GbAeM9uH"
},
"uuid": "3LdYp7bP"
},
{
"isPin": false,
"isSample": false,
"name": "lib3",
"testcaseCaseCount": 2000,
"testcaseFieldConfig": {
"key": "testcase_field_config-GbAeM9uH",
"name": "default",
"uuid": "GbAeM9uH"
},
"uuid": "MPM5bDMK"
},
{
"isPin": false,
"isSample": false,
"name": "lib4",
"testcaseCaseCount": 4000,
"testcaseFieldConfig": {
"key": "testcase_field_config-GbAeM9uH",
"name": "default",
"uuid": "GbAeM9uH"
},
"uuid": "PSzjm7GL"
}
]
}
]
}
}