Files
apiautotest/interface/pms/projects/testcases/test_pms_edit_testcases.yaml
2024-03-04 15:38:14 +08:00

226 lines
6.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
case_common:
allure_epic: 项目管理
allure_feature: 项目
allure_story: 测试用例
case_markers:
- pms
- pms_project
- project_testcases
- usefixtures: gitlink_login
common_dependence:
setup:
interface:
- pms_get_enterprise_user_list_01
- pms_get_testcase_tag_list_01
- pms_new_testcases_02
case_info:
-
id: pms_edit_testcases_01
title: 项目下编辑测试用例接口 - 仅编辑标题
run: True
severity: blocker
url: ${pms_host}/api/pms/${env_enterprise_identifier}/pmsProjectTestcase
method: PUT
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
id: ${testcase_id}
title: ${generate_paragraph(nb=1)}
files:
assert_response:
status_code: 200
assertMessage:
type_jsonpath: $.msg
expect_value: 操作成功
assert_type: ==
assert_sql:
extract:
case_dependence:
-
id: pms_edit_testcases_02
title: 项目下编辑测试用例接口 - 编辑所有字段
run: True
severity: blocker
url: ${pms_host}/api/pms/${env_enterprise_identifier}/pmsProjectTestcase
method: PUT
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
id: ${testcase_id}
title: ${generate_paragraph(nb=1)}
preconditions: ${generate_words(lan='zh', nb=2)}
assigneeGitlinkId: ${${assignee_ids}[0]}
tags: ${random.choice(${testcase_tag_ids})}
typeId: ${random.choice([1,2,3,4,5,6,7])} # 用例类型 功能测试1 性能测试2 接口测试3 安装部署4 安全相关5 配置相关6 其他7
testcaseStepInputVoList:
-
index: 0
content: ${generate_words(lan='zh', nb=2)}
expectedResult: ${generate_words(lan='zh', nb=2)}
- index: 1
content: ${generate_words(lan='zh', nb=2)}
expectedResult: ${generate_words(lan='zh', nb=2)}
remark: ${generate_paragraph(nb=2)}
fileIdentifiers: ${file_identifier}
files:
assert_response:
status_code: 200
assertMessage:
type_jsonpath: $.msg
expect_value: 操作成功
assert_type: ==
assert_sql:
extract:
case_dependence:
setup:
interface:
- pms_upload_file_01
-
id: pms_edit_testcases_03
title: 项目下编辑测试用例接口 - 模块传-1, 编辑失败
run: True
severity: normal
url: ${pms_host}/api/pms/${env_enterprise_identifier}/pmsProjectTestcase
method: PUT
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
id: ${testcase_id}
title: ${generate_paragraph(nb=1)}
assigneeGitlinkId: ${${assignee_ids}[0]}
typeId: ${random.choice([1,2,3,4,5,6,7])} # 用例类型 功能测试1 性能测试2 接口测试3 安装部署4 安全相关5 配置相关6 其他7
pmsModuleId: -1
files:
assert_response:
status_code: 200
assertMessage:
type_jsonpath: $.msg
expect_value: 该模块不存在(模块ID[-1])
assert_type: ==
assert_sql:
extract:
case_dependence:
-
id: pms_edit_testcases_05
title: 项目下编辑测试用例接口 - 用例名称为空, 编辑失败
run: True
severity: normal
url: ${pms_host}/api/pms/${env_enterprise_identifier}/pmsProjectTestcase
method: PUT
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
id: ${testcase_id}
title:
assigneeGitlinkId: ${${assignee_ids}[0]}
typeId: ${random.choice([1,2,3,4,5,6,7])} # 用例类型 功能测试1 性能测试2 接口测试3 安装部署4 安全相关5 配置相关6 其他7
files:
assert_response:
status_code: 200
assertMessage:
type_jsonpath: $.msg
expect_value: 操作成功 # 当传参为空时,当前设计为不更新;
assert_type: ==
assert_sql:
extract:
case_dependence:
-
id: pms_edit_testcases_06
title: 项目下编辑测试用例接口 - 用例名称长度31, 编辑失败
run: True
severity: normal
url: ${pms_host}/api/pms/${env_enterprise_identifier}/pmsProjectTestcase
method: PUT
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
id: ${testcase_id}
title: ${faker.pystr(max_chars=101)}
assigneeGitlinkId: ${${assignee_ids}[0]}
typeId: ${random.choice([1,2,3,4,5,6,7])} # 用例类型 功能测试1 性能测试2 接口测试3 安装部署4 安全相关5 配置相关6 其他7
files:
assert_response:
status_code: 200
assertMessage:
type_jsonpath: $.msg
expect_value: '[title]字段校验异常长度需要小于100'
assert_type: ==
assert_sql:
extract:
case_dependence:
-
id: pms_edit_testcases_07
title: 项目下编辑测试用例接口 - 前置条件长度501, 编辑失败
run: True
severity: normal
url: ${pms_host}/api/pms/${env_enterprise_identifier}/pmsProjectTestcase
method: PUT
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
id: ${testcase_id}
title: ${faker.pystr(max_chars=100)}
preconditions: ${faker.pystr(max_chars=501)}
assigneeGitlinkId: ${${assignee_ids}[0]}
typeId: ${random.choice([1,2,3,4,5,6,7])} # 用例类型 功能测试1 性能测试2 接口测试3 安装部署4 安全相关5 配置相关6 其他7
files:
assert_response:
status_code: 200
assertMessage:
type_jsonpath: $.msg
expect_value: '[preconditions]字段校验异常长度需要小于500'
assert_type: ==
assert_sql:
extract:
case_dependence:
-
id: pms_edit_testcases_08
title: 项目下编辑测试用例接口 - 备注501, 编辑失败
run: True
severity: normal
url: ${pms_host}/api/pms/${env_enterprise_identifier}/pmsProjectTestcase
method: PUT
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
id: ${testcase_id}
title: ${faker.pystr(max_chars=100)}
remark: ${faker.pystr(max_chars=501)}
assigneeGitlinkId: ${${assignee_ids}[0]}
typeId: ${random.choice([1,2,3,4,5,6,7])} # 用例类型 功能测试1 性能测试2 接口测试3 安装部署4 安全相关5 配置相关6 其他7
files:
assert_response:
status_code: 200
assertMessage:
type_jsonpath: $.msg
expect_value: '[remark]字段校验异常长度需要小于500'
assert_type: ==
assert_sql:
extract:
case_dependence: