Files
apiautotest/interface/gitlink/projects/repository/test_create_files.yaml
2024-01-09 13:49:07 +08:00

72 lines
1.9 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接口
allure_feature: 开源项目模块
allure_story: 代码库
case_markers:
- gitlink
- create_files
- gitea
- usefixtures: gitlink_login
- skip: 如何传递文件内容还未处理好,暂时略过
case_info:
-
id: gitlink_repo_create_files_001
title: 代码库新建/上传文件提交的分支是默认分支master
severity:
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/create_file.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: json
payload:
filepath: # 文件路径
base64_filepath:
branch: master # 提交的分支, 输入不存在的分支会自动新建一个
content: # 文件内容
message: # commit信息
files:
assert_response:
status_code: 200
assertAutor:
message: 断言提交者是当前登录用户
assert_type: ==
expect_value: ${login}
type_jsonpath: $.commit.author.name
assert_sql:
extract:
-
id: gitlink_repo_create_files_002
title: 代码库新建/上传文件,提交的分支是新的分支
severity:
run: True
url: /api/${env_project_url}/create_file.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: json
payload:
filepath: # 文件路径
base64_filepath:
branch: master # 提交的分支, 输入不存在的分支会自动新建一个
content: # 文件内容
message: # commit信息
new_branch: # 新的分支名称
files:
assert_response:
status_code: 200
assertAutor:
message: 断言提交者是当前登录用户
assert_type: ==
expect_value: ${login}
type_jsonpath: $.commit.author.name
assert_sql:
extract: