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

73 lines
1.9 KiB
YAML

case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 代码库
case_markers:
- gitlink
- update_files
- gitea
- usefixtures: gitlink_login
- skip: 如何传递文件内容还未处理好,暂时略过
case_info:
-
id: gitlink_repo_update_files_001
title: 代码库更新文件
severity:
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/update_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信息
sha: # 要更新的文件的sha值
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: