新增代码库模块相关测试用例

This commit is contained in:
floraachy
2023-12-14 17:07:36 +08:00
parent f30dbb0181
commit ead008c96b
29 changed files with 1077 additions and 16 deletions

View File

@@ -0,0 +1,36 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 分支
case_markers:
- gitlink
- branches
- gitea
- usefixtures: get_oauth_token
case_info:
-
id: gitlink_repo_branches_001
title: 获取项目分支列表
severity:
run: True
url: /api/v1/${project_url}/branches.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: params
payload:
keyword: # 搜索关键词
page: 1
limit: 10
files:
assert_response:
status_code: 200
assertAutor:
message: 断言接口返回存在total_count字段
assert_type: contains
expect_value: total_count
assert_sql:
extract:

View File

@@ -0,0 +1,33 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 分支
case_markers:
- gitlink
- branches
- gitea
- usefixtures: get_oauth_token
case_info:
-
id: gitlink_repo_branches_001
title: 获取项目分支列表(无分页)
severity:
run: True
url: /api/v1/${project_url}/branches/all.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: params
payload:
files:
assert_response:
status_code: 200
assertAutor:
message: 断言接口返回存在name字段
assert_type: contains
expect_value: name
assert_sql:
extract:

View File

@@ -0,0 +1,40 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 分支
case_markers:
- gitlink
- branches
- gitea
- usefixtures: get_oauth_token
- skip: 前提得存在一个分支,暂时略过
case_info:
-
id: gitlink_repo_delete_branch_001
title: 删除一个项目分支
severity:
run: True
url: /api/v1/${project_url}/branches/${branch}.json
method: DELETE
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: json
payload:
files:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assertMessage:
message: 断言接口返回message
expect_value: fork项目成功
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:

View File

@@ -0,0 +1,35 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 分支
case_markers:
- gitlink
- branches
- gitea
- usefixtures: get_oauth_token
case_info:
-
id: gitlink_repo_new_branch_001
title: 创建一个项目分支
severity:
run: True
url: /api/v1/${project_url}/branches.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: json
payload:
new_branch_name: ${generate_words()}
old_branch_name: master
files:
assert_response:
status_code: 200
assertAutor:
message: 断言接口返回存在name字段
assert_type: contains
expect_value: name
assert_sql:
extract:

View File

@@ -0,0 +1,36 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 分支
case_markers:
- gitlink
- branches
- gitea
- usefixtures: get_oauth_token
- skip: 这个需要仓库管理员角色才能操作,暂时略过
case_info:
-
id: gitlink_repo_set_default_branch_001
title: 更新项目默认分支
severity:
run: True
url: /api/${project_url}.json
method: PUT
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: json
payload:
default_branch: master
files:
assert_response:
status_code: 200
assertProjectId:
message: 断言projectid
assert_type: ==
expect_value: ${project_id}
type_jsonpath: $.id
assert_sql:
extract:

View File

@@ -0,0 +1,54 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 合并请求
case_markers:
- gitlink
- pr
- gitea
- usefixtures: get_oauth_token
- skip: 前提是有一个开启状态的PR暂时略过
case_info:
-
id: gitlink_repo_edit_pull_request_001
title: 编辑一个合并请求
severity:
run: True
url: /api/v1/${project_url}/edit/${pr_id}.json
method: PUT
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: json
payload:
title: ${generate_words()} # 合并请求标题
body: ${generate_paragraph()} # 合并请求内容
head: # 源分支
base: master # 目标分支
is_original: false # 是否为fork仓库发来的合并请求
fork_project_id: # fork仓库ID
merge_project_identifier:
files_count: 1
commits_count: 1
receivers_login: [] # @人员的login
issue_tag_ids: master # 标记ID数组
assigned_to_id: # 指派人员ID
fixed_version_id: # 里程碑ID
priority_id: # 优先级ID
files:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assertMessage:
message: 断言接口返回message
expect_value: PullRequest更新成功
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:

View File

@@ -0,0 +1,54 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 合并请求
case_markers:
- gitlink
- pr
- gitea
- usefixtures: get_oauth_token
- skip: 前提是仓库存在2个不同的分支暂时略过
case_info:
-
id: gitlink_repo_new_pull_request_001
title: 创建一个合并请求
severity:
run: True
url: /api/v1/${project_url}/pulls.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: json
payload:
title: ${generate_words()} # 合并请求标题
body: ${generate_paragraph()} # 合并请求内容
head: # 源分支
base: master # 目标分支
is_original: false # 是否为fork仓库发来的合并请求
fork_project_id: # fork仓库ID
merge_project_identifier:
files_count: 1
commits_count: 1
receivers_login: [] # @人员的login
issue_tag_ids: master # 标记ID数组
assigned_to_id: # 指派人员ID
fixed_version_id: # 里程碑ID
priority_id: # 优先级ID
files:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assertMessage:
message: 断言接口返回message
expect_value: 响应成功
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:

View File

@@ -0,0 +1,45 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 合并请求
case_markers:
- gitlink
- pr
- gitea
- usefixtures: get_oauth_token
- skip: 前提是有一个开启状态的PR暂时略过
case_info:
-
id: gitlink_repo_pr_merge_001
title: 合并一个合并请求
severity:
run: True
url: /api/v1/${project_url}/edit/${pr_id}/pr_merge.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: json
payload:
project_id: ${repo_identifier} # 项目标识
id: ${pr_id} # 合并请求id
do: merge
title: ${generate_words()}
body: ${generate_words()}
files:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assertMessage:
message: 断言接口返回message
expect_value: 合并成功
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:

View File

@@ -0,0 +1,42 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 合并请求
case_markers:
- gitlink
- pr
- gitea
- usefixtures: get_oauth_token
case_info:
-
id: gitlink_repo__pull_request_001
title: 获取合并请求列表
severity:
run: True
url: /api/v1/${project_url}/pulls.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: params
payload:
assign_user_id: # 指派人员ID
issue_tag_id: # 标记ID
keyword: # 搜索关键词
priority_id: # 优先级ID
reviewer_id: # 审查人员ID
sort_by: # 排序字段updated_at 更新时间 created_at 创建时间
sort_direction: # 排序类型。desc 倒序 asc 正序
status: # 合并请求类型0 开启的 1 合并的 2 关闭,不传为全部
version_id: # 里程碑ID
files:
assert_response:
status_code: 200
assertField:
message: 断言接口存在字段total_count
expect_value: total_count
assert_type: contains
assert_sql:
extract:

View File

@@ -0,0 +1,40 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 合并请求
case_markers:
- gitlink
- pr
- gitea
- usefixtures: get_oauth_token
- skip: 前提是有一个开启状态的PR暂时略过
case_info:
-
id: gitlink_repo_refuse_merge_001
title: 拒绝一个合并请求
severity:
run: True
url: /api/v1/${project_url}/edit/${pr_id}/refuse_merge.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: json
payload:
files:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assertMessage:
message: 断言接口返回message
expect_value: 已拒绝
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:

View File

@@ -0,0 +1,46 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 发行版
case_markers:
- gitlink
- release
- gitea
- usefixtures: get_oauth_token
case_info:
-
id: gitlink_repo_new_release_001
title: 创建发行版
severity:
run: True
url: /api/${project_url}/releases.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: json
payload:
tag_name: ${generate_identifier()} # 标签
name: ${generate_words()} # 发行版标题
body: ${generate_words()} # 发行版描述
target_commitish: master # 分支
draft: false # 是否为草稿
prerelease: false # 是否为预发布版
attachment_ids: # 附件ID数组
files:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assertMessage:
message: 断言接口返回message
expect_value: 发布成功
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:

View File

@@ -0,0 +1,71 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 代码库
case_markers:
- gitlink
- create_files
- gitea
- usefixtures: get_oauth_token
- skip: 如何传递文件内容还未处理好,暂时略过
case_info:
-
id: gitlink_repo_create_files_001
title: 代码库新建/上传文件提交的分支是默认分支master
severity:
run: True
url: /api/${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信息
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/${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:

View File

@@ -0,0 +1,34 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 代码库
case_markers:
- gitlink
- project_detail
- gitea
- usefixtures: get_oauth_token
case_info:
-
id: gitlink_repo_detail_001
title: 项目详情
severity:
run: True
url: /api/${project_url}/detail.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: params
payload:
files:
assert_response:
status_code: 200
assertProjectId:
message: 断言projectid
assert_type: ==
expect_value: ${project_id}
type_jsonpath: $.project_id
assert_sql:
extract:

View File

@@ -0,0 +1,34 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 代码库
case_markers:
- gitlink
- project_simple
- gitea
- usefixtures: get_oauth_token
case_info:
-
id: gitlink_repo_simple_001
title: 项目详情(简版)
severity:
run: True
url: /api/${project_url}/simple.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: params
payload:
files:
assert_response:
status_code: 200
assertProjectId:
message: 断言projectid
assert_type: ==
expect_value: ${project_id}
type_jsonpath: $.id
assert_sql:
extract:

View File

@@ -0,0 +1,33 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 代码库
case_markers:
- gitlink
- repo_contributors
- gitea
- usefixtures: get_oauth_token
case_info:
-
id: gitlink_repo_contributors_001
title: 获取项目贡献者列表
severity:
run: True
url: /api/${project_url}/contributors.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: params
payload:
files:
assert_response:
status_code: 200
assertAutor:
message: 断言接口返回存在total_count字段
assert_type: contains
expect_value: total_count
assert_sql:
extract:

View File

@@ -0,0 +1,34 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 代码库
case_markers:
- gitlink
- repo_entries
- gitea
- usefixtures: get_oauth_token
case_info:
-
id: gitlink_repo_entries_001
title: 获取项目代码目录
severity:
run: True
url: /api/${project_url}/entries.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: params
payload:
ref: master
files:
assert_response:
status_code: 200
assertAutor:
message: 断言接口返回存在entries字段
assert_type: contains
expect_value: entries
assert_sql:
extract:

View File

@@ -0,0 +1,37 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 代码库
case_markers:
- gitlink
- repo_sub_entries
- gitea
- usefixtures: get_oauth_token
- skip: 这个暂时略过,后续完善
case_info:
-
id: gitlink_repo_sub_entries_001
title: 获取项目代码子目录或者文件
severity:
run: True
url: /api/${project_url}/sub_entries.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: params
payload:
ref: master
filepath:
type: # 可选file或者dir
files:
assert_response:
status_code: 200
assertAutor:
message: 断言接口返回存在entries字段
assert_type: contains
expect_value: entries
assert_sql:
extract:

View File

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

View File

@@ -0,0 +1,48 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 项目
case_markers:
- gitlink
- projects
- gitea
- follow_project
- usefixtures: get_oauth_token
- skip: 前提是有一个未关注的项目,暂时略过
case_info:
-
id: gitlink_projects_follow_project_01
title: 关注项目
severity: critical
run: True
url: /api/watchers/follow.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: params
payload:
target_type: project
id: ${project_id}
files:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assertMessage:
message: 断言接口返回message
expect_value: success
assert_type: ==
type_jsonpath: $.message
assertPraised:
message: 断言接口返回watched=true
expect_value: true
assert_type: ==
type_jsonpath: $.watched
assert_sql:
extract:

View File

@@ -0,0 +1,44 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 项目
case_markers:
- gitlink
- projects
- gitea
- fork_project
- usefixtures: get_oauth_token
- skip: 前提是有一个未fork的项目暂时略过
case_info:
-
id: gitlink_projects_fork_project_01
title: fork项目
severity: critical
run: True
url: /api/${project_url}/forks.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: json
payload:
files:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assertMessage:
message: 断言接口返回message
expect_value: fork项目成功
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:
type_jsonpath:
repo_id: $.id
repo_identifier: $.identifier

View File

@@ -0,0 +1,46 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 项目
case_markers:
- gitlink
- projects
- gitea
- like_project
- usefixtures: get_oauth_token
- skip: 前提是有一个未点赞的项目,暂时略过
case_info:
-
id: gitlink_projects_like_project_01
title: 点赞项目
severity: critical
run: True
url: /api/projects/${project_id}/praise_tread/like.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: json
payload:
files:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assertMessage:
message: 断言接口返回message
expect_value: success
assert_type: ==
type_jsonpath: $.message
assertPraised:
message: 断言接口返回praised=true
expect_value: true
assert_type: ==
type_jsonpath: $.praised
assert_sql:
extract:

View File

@@ -1,8 +1,7 @@
# 公共参数
case_common:
allure_epic: GitLink接口 # 敏捷里面的概念定义史诗相当于module级的标签, 往下是 feature
allure_feature: 开源项目模块 # 功能点的描述相当于class级的标签, 理解成模块往下是 story
allure_story: 项目 # 故事可以理解为场景相当于method级的标签, 往下是 title
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 项目
case_markers:
- gitlink
- projects
@@ -11,7 +10,6 @@ case_common:
- usefixtures: get_oauth_token
- usefixtures: delete_project
# 用例数据
case_info:
-
id: gitlink_projects_new_project_01
@@ -28,7 +26,7 @@ case_info:
payload:
user_id: ${user_id}
name: ${generate_name(lan='zh')}_${generate_identifier()}
repository_name: ${generate_identifier()}
repository_name: ${generate_identifier()}_test
files:
assert_response:
status_code: 200
@@ -58,7 +56,7 @@ case_info:
payload:
user_id: ${user_id}
name: ${generate_name(lan='zh')}_${generate_identifier()}
repository_name: ${generate_identifier()}
repository_name: ${generate_identifier()}_test
description:
private: true
ignoreFlag: true
@@ -107,7 +105,7 @@ case_info:
payload:
user_id: ${user_id}
name: ${generate_name(lan='zh')}_${generate_identifier()}
repository_name: ${generate_identifier()}
repository_name: ${generate_identifier()}_test
files:
assert_response:
status_code: 200

View File

@@ -0,0 +1,48 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 项目
case_markers:
- gitlink
- projects
- gitea
- unfollow_project
- usefixtures: get_oauth_token
- skip: 需要有一个已关注项目,暂时掠过,后续完善
case_info:
-
id: gitlink_projects_unfollow_project_01
title: 取消关注项目
severity: critical
run: True
url: /api/watchers/unfollow.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: params
payload:
target_type: project
id: ${project_id}
files:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assertMessage:
message: 断言接口返回message
expect_value: success
assert_type: ==
type_jsonpath: $.message
assertPraised:
message: 断言接口返回watched=false
expect_value: false
assert_type: ==
type_jsonpath: $.watched
assert_sql:
extract:

View File

@@ -0,0 +1,46 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 项目
case_markers:
- gitlink
- projects
- gitea
- unlike_project
- usefixtures: get_oauth_token
- skip: 需要有一个已点赞项目,暂时掠过,后续完善
case_info:
-
id: gitlink_projects_like_project_02
title: 取消点赞项目
severity: critical
run: true
url: /api/projects/${project_id}/praise_tread/unlike.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
Authorization: ${token_type} ${access_token}
cookies:
request_type: json
payload:
files:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assertMessage:
message: 断言接口返回message
expect_value: success
assert_type: ==
type_jsonpath: $.message
assertPraised:
message: 断言接口返回praised=false
expect_value: false
assert_type: ==
type_jsonpath: $.praised
assert_sql:
extract:

View File

@@ -1,7 +1,7 @@
# 公共参数
case_common:
allure_epic: GitLink接口
allure_feature: 上传文件模块
allure_feature: 开源项目模块
allure_story: 上传文件
case_markers:
- gitlink
@@ -11,8 +11,8 @@ case_common:
# 用例数据
case_info:
-
id: case_upload_file_01
title: 测试文件上传
id: gitlink_upload_file_01
title: 测试文件上传
severity:
run: True
url: /api/attachments.json

View File

@@ -1,7 +1,7 @@
# 公共参数
case_common:
allure_epic: GitLink接口
allure_feature: 用户
allure_feature: 用户模块
allure_story: 账号管理
case_markers:
- gitlink
@@ -17,7 +17,7 @@ case_info:
title: 用户修改邮箱
run: True
severity: normal
url: api/v1/${login}/update_email.json
url: /api/v1/${login}/update_email.json
method: PATCH
headers:
Content-Type: application/json; charset=utf-8;

View File

@@ -1,7 +1,7 @@
# 公共参数
case_common:
allure_epic: GitLink接口
allure_feature: 用户
allure_feature: 用户模块
allure_story: 账号管理
case_markers:
- gitlink

View File

@@ -1,7 +1,7 @@
# 公共参数
case_common:
allure_epic: GitLink接口
allure_feature: 用户
allure_feature: 用户模块
allure_story: 账号管理
case_markers:
- gitlink
@@ -16,7 +16,7 @@ case_info:
title: 用户修改手机号码
run: True
severity: normal
url: api/v1/${login}/update_phone.json
url: /api/v1/${login}/update_phone.json
method: PATCH
headers:
Content-Type: application/json; charset=utf-8;

View File

@@ -0,0 +1,55 @@
case_common:
allure_epic: GitLink接口
allure_feature: 用户模块
allure_story: 登录注册
case_markers:
- gitlink
- gitea
- register
case_info:
-
id: gitlink_user_register_01
title: 用户注册(邮箱注册)
run: True
severity: normal
url: /api/accounts/register.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies:
request_type: json
payload:
namespace: ${generate_identifier}
login: ${generate_email()}
password: ${password}
password_confirmation: ${password}
code: ${green_code}
files:
assert_response:
status_code: 200
assert_sql:
extract:
-
id: gitlink_user_register_02
title: 用户注册(手机号注册)
run: True
severity: normal
url: /api/accounts/register.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies:
request_type: json
payload:
namespace: ${generate_identifier}
login: ${generate_phone(lan='zh')}
password: ${password}
password_confirmation: ${password}
code: ${green_code}
files:
assert_response:
status_code: 200
assert_sql:
extract: