Files
apiautotest/interface/gitlink/projects/test_new_project.yaml

131 lines
3.4 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: GitLink接口 # 敏捷里面的概念定义史诗相当于module级的标签, 往下是 feature
allure_feature: 开源项目模块 # 功能点的描述相当于class级的标签, 理解成模块往下是 story
allure_story: 项目 # 故事可以理解为场景相当于method级的标签, 往下是 title
case_markers:
- gitlink
- projects
- gitea
- new_project
- usefixtures: get_oauth_token
- usefixtures: delete_project
# 用例数据
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;
Authorization: ${token_type} ${access_token}
cookies:
request_type: json
payload:
user_id: ${user_id}
name: ${generate_name(lan='zh')}_${generate_identifier()}
repository_name: ${generate_identifier()}
files:
assert_response:
status_code: 200
login:
message: 断言接口返回的login
expect_value: ${login}
assert_type: ==
type_jsonpath: $.login
assert_sql:
extract:
type_jsonpath:
repo_id: $.id
repo_name: $.name
repo_owner: $.login
repo_identifier: $.identifier
-
id: gitlink_projects_new_project_02
title: 正确输入所有参数,新建私有项目成功
run: false
url: /api/projects.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
user_id: ${user_id}
name: ${generate_name(lan='zh')}_${generate_identifier()}
repository_name: ${generate_identifier()}
description:
private: true
ignoreFlag: true
ignore_id:
ignore:
licenseFlag: true
license_id:
license:
categoreFlag: true
project_category_id:
project_category:
languageFlag: true
project_language_id:
project_language:
blockchain: false
blockchain_token_all: 10000
blockchain_init_token:
auth_password:
files:
assert_response:
status_code: 200
login:
message: 断言接口返回的login
expect_value: ${login}
assert_type: ==
type_jsonpath: $.login
assert_sql:
extract:
type_jsonpath:
repo_id: $.id
repo_name: $.name
repo_owner: $.login
repo_identifier: $.identifier
-
id: gitlink_projects_new_project_03
title: 正确输入各项必填参数,新建项目成功(校验数据库)
severity: normal
run: false
url: /api/projects.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
user_id: ${user_id}
name: ${generate_name(lan='zh')}_${generate_identifier()}
repository_name: ${generate_identifier()}
files:
assert_response:
status_code: 200
login:
message: 断言接口返回的login
expect_value: ${login}
assert_type: ==
type_jsonpath: $.login
assert_sql:
eq:
sql: select id,`name`, identifier from projects where user_id=${user_id} ORDER BY created_on DESC;
$.id: ${project_id}
$.name: ${project_name}
$.identifier: ${project_identifier}
extract:
type_jsonpath:
repo_id: $.id
repo_name: $.name
repo_owner: $.login
repo_identifier: $.identifier