90 lines
2.4 KiB
YAML
90 lines
2.4 KiB
YAML
case_common:
|
||
allure_epic: GitLink接口
|
||
allure_feature: 开源项目模块
|
||
allure_story: 新建项目
|
||
case_markers:
|
||
- gitlink
|
||
- projects
|
||
- gitea
|
||
- new_project
|
||
- usefixtures: gitlink_login
|
||
|
||
# 放置公共依赖 (仅yaml用例支持,excel用例不支持)
|
||
common_dependence:
|
||
setup:
|
||
interface:
|
||
# 获取项目类别
|
||
- gitlink_get_repo_category_01
|
||
|
||
case_info:
|
||
- id: gitlink_projects_new_project_01
|
||
title: 正确输入各项必填参数,新建公开项目成功
|
||
severity: critical
|
||
run: True
|
||
url: /api/projects.json
|
||
method: POST
|
||
headers:
|
||
Content-Type: application/json; charset=utf-8;
|
||
Cookie: ${cookies}
|
||
cookies:
|
||
request_type: json
|
||
payload:
|
||
user_id: ${user_id}
|
||
name: test_${generate_words()}_${generate_identifier()}
|
||
repository_name: ${generate_identifier()}_test
|
||
files:
|
||
assert_response:
|
||
status_code: 200
|
||
assertId:
|
||
message: 断言接口返回的存在id
|
||
expect_value: id
|
||
assert_type: contains
|
||
assert_sql:
|
||
extract:
|
||
type_jsonpath:
|
||
project_id: $.id # 项目id
|
||
repo_name: $.name
|
||
repo_owner: $.login
|
||
repo_identifier: $.identifier
|
||
case_dependence:
|
||
teardown:
|
||
interface:
|
||
# 清理数据:删除项目
|
||
- gitlink_projects_delete_project_01
|
||
|
||
- id: gitlink_projects_new_project_02
|
||
title: 新建公开项目成功
|
||
severity: critical
|
||
run: True
|
||
url: /api/projects.json
|
||
method: POST
|
||
headers:
|
||
Content-Type: application/json; charset=utf-8;
|
||
Cookie: ${cookies}
|
||
cookies:
|
||
request_type: json
|
||
payload:
|
||
user_id: ${user_id}
|
||
name: test_${generate_words()}_${generate_identifier()}
|
||
repository_name: ${generate_identifier()}_test
|
||
project_category_id: ${repo_category_id}
|
||
project_category: ${repo_category_name}
|
||
files:
|
||
assert_response:
|
||
status_code: 200
|
||
assertId:
|
||
message: 断言接口返回的存在id
|
||
expect_value: id
|
||
assert_type: contains
|
||
assert_sql:
|
||
extract:
|
||
type_jsonpath:
|
||
project_id: $.id # 项目id
|
||
repo_name: $.name
|
||
repo_owner: $.login
|
||
repo_identifier: $.identifier
|
||
case_dependence:
|
||
teardown:
|
||
interface:
|
||
# 清理数据:删除项目
|
||
- gitlink_projects_delete_project_01 |