更新开源项目一系列接口用例

This commit is contained in:
floraachy
2024-03-06 14:38:21 +08:00
parent 6ab6321f32
commit 6b4063ed98
60 changed files with 2227 additions and 222 deletions
@@ -0,0 +1,37 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 项目主页
case_markers:
- gitlink
- repo
- about
- usefixtures: gitlink_login
# 目前非仓库管理员操作会报403, 待后续需求确认后更改
case_info:
-
id: gitlink_repo_get_about_detail_01
title: 编辑项目主页内容
run: true
severity: normal
url: /api/${env_repo_owner}/${env_repo_identifier}/about.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
content: ${generate_paragraph(nb=10)}
files:
assert_response:
status_code: 200
assertField:
message: 断言接口响返回的项目标识
assert_type: ==
expect_value: ${env_repo_identifier}
type_jsonpath: $.identifier
assert_sql:
extract:
case_dependence:
@@ -0,0 +1,34 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 项目主页
case_markers:
- gitlink
- repo
- about
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_about_detail_01
title: 查询项目主页详情
run: true
severity: normal
url: /api/${env_repo_owner}/${env_repo_identifier}/about.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: params
payload:
files:
assert_response:
status_code: 200
assertField:
message: 断言接口响返回的项目标识
assert_type: ==
expect_value: ${env_repo_identifier}
type_jsonpath: $.identifier
assert_sql:
extract:
case_dependence:
@@ -39,7 +39,7 @@ case_info:
-
id: gitlink_get_repo_branches_all_02
title: 获取项目分支列表(无分页)
severity:
severity: normal
run: True
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/branches/all.json
method: GET
@@ -58,3 +58,31 @@ case_info:
expect_value: name
assert_sql:
extract:
-
id: gitlink_get_repo_branches_by_keyword_01
title: 获取项目分支列表- 根据搜索关键字
severity:
run: True
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/branches.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
keyword: master
page: 1
limit: 10
files:
assert_response:
status_code: 200
assertAutor:
message: 断言接口返回存在total_count字段
assert_type: contains
expect_value: total_count
assert_sql:
extract:
type_jsonpath:
branch_name: $.branches[0].name
@@ -7,15 +7,16 @@ case_common:
- branches
- gitea
- usefixtures: gitlink_login
- skip: 前提得存在一个分支,暂时略过
# 需要仓库管理员才能删除分支
case_info:
-
id: gitlink_repo_delete_branch_001
title: 删除一个项目分支
severity:
severity: critical
run: True
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/branches/${branch}.json
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/branches/${branch_name}.json
method: DELETE
headers:
Content-Type: application/json; charset=utf-8;
@@ -33,8 +34,13 @@ case_info:
type_jsonpath: $.status
assertMessage:
message: 断言接口返回message
expect_value: fork项目成功
expect_value: success
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_branch_001
- gitlink_super_login_04
@@ -7,13 +7,12 @@ case_common:
- branches
- gitea
- usefixtures: gitlink_login
- skip: 需要项目成员才能操作,暂时略过
case_info:
-
id: gitlink_repo_new_branch_001
title: 创建一个项目分支
severity:
severity: critical
run: True
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/branches.json
method: POST
@@ -34,3 +33,12 @@ case_info:
expect_value: name
assert_sql:
extract:
type_jsonpath:
branch_name: $.name
case_dependence:
teardown:
interface:
- gitlink_super_login_04
- gitlink_repo_delete_branch_001
@@ -6,14 +6,12 @@ case_common:
- gitlink
- branches
- gitea
- usefixtures: gitlink_login
- skip: 这个需要仓库管理员角色才能操作,暂时略过
case_info:
-
id: gitlink_repo_set_default_branch_001
title: 更新项目默认分支
severity:
severity: critical
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}.json
method: PUT
@@ -28,9 +26,14 @@ case_info:
assert_response:
status_code: 200
assertProjectId:
message: 断言projectid
message: 断言identifier
assert_type: ==
expect_value: ${pms_project_id}
type_jsonpath: $.id
expect_value: ${env_repo_identifier}
type_jsonpath: $.identifier
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_super_login_04
@@ -1,6 +0,0 @@
# -*- coding: utf-8 -*-
# @Time : 2023/11/14 9:56
# @Author : floraachy
# @File : __init__.py
# @Software: PyCharm
# @Desc:
@@ -1,27 +0,0 @@
case_common:
allure_epic: 开源项目
allure_feature: 项目
allure_story: 疑修(Issue
case_markers:
- gitlink
- project
- issue
case_info:
-
id: project_get_issue_journals_detail
title: 项目内获取疑修列表接口
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/{issue_id}/journals?category=comment&page=${page}&limit=${limit}
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${login_cookies}
request_type: json
payload:
files:
assert_response:
status_code: 200
assert_sql:
extract:
@@ -1,27 +0,0 @@
case_common:
allure_epic: 开源项目
allure_feature: 项目
allure_story: 疑修(Issue
case_markers:
- gitlink
- project
- issue
case_info:
-
id: project_get_issue_list
title: 项目内获取疑修列表接口
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues?participant_category=all&category=all&limit=${limit}&page=${page}
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
files:
assert_response:
status_code: 200
assert_sql:
extract:
@@ -1,30 +0,0 @@
case_common:
allure_epic: 开源项目
allure_feature: 项目
allure_story: 疑修(Issue
case_markers:
- gitlink
- project
- issue
case_info:
-
id: project_new_issue_journals
title: 项目内新建疑修评论接口
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/${issue_id}/journals
method: POST
headers:
Content-Type": application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
parent_id: 0
note:
receivers_login: [ ]
files:
assert_response:
status_code: 200
assert_sql:
extract:
@@ -1,31 +0,0 @@
case_common:
allure_epic: 开源项目
allure_feature: 项目
allure_story: 疑修(Issue
case_markers:
- gitlink
- project
- issue
case_info:
-
id: project_new_issue_journals
title: 项目内新建疑修评论回复接口
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/${issue_id}/journals
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
parent_id:
reply_id:
note:
receivers_login: []
files:
assert_response:
status_code: 200
assert_sql:
extract:
@@ -0,0 +1,45 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 疑修(Issue
case_markers:
- gitlink
- repo
- issue
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_batch_delete_issue_01
title: 项目内批量删除多个疑修
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/batch_destroy.json
method: delete
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
ids: ${issue_ids}
files:
assert_response:
status_code: 200
assert_status:
message: 断言接口status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assert_message:
message: 断言接口message=success
expect_value: success
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_issue_01
- gitlink_repo_new_issue_01
- gitlink_repo_get_issue_list_02
@@ -0,0 +1,47 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 疑修(Issue
case_markers:
- gitlink
- repo
- issue
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_batch_edit_issue_01
title: 项目内批量更新一个疑修
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/batch_update.json
method: PATCH
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
ids: ${issue_ids}
status_id: 1
priority_id: ${random.choice([1,2,3,4])}
milestone_id:
issue_tag_ids:
assigner_ids:
files:
assert_response:
status_code: 200
assert_status:
message: 断言接口status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assert_message:
message: 断言接口message=success
expect_value: success
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
setup:
interface: gitlink_repo_get_issue_list_01
@@ -0,0 +1,41 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 疑修(Issue
case_markers:
- gitlink
- repo
- issue
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_delete_issue_01
title: 项目内删除一个疑修
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/${issue_index}.json
method: delete
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
files:
assert_response:
status_code: 200
assert_status:
message: 断言接口status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assert_message:
message: 断言接口message=success
expect_value: success
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
setup:
interface: gitlink_repo_new_issue_01
@@ -0,0 +1,43 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 疑修(Issue
case_markers:
- gitlink
- project
- issue
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_delete_issue_journals_01
title: 项目内删除疑修评论接口
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/${issue_index}/journals/${journal_id}.json
method: delete
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
files:
assert_response:
status_code: 200
assert_status:
message: 断言接口status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assert_message:
message: 断言接口message=success
expect_value: success
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_issue_01
- gitlink_repo_new_issue_journals_01
@@ -0,0 +1,48 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 疑修(Issue
case_markers:
- gitlink
- repo
- issue
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_edit_issue_01
title: 项目内更新一个疑修
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/${issue_index}.json
method: patch
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
subject: Update_${generate_paragraph}
description: ${generate_paragraph}
branch_name: master
status_id: 1
priority_id: ${random.choice([1,2,3,4])}
milestone_id:
issue_tag_ids:
assigner_ids:
attachment_ids:
start_date: ${generate_today_date}
due_date: {generate_time_after_week}
receivers_login: []
files:
assert_response:
status_code: 200
assertId:
message: 断言接口响应数据存在id
assert_type: contains
expect_value: id
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_issue_01
@@ -0,0 +1,40 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 疑修(Issue
case_markers:
- gitlink
- project
- issue
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_edit_issue_journals_01
title: 项目内修改疑修评论接口
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/${issue_index}/journals/${journal_id}.json
method: patch
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
notes: ${generate_words(nb=10)}
attachment_ids: [] # 评论附件ID 可选
receivers_login: []
files:
assert_response:
status_code: 200
assertField:
message: 断言接口存在id
expect_value: id
assert_type: contains
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_issue_01
- gitlink_repo_new_issue_journals_01
@@ -0,0 +1,35 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 疑修(Issue
case_markers:
- gitlink
- repo
- issue
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_issue_assigner_list_01
title: 疑修负责人列表
run: true
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issue_assigners.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: params
payload:
page: 1
limit: 15
files:
assert_response:
status_code: 200
assertField:
message: 断言接口响应数据存在total_count
assert_type: contains
expect_value: total_count
assert_sql:
extract:
case_dependence:
@@ -0,0 +1,35 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 疑修(Issue
case_markers:
- gitlink
- repo
- issue
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_issue_author_list_01
title: 疑修发布人列表
run: true
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issue_authors.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: params
payload:
page: 1
limit: 15
files:
assert_response:
status_code: 200
assertField:
message: 断言接口响应数据存在total_count
assert_type: contains
expect_value: total_count
assert_sql:
extract:
case_dependence:
@@ -1,11 +1,12 @@
case_common:
allure_epic: 开源项目
allure_feature: 项目
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 疑修(Issue
case_markers:
- gitlink
- project
- issue
- usefixtures: gitlink_login
case_info:
-
@@ -13,7 +14,7 @@ case_info:
title: 项目内获取疑修详情接口
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/${issue_id}
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/${issue_index}.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
@@ -23,5 +24,13 @@ case_info:
files:
assert_response:
status_code: 200
assertId:
message: 断言接口返回的project_issues_index
assert_type: ==
expect_value: ${issue_index}
type_jsonpath: $.project_issues_index
assert_sql:
extract:
extract:
case_dependence:
setup:
interface: gitlink_repo_new_issue_01
@@ -0,0 +1,40 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 疑修(Issue
case_markers:
- gitlink
- repo
- issue
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_issue_journal_children_list_01
title: 获取疑修评论的子评论列表
run: true
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/${issue_index}/journals/${journal_id}/children_journals.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: params
payload:
keyword: # 搜索关键词 可选
page: 1
limit: 15
files:
assert_response:
status_code: 200
assertField:
message: 断言接口响应数据存在total_count
assert_type: contains
expect_value: total_count
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_issue_01
- gitlink_repo_new_issue_journals_01
@@ -0,0 +1,42 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 疑修(Issue
case_markers:
- gitlink
- repo
- issue
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_issue_journal_list_01
title: 获取疑修下评论或操作记录列表
run: true
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/${issue_index}/journals.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: params
payload:
category: # 类型,all 所有 comment 评论 operate 操作记录 可选
keyword: # 搜索关键词 可选
sort_by: # 排序字段,created_on 创建时间 updated_on 更新时间 可选
sort_direction: # 排序类型,asc 正序 desc 倒序 可选
page: 1
limit: 15
files:
assert_response:
status_code: 200
assertField:
message: 断言接口响应数据存在total_count
assert_type: contains
expect_value: total_count
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_issue_01
@@ -0,0 +1,83 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 疑修(Issue
case_markers:
- gitlink
- project
- issue
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_issue_list_01
title: 项目内获取疑修列表接口
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: params
payload:
participant_category: all # 参与类型,all 全部 aboutme 关于我的 authoredme 我创建的 assignedme 我负责的 atme @我的
category: all # 疑修类型,all 全部 opened 开启中 closed 已关闭
keyword: #搜索关键词 可选
author_id: # 发布人用户ID 可选
milestone_id: #里程碑ID 可选
assigner_id: # 负责人用户ID 可选
status_id: # 疑修状态ID 可选
sort_by: # 可选 排序字段,issues.updated_on 更新时间 issues.created_on 创建时间 issue_priorities.position 优先级
sort_direction: # 排序类型,asc 正序 desc 倒序 可选
issue_tag_ids: # 标记ID,支持多个用,隔开
page: 1
limit: 15
files:
assert_response:
status_code: 200
assertId:
message: 断言接口响应数据存在total_issues_count
assert_type: contains
expect_value: total_issues_count
assert_sql:
extract:
type_jsonpath:
issue_ids: $.issues[*].id
-
id: gitlink_repo_get_issue_list_02
title: 项目内获取疑修列表接口 - 根据关键字搜索
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: params
payload:
participant_category: all # 参与类型,all 全部 aboutme 关于我的 authoredme 我创建的 assignedme 我负责的 atme @我的
category: all # 疑修类型,all 全部 opened 开启中 closed 已关闭
keyword: New #搜索关键词 可选
author_id: # 发布人用户ID 可选
milestone_id: #里程碑ID 可选
assigner_id: # 负责人用户ID 可选
status_id: # 疑修状态ID 可选
sort_by: # 可选 排序字段,issues.updated_on 更新时间 issues.created_on 创建时间 issue_priorities.position 优先级
sort_direction: # 排序类型,asc 正序 desc 倒序 可选
issue_tag_ids: # 标记ID,支持多个用,隔开
page: 1
limit: 15
files:
assert_response:
status_code: 200
assertId:
message: 断言接口响应数据存在total_issues_count
assert_type: contains
expect_value: total_issues_count
assert_sql:
extract:
type_jsonpath:
issue_ids: $.issues[*].id
@@ -0,0 +1,35 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 疑修(Issue
case_markers:
- gitlink
- repo
- issue
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_issue_priority_list_01
title: 疑修优先级列表
run: true
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issue_priorities.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: params
payload:
page: 1
limit: 15
files:
assert_response:
status_code: 200
assertField:
message: 断言接口响应数据存在total_count
assert_type: contains
expect_value: total_count
assert_sql:
extract:
case_dependence:
@@ -0,0 +1,35 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 疑修(Issue
case_markers:
- gitlink
- repo
- issue
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_issue_status_list_01
title: 疑修状态列表
run: true
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issue_statues.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: params
payload:
page: 1
limit: 15
files:
assert_response:
status_code: 200
assertField:
message: 断言接口响应数据存在total_count
assert_type: contains
expect_value: total_count
assert_sql:
extract:
case_dependence:
@@ -4,26 +4,66 @@ case_common:
allure_story: 疑修(Issue
case_markers:
- gitlink
- project
- repo
- issue
- new_issue
- usefixtures: gitlink_login
- repeat(1)
case_info:
-
id: gitlink_repo_new_issue_001
title: 项目内新建疑修接口
id: gitlink_repo_new_issue_01
title: 项目内新建疑修接口 - 无附件
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
subject: ${generate_company_name(lan='zh', fix='pre')}_${generate_words}
subject: New_${generate_paragraph}
description: ${generate_paragraph}
branch_name: master
status_id: 1
priority_id: ${random.choice([1,2,3,4])}
milestone_id:
issue_tag_ids:
assigner_ids:
attachment_ids:
start_date: ${generate_today_date}
due_date: {generate_time_after_week}
receivers_login: []
files:
assert_response:
status_code: 200
assertId:
message: 断言接口响应数据存在id
assert_type: contains
expect_value: id
assert_sql:
extract:
type_jsonpath:
issue_index: $.project_issues_index
issue_title: $.subject
issue_desc: $.description
issue_files: $.attachments..title
case_dependence:
-
id: gitlink_repo_new_issue_02
title: 项目内新建疑修接口 - 带附件
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
subject: New_${generate_words}
description: ${generate_paragraph}
branch_name: master
status_id: 1
@@ -0,0 +1,106 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 疑修(Issue
case_markers:
- gitlink
- project
- issue
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_new_issue_journals_01
title: 项目内新建疑修评论接口 - 一级评论, 无附件
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/${issue_index}/journals.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
notes: ${generate_words(nb=10)}
attachment_ids: [] # 评论附件ID 可选
receivers_login: []
files:
assert_response:
status_code: 200
assertField:
message: 断言接口存在id
expect_value: id
assert_type: contains
assert_sql:
extract:
type_jsonpath:
journal_id: $.id
case_dependence:
setup:
interface: gitlink_repo_new_issue_01
-
id: gitlink_repo_new_issue_journals_02
title: 项目内新建疑修评论接口 - 一级评论, 有附件
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/${issue_index}/journals.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
notes: ${generate_words(nb=10)}
attachment_ids: # 评论附件ID 可选
- ${attachment_id}
receivers_login: []
files:
assert_response:
status_code: 200
assertField:
message: 断言接口存在id
expect_value: id
assert_type: contains
assert_sql:
extract:
case_dependence:
setup:
interface: gitlink_repo_new_issue_01
-
id: gitlink_repo_new_issue_journals_03
title: 项目内新建疑修评论接口 - notes为空
run: True
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/issues/${issue_index}/journals.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
parent_id: 0 # 父评论ID 可选
reply_id: # 回复评论ID 可选
attachment_ids: # 评论附件ID 可选
- ${attachment_id}
receivers_login: []
files:
assert_response:
status_code: 200
assert_status:
message: 断言接口status=-1
expect_value: -1
assert_type: ==
type_jsonpath: $.status
assert_message:
message: 断言接口message
expect_value: Notes不能为空字符
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
setup:
interface: gitlink_repo_new_issue_01
@@ -0,0 +1,43 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 里程碑
case_markers:
- gitlink
- repo
- milestone
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_delete_milestone_01
title: 删除一个里程碑
run: true
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/milestones/${milestone_id}.json
method: delete
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
files:
assert_response:
status_code: 200
assert_status:
message: 断言接口status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assert_message:
message: 断言接口message=success
expect_value: success
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_milestone_01
- gitlink_repo_get_milestone_list_02
@@ -0,0 +1,46 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 里程碑
case_markers:
- gitlink
- repo
- milestone
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_edit_milestone_01
title: 更新一个里程碑
run: true
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/milestones/${milestone_id}.json
method: patch
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
name: Update - ${generate_words}
description: ${generate_paragraph}
effective_date: {generate_time_after_week}
files:
assert_response:
status_code: 200
assert_status:
message: 断言接口status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assert_message:
message: 断言接口message
expect_value: success
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_milestone_01
- gitlink_repo_get_milestone_list_02
@@ -0,0 +1,83 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 里程碑
case_markers:
- gitlink
- repo
- milestone
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_edit_milestone_status_01
title: 更新一个里程碑的状态 - 关闭里程碑
run: true
severity: normal
url: /api/${env_repo_owner}/${env_repo_identifier}/milestones/${milestone_id}/update_status.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
id: ${milestone_id}
project_id: ${env_repo_identifier}
status: closed
files:
assert_response:
status_code: 200
assert_status:
message: 断言接口status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assert_message:
message: 断言接口message
expect_value: 操作成功
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_milestone_01
- gitlink_repo_get_milestone_list_02
-
id: gitlink_repo_edit_milestone_status_02
title: 更新一个里程碑的状态 - 开启里程碑
run: true
severity: normal
url: /api/${env_repo_owner}/${env_repo_identifier}/milestones/${milestone_id}/update_status.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
id: ${milestone_id}
project_id: ${env_repo_identifier}
status: open
files:
assert_response:
status_code: 200
assert_status:
message: 断言接口status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assert_message:
message: 断言接口message
expect_value: 操作成功
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_milestone_01
- gitlink_repo_get_milestone_list_02
@@ -0,0 +1,73 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 里程碑
case_markers:
- gitlink
- repo
- milestone
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_milestone_list_01
title: 获取里程碑列表
run: true
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/milestones.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: params
payload:
keyword: # 搜索关键词 可选
only_name: # 只返回名称及id 可选
category: # closed 关闭的 opening 开启中 可选
sort_by: # 排序字段 created_on 创建时间 updated_on 更新时间 effective_date 到期日期 issues_count 任务数量 percent 完成度 可选
sort_direction: # 排序顺序 desc 倒序 asc 正序 可选
page: 1
limit: 15
files:
assert_response:
status_code: 200
assertField:
message: 断言接口响返回的closed_milestone_count
assert_type: contains
expect_value: closed_milestone_count
assert_sql:
extract:
case_dependence:
-
id: gitlink_repo_get_milestone_list_02
title: 获取里程碑列表 - 开启状态的里程碑
run: true
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/milestones.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: params
payload:
keyword: # 搜索关键词 可选
only_name: # 只返回名称及id 可选
category: opening # closed 关闭的 opening 开启中 可选
sort_by: # 排序字段 created_on 创建时间 updated_on 更新时间 effective_date 到期日期 issues_count 任务数量 percent 完成度 可选
sort_direction: # 排序顺序 desc 倒序 asc 正序 可选
page: 1
limit: 15
files:
assert_response:
status_code: 200
assertField:
message: 断言接口响返回的closed_milestone_count
assert_type: contains
expect_value: closed_milestone_count
assert_sql:
extract:
type_jsonpath:
milestone_id: $.milestones[0].id
case_dependence:
@@ -0,0 +1,42 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 里程碑
case_markers:
- gitlink
- repo
- milestone
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_new_milestone_01
title: 创建一个里程碑
run: true
severity: normal
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/milestones.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
request_type: json
payload:
name: New - ${generate_words}
description: ${generate_paragraph}
effective_date: {generate_time_after_week}
files:
assert_response:
status_code: 200
assert_status:
message: 断言接口status
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assert_message:
message: 断言接口message
expect_value: success
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
@@ -7,15 +7,26 @@ case_common:
- pr
- gitea
- usefixtures: gitlink_login
- skip: 前提是有一个开启状态的PR,暂时略过
# 前提是仓库存在2个不同的分支
# 步骤说明
# 1、从master分支创建一个新的分支
# 2、修改新分支的README.md文件,确保新分支与master分支存在差异
# 3、从新分支向master分支发起PR
# 4、编辑合并请求
common_dependence:
setup:
env_vars:
repo_file_path: README.md
case_info:
-
id: gitlink_repo_edit_pull_request_001
title: 编辑一个合并请求
title: 更新一个合并请求
severity:
run: True
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/edit/${pr_id}.json
url: /api/${env_repo_owner}/${env_repo_identifier}/pulls/${pull_request_id}.json
method: PUT
headers:
Content-Type: application/json; charset=utf-8;
@@ -23,20 +34,12 @@ case_info:
cookies:
request_type: json
payload:
title: ${generate_words()} # 合并请求标题
title: update PR ${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
issue_tag_ids: [] # 标记ID数组
files:
assert_response:
status_code: 200
@@ -52,3 +55,14 @@ case_info:
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_branch_001 # 创建新分支,同时获取branch name
- gitlink_get_repo_readme_file_02 # 获取新分支readme文件的sha
- gitlink_repo_edit_files_02 # 修改新分支的readme文件的内容
- gitlink_repo_new_pull_request_001 # 新建合并请求
teardown:
interface:
- gitlink_super_login_04
- gitlink_repo_delete_branch_001
@@ -0,0 +1,37 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 合并请求
case_markers:
- gitlink
- pr
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_pull_request_commits_list_01
title: 获取一个合并请求提交列表
severity: normal
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/pulls/${pull_request_id}/commits.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
files:
assert_response:
status_code: 200
assertFiled:
message: 断言接口返回存在commits_count
expect_value: commits_count
assert_type: contains
assert_sql:
extract:
case_dependence:
setup:
interface: gitlink_repo_get_pull_request_list_03
@@ -0,0 +1,43 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 合并请求
case_markers:
- gitlink
- pr
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_pull_request_detail_01
title: 获取合并请求详情
severity: normal
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/pulls/${pull_request_id}.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
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:
case_dependence:
setup:
interface: gitlink_repo_get_pull_request_list_03
@@ -0,0 +1,37 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 合并请求
case_markers:
- gitlink
- pr
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_pull_request_files_list_01
title: 获取一个合并请求变更文件列表
severity: normal
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/pulls/${pull_request_id}/files.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
files:
assert_response:
status_code: 200
assertFiled:
message: 断言接口返回存在files_count
expect_value: files_count
assert_type: contains
assert_sql:
extract:
case_dependence:
setup:
interface: gitlink_repo_get_pull_request_list_03
@@ -0,0 +1,37 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 合并请求
case_markers:
- gitlink
- pr
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_pull_request_journal_list_01
title: 获取合并请求评论列表
severity: normal
run: True
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/pulls/${pull_request_id}/journals.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
files:
assert_response:
status_code: 200
assertFiled:
message: 断言接口返回存在total_count
expect_value: total_count
assert_type: contains
assert_sql:
extract:
case_dependence:
setup:
interface: gitlink_repo_get_pull_request_list_03
@@ -0,0 +1,111 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 合并请求
case_markers:
- gitlink
- pr
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_pull_request_list_01
title: 获取合并请求列表 (全部状态)
severity: normal
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/pulls.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
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:
type_jsonpath:
pull_request_id: $.issues[*].pull_request_id
case_dependence:
-
id: gitlink_repo_get_pull_request_list_02
title: 获取合并请求列表 (开启中状态)
severity: normal
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/pulls.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
status_type: 1
page: 1
limit: 10
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:
type_jsonpath:
pull_request_id: $.issues[*].pull_request_id
case_dependence:
-
id: gitlink_repo_get_pull_request_list_03
title: 获取合并请求列表 (根据关键字搜索)
severity: normal
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/pulls.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
keyword: New Merge
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:
type_jsonpath:
pull_request_id: $.issues[0].pull_request_id
case_dependence:
@@ -0,0 +1,37 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 合并请求
case_markers:
- gitlink
- pr
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_pull_request_reviews_list_01
title: 获取合并请求审查列表
severity: normal
run: True
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/pulls/${pull_request_id}/reviews.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
files:
assert_response:
status_code: 200
assertFiled:
message: 断言接口返回存在total_count
expect_value: total_count
assert_type: contains
assert_sql:
extract:
case_dependence:
setup:
interface: gitlink_repo_get_pull_request_list_03
@@ -0,0 +1,40 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 合并请求
case_markers:
- gitlink
- pr
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_pull_request_versions_diff_01
title: 获取合并请求版本之间的Diff
severity: normal
run: True
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/pulls/${pull_request_id}/versions/${version_id}/diff.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
files:
assert_response:
status_code: 200
assertFiled:
message: 断言接口返回存在file_nums
expect_value: file_nums
assert_type: contains
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_get_pull_request_list_03
- gitlink_repo_get_pull_request_versions_list_01
@@ -0,0 +1,39 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 合并请求
case_markers:
- gitlink
- pr
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_pull_request_versions_list_01
title: 获取合并请求版本列表
severity: normal
run: True
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/pulls/${pull_request_id}/versions.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
files:
assert_response:
status_code: 200
assertFiled:
message: 断言接口返回存在total_count
expect_value: total_count
assert_type: contains
assert_sql:
extract:
type_jsonpath:
version_id: $.versions[0].id
case_dependence:
setup:
interface: gitlink_repo_get_pull_request_list_03
@@ -7,15 +7,25 @@ case_common:
- pr
- gitea
- usefixtures: gitlink_login
- skip: 前提是仓库存在2个不同的分支,暂时略过
# 前提是仓库存在2个不同的分支
# 步骤说明
# 1、从master分支创建一个新的分支
# 2、修改新分支的README.md文件,确保新分支与master分支存在差异
# 3、从新分支向master分支发起PR
common_dependence:
setup:
env_vars:
repo_file_path: README.md
case_info:
-
id: gitlink_repo_new_pull_request_001
title: 创建一个合并请求
title: 创建一个合并请求 从新分支向master分支发起PR
severity:
run: True
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/pulls.json
url: /api/${env_repo_owner}/${env_repo_identifier}/pulls.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
@@ -23,9 +33,9 @@ case_info:
cookies:
request_type: json
payload:
title: ${generate_words()} # 合并请求标题
title: New Merge - ${generate_words()} # 合并请求标题
body: ${generate_paragraph()} # 合并请求内容
head: # 源分支
head: ${branch_name} # 源分支
base: master # 目标分支
is_original: false # 是否为fork仓库发来的合并请求
fork_project_id: # fork仓库ID
@@ -33,7 +43,7 @@ case_info:
files_count: 1
commits_count: 1
receivers_login: [] # @人员的login
issue_tag_ids: master # 标记ID数组
issue_tag_ids: [] # 标记ID数组
assigned_to_id: # 指派人员ID
fixed_version_id: # 里程碑ID
priority_id: # 优先级ID
@@ -52,3 +62,11 @@ case_info:
type_jsonpath: $.message
assert_sql:
extract:
type_jsonpath:
pull_request_id: $.pull_request_id
case_dependence:
setup:
interface:
- gitlink_repo_new_branch_001 # 创建新分支,同时获取branch name
- gitlink_get_repo_readme_file_02 # 获取新分支readme文件的sha
- gitlink_repo_edit_files_02 # 修改新分支的readme文件的内容
@@ -0,0 +1,55 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 合并请求
case_markers:
- gitlink
- pr
- gitea
- usefixtures: gitlink_login
- skip: 参数不明确,后续再补充
case_info:
-
id: gitlink_repo_new_pull_request_journal_01
title: 创建一个合并请求评论
severity:
run: false
url: /api/${env_repo_owner}/${env_repo_identifier}/pulls/${pull_request_id}/journals.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: json
payload:
commit_id: str
diff: Diff
line_code: str
note: str
parent_id: int
path: str
review_id: str
type: str
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:
type_jsonpath:
pull_request_id: $.pull_request_id
case_dependence:
setup:
interface:
- gitlink_repo_get_pull_request_list_03 #
@@ -7,7 +7,19 @@ case_common:
- pr
- gitea
- usefixtures: gitlink_login
- skip: 前提是有一个开启状态的PR,暂时略过
# 前提是仓库存在2个不同的分支
# 步骤说明
# 1、从master分支创建一个新的分支
# 2、修改新分支的README.md文件,确保新分支与master分支存在差异
# 3、从新分支向master分支发起PR
# 4、合并合并请求
common_dependence:
setup:
env_vars:
repo_file_path: README.md
case_info:
-
@@ -15,7 +27,7 @@ case_info:
title: 合并一个合并请求
severity:
run: True
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/edit/${pr_id}/pr_merge.json
url: /api/${env_repo_owner}/${env_repo_identifier}/pulls/${pull_request_id}/pr_merge.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
@@ -23,8 +35,8 @@ case_info:
cookies:
request_type: json
payload:
project_id: ${repo_identifier} # 项目标识
id: ${pr_id} # 合并请求id
project_id: ${env_repo_identifier} # 项目标识
id: ${pull_request_id} # 合并请求id
do: merge
title: ${generate_words()}
body: ${generate_words()}
@@ -32,8 +44,8 @@ case_info:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=0
expect_value: 0
message: 断言接口返回status=1
expect_value: 1
assert_type: ==
type_jsonpath: $.status
assertMessage:
@@ -43,3 +55,14 @@ case_info:
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_branch_001 # 创建新分支,同时获取branch name
- gitlink_get_repo_readme_file_02 # 获取新分支readme文件的sha
- gitlink_repo_edit_files_02 # 修改新分支的readme文件的内容
- gitlink_repo_new_pull_request_001 # 新建合并请求
teardown:
interface:
- gitlink_super_login_04
- gitlink_repo_delete_branch_001
@@ -1,42 +0,0 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 合并请求
case_markers:
- gitlink
- pr
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo__pull_request_001
title: 获取合并请求列表
severity:
run: True
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/pulls.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
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:
@@ -7,7 +7,18 @@ case_common:
- pr
- gitea
- usefixtures: gitlink_login
- skip: 前提是有一个开启状态的PR,暂时略过
# 前提是仓库存在2个不同的分支
# 步骤说明
# 1、从master分支创建一个新的分支
# 2、修改新分支的README.md文件,确保新分支与master分支存在差异
# 3、从新分支向master分支发起PR
# 4、拒绝合并请求
common_dependence:
setup:
env_vars:
repo_file_path: README.md
case_info:
-
@@ -15,7 +26,7 @@ case_info:
title: 拒绝一个合并请求
severity:
run: True
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/edit/${pr_id}/refuse_merge.json
url: /api/${env_repo_owner}/${env_repo_identifier}/pulls/${pull_request_id}/refuse_merge.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
@@ -27,8 +38,8 @@ case_info:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=0
expect_value: 0
message: 断言接口返回status=1
expect_value: 1
assert_type: ==
type_jsonpath: $.status
assertMessage:
@@ -38,3 +49,14 @@ case_info:
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_branch_001 # 创建新分支,同时获取branch name
- gitlink_get_repo_readme_file_02 # 获取新分支readme文件的sha
- gitlink_repo_edit_files_02 # 修改新分支的readme文件的内容
- gitlink_repo_new_pull_request_001 # 新建合并请求
teardown:
interface:
- gitlink_super_login_04
- gitlink_repo_delete_branch_001
@@ -0,0 +1,44 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 发行版
case_markers:
- gitlink
- release
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_delete_release_001
title: 删除发行版
severity: critical
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/releases/${release_id}.json
method: DELETE
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
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:
case_dependence:
setup:
interface:
- gitlink_repo_new_release_001
- gitlink_repo_get_release_list_001
@@ -0,0 +1,55 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 发行版
case_markers:
- gitlink
- release
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_edit_release_001
title: 编辑发行版
severity: critical
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/releases/${release_id}.json
method: PUT
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: json
payload:
tag_name: ${generate_identifier()} # 标签
name: ${generate_words()} # 发行版标题
body: ${generate_words()} # 发行版描述
target_commitish: master # 分支
prerelease: false # 是否为预发布版
attachment_ids: # 附件ID数组
- ${attachment_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:
case_dependence:
setup:
interface:
- gitlink_repo_new_release_001
- gitlink_repo_get_release_list_001
- gitlink_upload_file_01
teardown:
interface:
- gitlink_repo_delete_release_001
@@ -0,0 +1,42 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 发行版
case_markers:
- gitlink
- release
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_release_detail_001
title: 获取发行版详情
severity: normal
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/releases/${release_id}.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: json
payload:
files:
assert_response:
status_code: 200
assertMessage:
message: 断言接口返回version_id
expect_value: ${release_id}
assert_type: ==
type_jsonpath: $.version_id
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_release_001
- gitlink_repo_get_release_list_001
teardown:
interface:
- gitlink_repo_delete_release_001
@@ -0,0 +1,41 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 发行版
case_markers:
- gitlink
- release
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_release_list_001
title: 获取发行版列表
severity: normal
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/releases.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
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:
type_jsonpath:
release_id: $.releases[0].version_id
@@ -7,13 +7,12 @@ case_common:
- release
- gitea
- usefixtures: gitlink_login
- skip: 需要项目成员才能操作,暂时略过
case_info:
-
id: gitlink_repo_new_release_001
title: 创建发行版
severity:
severity: critial
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/releases.json
method: POST
@@ -45,3 +44,8 @@ case_info:
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
teardown:
interface:
- gitlink_repo_get_release_list_001
- gitlink_repo_delete_release_001
@@ -0,0 +1,68 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 代码库
case_markers:
- gitlink
- project_detail
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_get_repo_readme_file_01
title: 获取项目README文件 - master分支
severity: normal
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/readme.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
files:
assert_response:
status_code: 200
assertName:
message: 断言接口name
assert_type: ==
expect_value: README.md
type_jsonpath: $.name
assert_sql:
extract:
type_jsonpath:
repo_file_sha: $.sha
-
id: gitlink_get_repo_readme_file_02
title: 获取项目README文件 - 指定分支
severity: normal
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/readme.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
ref: ${branch_name}
files:
assert_response:
status_code: 200
assertName:
message: 断言接口name
assert_type: ==
expect_value: README.md
type_jsonpath: $.name
assert_sql:
extract:
type_jsonpath:
repo_file_sha: $.sha
case_dependence:
setup:
interface:
- gitlink_get_repo_branches_by_keyword_01
@@ -0,0 +1,94 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 代码库
case_markers:
- gitlink
- create_files
- gitea
- usefixtures: gitlink_login
common_dependence:
setup:
env_vars:
repo_file_path: README.md
case_info:
-
id: gitlink_repo_edit_files_01
title: 修改master分支文件 - README.md
severity: critical
run: true
url: /api/${env_repo_owner}/${env_repo_identifier}/update_file.json
method: PUT
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: json
payload:
filepath: ${repo_file_path}
base64_filepath: ${get_base64_content('${repo_file_path}')} # 文件路径(base64加密后)
content: ${generate_paragraph(nb=10)} # 文件内容(Base64加密后)
message: auto update - ${repo_file_path} # commit信息
branch: master
sha: ${repo_file_sha}
files:
assert_response:
status_code: 200
assertMessage:
message: 断言message
assert_type: ==
expect_value: 更新成功
type_jsonpath: $.message
assertStatus:
message: 断言status
assert_type: ==
expect_value: 1
type_jsonpath: $.status
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_get_repo_readme_file_01
-
id: gitlink_repo_edit_files_02
title: 修改指定分支文件 - README.md
severity: critical
run: true
url: /api/${env_repo_owner}/${env_repo_identifier}/update_file.json
method: PUT
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: json
payload:
filepath: ${repo_file_path}
base64_filepath: ${get_base64_content('${repo_file_path}')} # 文件路径(base64加密后)
content: ${generate_paragraph(nb=10)} # 文件内容(Base64加密后)
message: auto update - ${repo_file_path} # commit信息
branch: ${branch_name}
sha: ${repo_file_sha}
files:
assert_response:
status_code: 200
assertMessage:
message: 断言message
assert_type: ==
expect_value: 更新成功
type_jsonpath: $.message
assertStatus:
message: 断言status
assert_type: ==
expect_value: 1
type_jsonpath: $.status
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_get_repo_branches_by_keyword_01
- gitlink_get_repo_readme_file_02
@@ -0,0 +1,49 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 标签
case_markers:
- gitlink
- tags
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_delete_tag_001
title: 删除标签
severity: normal
run: True
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/tags/${tag_name}.json
method: DELETE
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
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
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_release_001
- gitlink_repo_get_tags_list_001
teardown:
interface:
- gitlink_repo_get_release_list_001
- gitlink_repo_delete_release_001
@@ -0,0 +1,44 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 标签
case_markers:
- gitlink
- tags
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_tags_detail_001
title: 获取项目标签详情
severity: normal
run: True
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/tags/${tag_name}.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
files:
assert_response:
status_code: 200
assertName:
message: 断言接口返回name
expect_value: ${tag_name}
assert_type: ==
type_jsonpath: $.name
assert_sql:
extract:
case_dependence:
setup:
interface:
- gitlink_repo_new_release_001
- gitlink_repo_get_tags_list_001
teardown:
interface:
- gitlink_repo_get_release_list_001
- gitlink_repo_delete_release_001
@@ -0,0 +1,60 @@
case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 标签
case_markers:
- gitlink
- tags
- gitea
- usefixtures: gitlink_login
case_info:
-
id: gitlink_repo_get_tags_list_001
title: 获取项目标签列表
severity: normal
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/tags.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
page: 1
limit: 10
files:
assert_response:
status_code: 200
assertMessage:
message: 断言接口返回total_count
expect_value: total_count
assert_type: contains
assert_sql:
extract:
type_jsonpath:
tag_name: $.tags[0].name
-
id: gitlink_repo_get_tags_list_all_002
title: 获取项目标签列表(无分页)
severity: normal
run: True
url: /api/${env_repo_owner}/${env_repo_identifier}/tags.json
method: GET
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
files:
assert_response:
status_code: 200
assertMessage:
message: 断言接口返回total_count
expect_value: total_count
assert_type: contains
assert_sql:
extract: