新增部分测试用例
This commit is contained in:
@@ -6,14 +6,13 @@ case_common:
|
||||
- gitlink
|
||||
- repo
|
||||
- about
|
||||
- usefixtures: gitlink_login
|
||||
|
||||
# 目前非仓库管理员操作会报403, 待后续需求确认后更改
|
||||
# 仅仓库管理员才能编辑项目主页
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_repo_get_about_detail_01
|
||||
title: 编辑项目主页内容
|
||||
title: 仓库管理员编辑项目主页内容
|
||||
run: true
|
||||
severity: normal
|
||||
url: /api/${env_repo_owner}/${env_repo_identifier}/about.json
|
||||
@@ -34,4 +33,38 @@ case_info:
|
||||
type_jsonpath: $.identifier
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface: gitlink_super_login_04
|
||||
|
||||
-
|
||||
id: gitlink_repo_get_about_detail_02
|
||||
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
|
||||
assertStatus:
|
||||
message: 断言接口返回status
|
||||
expect_value: 403
|
||||
assert_type: ==
|
||||
type_jsonpath: $.status
|
||||
assertPraised:
|
||||
message: 断言接口返回message
|
||||
expect_value: 你没有权限操作.
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface: gitlink_login_01
|
||||
@@ -0,0 +1,81 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: 成员管理
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- collaborator
|
||||
- usefixtures: gitlink_login
|
||||
|
||||
|
||||
# 仅仓库管理员及以上角色才有权限
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_add_repo_collaborator_01
|
||||
title: 仓库管理员添加一个项目成员,添加成功
|
||||
severity: critical
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/collaborators.json
|
||||
method: POST
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
user_id: ${t_user_id}
|
||||
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_projects_new_project_02
|
||||
teardown:
|
||||
# 删除仓库
|
||||
interface: gitlink_projects_delete_project_01
|
||||
|
||||
-
|
||||
id: gitlink_add_repo_collaborator_02
|
||||
title: 非仓库管理员添加一个项目成员,添加失败
|
||||
severity: critical
|
||||
run: True
|
||||
url: /api/${env_repo_owner}/${env_repo_identifier}/collaborators.json
|
||||
method: POST
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
user_id: ${t_user_id}
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assert_status:
|
||||
message: 断言接口status=403
|
||||
expect_value: 403
|
||||
assert_type: ==
|
||||
type_jsonpath: $.status
|
||||
assert_message:
|
||||
message: 断言接口message=你不是管理员,没有权限操作
|
||||
expect_value: 你不是管理员,没有权限操作
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
@@ -0,0 +1,126 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: 成员管理
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- collaborator
|
||||
- usefixtures: gitlink_login
|
||||
|
||||
# 仅仓库管理员及以上角色才有权限
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_change_repo_collaborator_role_01
|
||||
title: 仓库管理员更改项目成员权限 - 修改为报告者,修改成功
|
||||
severity: critical
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/collaborators/change_role.json
|
||||
method: PUT
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
user_id: ${t_user_id}
|
||||
role: Reporter # 必填,枚举值:Manager Developer Reporter
|
||||
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_projects_new_project_02
|
||||
- gitlink_add_repo_collaborator_01
|
||||
teardown:
|
||||
interface:
|
||||
- gitlink_delete_repo_collaborator_01
|
||||
- gitlink_projects_delete_project_01
|
||||
|
||||
|
||||
-
|
||||
id: gitlink_change_repo_collaborator_role_02
|
||||
title: 仓库管理员更改项目成员权限 - 修改为管理员,修改成功
|
||||
severity: critical
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/collaborators/change_role.json
|
||||
method: PUT
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
user_id: ${t_user_id}
|
||||
role: Manager # 必填,枚举值:Manager Developer Reporter
|
||||
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_projects_new_project_02
|
||||
- gitlink_add_repo_collaborator_01
|
||||
teardown:
|
||||
interface:
|
||||
- gitlink_delete_repo_collaborator_01
|
||||
- gitlink_projects_delete_project_01
|
||||
|
||||
|
||||
-
|
||||
id: gitlink_change_repo_collaborator_role_03
|
||||
title: 非仓库管理员更改项目成员权限 - 修改为管理员,修改失败
|
||||
severity: critical
|
||||
run: True
|
||||
url: /api/${env_repo_owner}/${env_repo_identifier}/collaborators/change_role.json
|
||||
method: PUT
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
user_id: ${t_user_id}
|
||||
role: Manager # 必填,枚举值:Manager Developer Reporter
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assert_status:
|
||||
message: 断言接口status=403
|
||||
expect_value: 403
|
||||
assert_type: ==
|
||||
type_jsonpath: $.status
|
||||
assert_message:
|
||||
message: 断言接口message=你不是管理员,没有权限操作
|
||||
expect_value: 你不是管理员,没有权限操作
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
@@ -0,0 +1,82 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: 成员管理
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- collaborator
|
||||
- usefixtures: gitlink_login
|
||||
|
||||
# 仅仓库管理员及以上角色才有权限
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_delete_repo_collaborator_01
|
||||
title: 仓库管理员删除一个项目成员,删除成功
|
||||
severity: critical
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/collaborators/remove.json
|
||||
method: DELETE
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
user_id: ${t_user_id}
|
||||
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_projects_new_project_02
|
||||
- gitlink_add_repo_collaborator_01
|
||||
teardown:
|
||||
# 删除仓库
|
||||
interface: gitlink_projects_delete_project_01
|
||||
|
||||
-
|
||||
id: gitlink_delete_repo_collaborator_02
|
||||
title: 非仓库管理员删除一个项目成员,删除失败
|
||||
severity: critical
|
||||
run: True
|
||||
url: /api/${env_repo_owner}/${env_repo_identifier}/collaborators/remove.json
|
||||
method: DELETE
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
user_id: ${t_user_id}
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assert_status:
|
||||
message: 断言接口status=403
|
||||
expect_value: 403
|
||||
assert_type: ==
|
||||
type_jsonpath: $.status
|
||||
assert_message:
|
||||
message: 断言接口message=你不是管理员,没有权限操作
|
||||
expect_value: 你不是管理员,没有权限操作
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
@@ -0,0 +1,72 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: 成员管理
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- collaborator
|
||||
- usefixtures: gitlink_login
|
||||
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_get_repo_collaborator_list_01
|
||||
title: 仓库管理员获取项目成员列表,获取成功
|
||||
severity: critical
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/collaborators.json
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
page: 1
|
||||
limit: 15
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertField:
|
||||
message: 断言接口存在参数total_count
|
||||
expect_value: total_count
|
||||
assert_type: contains
|
||||
assert_sql:
|
||||
extract:
|
||||
type_jsonpath:
|
||||
repo_user_ids: $.members[*].id
|
||||
case_dependence:
|
||||
|
||||
|
||||
-
|
||||
id: gitlink_get_repo_collaborator_list_02
|
||||
title: 非仓库管理员获取项目成员列表,获取失败
|
||||
severity: critical
|
||||
run: True
|
||||
url: /api/${env_repo_owner}/${env_repo_identifier}/collaborators.json
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
page: 1
|
||||
limit: 15
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assert_status:
|
||||
message: 断言接口status=403
|
||||
expect_value: 403
|
||||
assert_type: ==
|
||||
type_jsonpath: $.status
|
||||
assert_message:
|
||||
message: 断言接口message=你不是管理员,没有权限操作
|
||||
expect_value: 你不是管理员,没有权限操作
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
@@ -0,0 +1,37 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: 成员管理
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- usefixtures: gitlink_login
|
||||
|
||||
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_get_user_list_01
|
||||
title: 获取平台用户列表
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/users/list.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: 断言接口返回包括字段total_count
|
||||
expect_value: total_count
|
||||
assert_type: contains
|
||||
assert_sql:
|
||||
extract:
|
||||
type_jsonpath:
|
||||
sys_user_ids: $.users[*].user_id
|
||||
case_dependence:
|
||||
@@ -44,4 +44,7 @@ case_info:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface: gitlink_repo_get_issue_list_01
|
||||
interface:
|
||||
- gitlink_repo_new_issue_01
|
||||
- gitlink_repo_new_issue_01
|
||||
- gitlink_repo_get_issue_list_01
|
||||
@@ -30,7 +30,6 @@ case_info:
|
||||
message: 断言接口返回存在file_nums
|
||||
expect_value: file_nums
|
||||
assert_type: contains
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
|
||||
@@ -31,3 +31,7 @@ case_info:
|
||||
expect_value: default_branch
|
||||
assert_sql:
|
||||
extract:
|
||||
type_jsonpath:
|
||||
repo_project_name: $.name
|
||||
repo_private: $.private
|
||||
|
||||
|
||||
@@ -31,3 +31,5 @@ case_info:
|
||||
expect_value: identifier
|
||||
assert_sql:
|
||||
extract:
|
||||
type_jsonpath:
|
||||
repo_project_name: $.name
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: 仓库设置
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- usefixtures: gitlink_login
|
||||
|
||||
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_get_repo_category_01
|
||||
title: 获取项目类别
|
||||
severity: critical
|
||||
run: True
|
||||
url: /api/project_categories.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: 断言接口返回包括字段project_categories
|
||||
expect_value: project_categories
|
||||
assert_type: contains
|
||||
assert_sql:
|
||||
extract:
|
||||
type_jsonpath:
|
||||
repo_project_category_ids: $.project_categories[*].id
|
||||
case_dependence:
|
||||
@@ -0,0 +1,37 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: 仓库设置
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- usefixtures: gitlink_login
|
||||
|
||||
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_get_repo_language_01
|
||||
title: 获取项目语言
|
||||
severity: critical
|
||||
run: True
|
||||
url: /api/project_languages.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: 断言接口返回包括字段project_languages
|
||||
expect_value: project_languages
|
||||
assert_type: contains
|
||||
assert_sql:
|
||||
extract:
|
||||
type_jsonpath:
|
||||
repo_project_language_ids: $.project_languages[*].id
|
||||
case_dependence:
|
||||
@@ -0,0 +1,47 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: 仓库设置
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- usefixtures: gitlink_login
|
||||
|
||||
# 仅仓库管理员及以上角色才有权限
|
||||
common_dependence:
|
||||
setup:
|
||||
# 新建私有仓库
|
||||
interface: gitlink_projects_new_project_02
|
||||
teardown:
|
||||
interface: gitlink_projects_delete_project_01
|
||||
|
||||
case_info:
|
||||
- id: gitlink_get_repo_setting_01
|
||||
title: 获取仓库基本设置
|
||||
severity: critical
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/edit.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: 断言接口返回包括字段project_identifier
|
||||
expect_value: project_identifier
|
||||
assert_type: contains
|
||||
assert_sql:
|
||||
extract:
|
||||
type_jsonpath:
|
||||
repo_project_name: $.project_name
|
||||
repo_project_identifier: $.project_identifier
|
||||
repo_project_private: $.private
|
||||
repo_project_description: $.project_description
|
||||
repo_project_language_id: $.project_language_id
|
||||
repo_project_category_id: $.project_category_id
|
||||
case_dependence:
|
||||
@@ -0,0 +1,202 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: 仓库设置
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- usefixtures: gitlink_login
|
||||
|
||||
# 仅仓库管理员及以上角色才有权限
|
||||
common_dependence:
|
||||
setup:
|
||||
# 新建私有仓库
|
||||
interface: gitlink_projects_new_project_02
|
||||
teardown:
|
||||
interface: gitlink_projects_delete_project_01
|
||||
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_update_repo_setting_01
|
||||
title: 更新仓库基本设置 - 更新项目名称
|
||||
severity: critical
|
||||
run: true
|
||||
url: /api/${repo_owner}/${repo_identifier}.json
|
||||
method: PATCH
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
name: update-name-${generate_words} # 项目名称
|
||||
identifier: ${repo_project_identifier} # 项目标识
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertIdentifier:
|
||||
message: 断言接口返回的identifier
|
||||
expect_value: ${repo_project_identifier}
|
||||
assert_type: ==
|
||||
type_jsonpath: $.identifier
|
||||
assertPrivate:
|
||||
message: 断言接口返回的is_public
|
||||
expect_value: False
|
||||
assert_type: ==
|
||||
type_jsonpath: $.is_public
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface:
|
||||
- gitlink_get_repo_setting_01
|
||||
|
||||
-
|
||||
id: gitlink_update_repo_setting_02
|
||||
title: 更新仓库基本设置 - 更新项目标识
|
||||
severity: critical
|
||||
run: true
|
||||
url: /api/${repo_owner}/${repo_identifier}.json
|
||||
method: PATCH
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
name: ${repo_project_name} # 项目名称
|
||||
identifier: update_${generate_identifier()}_${generate_identifier()} # 项目标识
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertName:
|
||||
message: 断言接口返回的name
|
||||
expect_value: ${repo_project_name}
|
||||
assert_type: ==
|
||||
type_jsonpath: $.name
|
||||
assertPrivate:
|
||||
message: 断言接口返回的is_public
|
||||
expect_value: False
|
||||
assert_type: ==
|
||||
type_jsonpath: $.is_public
|
||||
assert_sql:
|
||||
extract:
|
||||
type_jsonpath:
|
||||
repo_identifier: $.identifier
|
||||
case_dependence:
|
||||
setup:
|
||||
interface:
|
||||
- gitlink_get_repo_setting_01
|
||||
|
||||
-
|
||||
id: gitlink_update_repo_setting_03
|
||||
title: 更新仓库基本设置 - 更新项目类别
|
||||
severity: critical
|
||||
run: true
|
||||
url: /api/${repo_owner}/${repo_identifier}.json
|
||||
method: PATCH
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
name: ${repo_project_name} # 项目名称
|
||||
project_category_id: ${random.choice(${repo_project_category_ids})} # 项目类别ID
|
||||
identifier: ${repo_project_identifier} # 项目标识
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertIdentifier:
|
||||
message: 断言接口返回的identifier
|
||||
expect_value: ${repo_project_identifier}
|
||||
assert_type: ==
|
||||
type_jsonpath: $.identifier
|
||||
assertPrivate:
|
||||
message: 断言接口返回的is_public
|
||||
expect_value: False
|
||||
assert_type: ==
|
||||
type_jsonpath: $.is_public
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface:
|
||||
- gitlink_get_repo_category_01
|
||||
- gitlink_get_repo_setting_01
|
||||
|
||||
-
|
||||
id: gitlink_update_repo_setting_04
|
||||
title: 更新仓库基本设置 - 更新项目语言
|
||||
severity: critical
|
||||
run: true
|
||||
url: /api/${repo_owner}/${repo_identifier}.json
|
||||
method: PATCH
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
name: ${repo_project_name} # 项目名称
|
||||
project_language_id: ${random.choice(${repo_project_language_ids})} # 项目语言ID
|
||||
identifier: ${repo_project_identifier} # 项目标识
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertIdentifier:
|
||||
message: 断言接口返回的identifier
|
||||
expect_value: ${repo_project_identifier}
|
||||
assert_type: ==
|
||||
type_jsonpath: $.identifier
|
||||
assertPrivate:
|
||||
message: 断言接口返回的is_public
|
||||
expect_value: False
|
||||
assert_type: ==
|
||||
type_jsonpath: $.is_public
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface:
|
||||
- gitlink_get_repo_language_01
|
||||
- gitlink_get_repo_setting_01
|
||||
|
||||
|
||||
-
|
||||
id: gitlink_update_repo_setting_05
|
||||
title: 更新仓库基本设置 - 更新仓库公私有性, 私有仓库更新为公开
|
||||
severity: critical
|
||||
run: true
|
||||
url: /api/${repo_owner}/${repo_identifier}.json
|
||||
method: PATCH
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
name: ${repo_project_name} # 项目名称
|
||||
private: False # 项目是否为私有项目
|
||||
identifier: ${repo_project_identifier} # 项目标识
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回的identifier
|
||||
expect_value: ${repo_project_identifier}
|
||||
assert_type: ==
|
||||
type_jsonpath: $.identifier
|
||||
assertPrivate:
|
||||
message: 断言接口返回的is_public
|
||||
expect_value: True
|
||||
assert_type: ==
|
||||
type_jsonpath: $.is_public
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface:
|
||||
- gitlink_get_repo_setting_01
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: 仓库设置
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- usefixtures: gitlink_login
|
||||
|
||||
# 仅仓库管理员及以上角色才有权限
|
||||
common_dependence:
|
||||
setup:
|
||||
# 新建公开仓库
|
||||
interface: gitlink_projects_new_project_01
|
||||
teardown:
|
||||
interface: gitlink_projects_delete_project_01
|
||||
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_update_repo_setting_01
|
||||
title: 更新仓库基本设置 - 更新项目名称
|
||||
severity: critical
|
||||
run: true
|
||||
url: /api/${repo_owner}/${repo_identifier}.json
|
||||
method: PATCH
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
name: update-name-${generate_words} # 项目名称
|
||||
identifier: ${repo_project_identifier} # 项目标识
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertIdentifier:
|
||||
message: 断言接口返回的identifier
|
||||
expect_value: ${repo_project_identifier}
|
||||
assert_type: ==
|
||||
type_jsonpath: $.identifier
|
||||
assertPrivate:
|
||||
message: 断言接口返回的is_public
|
||||
expect_value: True
|
||||
assert_type: ==
|
||||
type_jsonpath: $.is_public
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface:
|
||||
- gitlink_get_repo_setting_01
|
||||
|
||||
-
|
||||
id: gitlink_update_repo_setting_02
|
||||
title: 更新仓库基本设置 - 更新项目标识
|
||||
severity: critical
|
||||
run: true
|
||||
url: /api/${repo_owner}/${repo_identifier}.json
|
||||
method: PATCH
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
name: ${repo_project_name} # 项目名称
|
||||
identifier: update_${generate_identifier()}_${generate_identifier()} # 项目标识
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertName:
|
||||
message: 断言接口返回的name
|
||||
expect_value: ${repo_project_name}
|
||||
assert_type: ==
|
||||
type_jsonpath: $.name
|
||||
assertPrivate:
|
||||
message: 断言接口返回的is_public
|
||||
expect_value: True
|
||||
assert_type: ==
|
||||
type_jsonpath: $.is_public
|
||||
assert_sql:
|
||||
extract:
|
||||
type_jsonpath:
|
||||
repo_identifier: $.identifier
|
||||
case_dependence:
|
||||
setup:
|
||||
interface:
|
||||
- gitlink_get_repo_setting_01
|
||||
|
||||
-
|
||||
id: gitlink_update_repo_setting_03
|
||||
title: 更新仓库基本设置 - 更新项目类别
|
||||
severity: critical
|
||||
run: true
|
||||
url: /api/${repo_owner}/${repo_identifier}.json
|
||||
method: PATCH
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
name: ${repo_project_name} # 项目名称
|
||||
project_category_id: ${random.choice(${repo_project_category_ids})} # 项目类别ID
|
||||
identifier: ${repo_project_identifier} # 项目标识
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertIdentifier:
|
||||
message: 断言接口返回的identifier
|
||||
expect_value: ${repo_project_identifier}
|
||||
assert_type: ==
|
||||
type_jsonpath: $.identifier
|
||||
assertPrivate:
|
||||
message: 断言接口返回的is_public
|
||||
expect_value: True
|
||||
assert_type: ==
|
||||
type_jsonpath: $.is_public
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface:
|
||||
- gitlink_get_repo_category_01
|
||||
- gitlink_get_repo_setting_01
|
||||
|
||||
-
|
||||
id: gitlink_update_repo_setting_04
|
||||
title: 更新仓库基本设置 - 更新项目语言
|
||||
severity: critical
|
||||
run: true
|
||||
url: /api/${repo_owner}/${repo_identifier}.json
|
||||
method: PATCH
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
name: ${repo_project_name} # 项目名称
|
||||
project_language_id: ${random.choice(${repo_project_language_ids})} # 项目语言ID
|
||||
identifier: ${repo_project_identifier} # 项目标识
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertIdentifier:
|
||||
message: 断言接口返回的identifier
|
||||
expect_value: ${repo_project_identifier}
|
||||
assert_type: ==
|
||||
type_jsonpath: $.identifier
|
||||
assertPrivate:
|
||||
message: 断言接口返回的is_public
|
||||
expect_value: True
|
||||
assert_type: ==
|
||||
type_jsonpath: $.is_public
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface:
|
||||
- gitlink_get_repo_language_01
|
||||
- gitlink_get_repo_setting_01
|
||||
|
||||
-
|
||||
id: gitlink_update_repo_setting_05
|
||||
title: 更新仓库基本设置 - 更新仓库公私有性, 公开仓库更新为私有
|
||||
severity: critical
|
||||
run: true
|
||||
url: /api/${repo_owner}/${repo_identifier}.json
|
||||
method: PATCH
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
name: ${repo_project_name} # 项目名称
|
||||
private: True # 项目是否为私有项目
|
||||
identifier: ${repo_project_identifier} # 项目标识
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertIdentifier:
|
||||
message: 断言接口返回的identifier
|
||||
expect_value: ${repo_project_identifier}
|
||||
assert_type: ==
|
||||
type_jsonpath: $.identifier
|
||||
assertPrivate:
|
||||
message: 断言接口返回的is_public
|
||||
expect_value: False
|
||||
assert_type: ==
|
||||
type_jsonpath: $.is_public
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface:
|
||||
- gitlink_get_repo_setting_01
|
||||
@@ -8,10 +8,13 @@ case_common:
|
||||
- gitea
|
||||
- usefixtures: gitlink_login
|
||||
|
||||
|
||||
# 通过发行版新建标签,删除标签之前需要先删除发行版
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_repo_delete_tag_001
|
||||
title: 删除标签
|
||||
title: 删除标签 - 当前标签无关联发行版,删除成功
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/v1/${env_repo_owner}/${env_repo_identifier}/tags/${tag_name}.json
|
||||
@@ -37,6 +40,42 @@ case_info:
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface:
|
||||
- gitlink_repo_new_release_001
|
||||
- gitlink_repo_get_tags_list_001
|
||||
- gitlink_repo_get_release_list_001
|
||||
- gitlink_repo_delete_release_001
|
||||
|
||||
-
|
||||
id: gitlink_repo_delete_tag_002
|
||||
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=-1
|
||||
expect_value: -1
|
||||
assert_type: ==
|
||||
type_jsonpath: $.status
|
||||
assertMessage:
|
||||
message: 断言接口返回message
|
||||
expect_value: 请先删除发行版!
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface:
|
||||
|
||||
@@ -52,7 +52,42 @@ case_info:
|
||||
|
||||
-
|
||||
id: gitlink_projects_new_project_02
|
||||
title: 正确输入所有参数,新建私有项目成功
|
||||
title: 正确输入各项必填参数,新建私有项目成功
|
||||
run: true
|
||||
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: test_${generate_identifier()}_${generate_identifier()}
|
||||
repository_name: ${generate_identifier()}_test
|
||||
private: true
|
||||
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
|
||||
case_dependence:
|
||||
teardown:
|
||||
interface:
|
||||
- gitlink_projects_delete_project_01
|
||||
|
||||
-
|
||||
id: gitlink_projects_new_project_03
|
||||
title: 输入所有参数,新建项目成功
|
||||
run: false
|
||||
url: /api/projects.json
|
||||
method: POST
|
||||
@@ -101,9 +136,8 @@ case_info:
|
||||
teardown:
|
||||
interface:
|
||||
- gitlink_projects_delete_project_01
|
||||
|
||||
-
|
||||
id: gitlink_projects_new_project_03
|
||||
id: gitlink_projects_new_project_04
|
||||
title: 正确输入各项必填参数,新建项目成功(校验数据库)
|
||||
severity: normal
|
||||
run: false
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: Webhook
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- webhook
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时还未完成
|
||||
|
||||
# 仅仓库管理员及以上角色才有权限
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_get_repo_add_webhook_01
|
||||
title: 仓库管理员创建Webhook,创建成功
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/webhooks.json
|
||||
method: POST
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
type: # 选填,类型, 默认值gitea, 枚举值:gitea slack discord dingtalk telegram msteams feishu matrix jianmu softbot
|
||||
active: # 必填,是否开启, 布尔值
|
||||
content_type: # 必填,内容类型, 枚举值:json form
|
||||
http_method: # 必填,请求方式,枚举值:GET POST
|
||||
secret: # 选填,密钥
|
||||
url: # 必填,请求地址
|
||||
branch_filter: # 必填,分支白名单 推送、创建,删除分支事件的分支白名单,使用 glob 模式匹配指定。若为空或 ,则将报告所有分支的事件。
|
||||
events: # 必填,事件,枚举值:push create delete issues_only issue_assign issue_label issue_comment pull_request_only pull_request_assign pull_request_comment
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回包括字段total_count
|
||||
expect_value: total_count
|
||||
assert_type: contains
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
# 新建私有仓库
|
||||
interface: gitlink_projects_new_project_02
|
||||
# teardown:
|
||||
# # 删除仓库
|
||||
# interface: gitlink_projects_delete_project_01
|
||||
|
||||
-
|
||||
id: gitlink_get_repo_add_webhook_02
|
||||
title: 非仓库管理员创建Webhook,创建成功
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/${env_repo_owner}/${env_repo_identifier}/webhooks.json
|
||||
method: POST
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
type: # 选填,类型, 默认值gitea, 枚举值:gitea slack discord dingtalk telegram msteams feishu matrix jianmu softbot
|
||||
active: # 必填,是否开启, 布尔值
|
||||
content_type: # 必填,内容类型, 枚举值:json form
|
||||
http_method: # 必填,请求方式,枚举值:GET POST
|
||||
secret: # 选填,密钥
|
||||
url: # 必填,请求地址
|
||||
branch_filter: # 必填,分支白名单 推送、创建,删除分支事件的分支白名单,使用 glob 模式匹配指定。若为空或 ,则将报告所有分支的事件。
|
||||
events: # 必填,事件,枚举值:push create delete issues_only issue_assign issue_label issue_comment pull_request_only pull_request_assign pull_request_comment
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assert_status:
|
||||
message: 断言接口status=403
|
||||
expect_value: 403
|
||||
assert_type: ==
|
||||
type_jsonpath: $.status
|
||||
assert_message:
|
||||
message: 断言接口message=你不是管理员,没有权限操作
|
||||
expect_value: 你不是管理员,没有权限操作
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
@@ -0,0 +1,79 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: Webhook
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- webhook
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时还未完成
|
||||
|
||||
# 仅仓库管理员及以上角色才有权限
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_get_repo_delete_webhook_01
|
||||
title: 仓库管理员删除Webhook,删除成功
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/webhooks/${webhook_id}.json
|
||||
method: DELETE
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: params
|
||||
payload:
|
||||
owner:
|
||||
repo:
|
||||
id:
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回包括字段total_count
|
||||
expect_value: total_count
|
||||
assert_type: contains
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
# 新建私有仓库
|
||||
interface: gitlink_projects_new_project_02
|
||||
# teardown:
|
||||
# # 删除仓库
|
||||
# interface: gitlink_projects_delete_project_01
|
||||
|
||||
-
|
||||
id: gitlink_get_repo_delete_webhook_02
|
||||
title: 非仓库管理员删除Webhook,删除失败
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/webhooks/${webhook_id}.json
|
||||
method: DELETE
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: params
|
||||
payload:
|
||||
owner:
|
||||
repo:
|
||||
id:
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assert_status:
|
||||
message: 断言接口status=403
|
||||
expect_value: 403
|
||||
assert_type: ==
|
||||
type_jsonpath: $.status
|
||||
assert_message:
|
||||
message: 断言接口message=你不是管理员,没有权限操作
|
||||
expect_value: 你不是管理员,没有权限操作
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
@@ -0,0 +1,88 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: Webhook
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- webhook
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时还未完成
|
||||
# 仅仓库管理员及以上角色才有权限
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_get_repo_update_webhook_01
|
||||
title: 仓库管理员更新Webhook,更新成功
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/webhooks/${webhook_id}.json
|
||||
method: PUT
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
type: # 选填,类型, 默认值gitea, 枚举值:gitea slack discord dingtalk telegram msteams feishu matrix jianmu softbot
|
||||
active: # 必填,是否开启, 布尔值
|
||||
content_type: # 必填,内容类型, 枚举值:json form
|
||||
http_method: # 必填,请求方式,枚举值:GET POST
|
||||
secret: # 选填,密钥
|
||||
url: # 必填,请求地址
|
||||
branch_filter: # 必填,分支白名单 推送、创建,删除分支事件的分支白名单,使用 glob 模式匹配指定。若为空或 ,则将报告所有分支的事件。
|
||||
events: # 必填,事件,枚举值:push create delete issues_only issue_assign issue_label issue_comment pull_request_only pull_request_assign pull_request_comment
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回包括字段total_count
|
||||
expect_value: total_count
|
||||
assert_type: contains
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
# 新建私有仓库
|
||||
interface: gitlink_projects_new_project_02
|
||||
# teardown:
|
||||
# # 删除仓库
|
||||
# interface: gitlink_projects_delete_project_01
|
||||
|
||||
-
|
||||
id: gitlink_get_repo_update_webhook_02
|
||||
title: 非仓库管理员更新Webhook,更新失败
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/webhooks/${webhook_id}.json
|
||||
method: PUT
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
type: # 选填,类型, 默认值gitea, 枚举值:gitea slack discord dingtalk telegram msteams feishu matrix jianmu softbot
|
||||
active: # 必填,是否开启, 布尔值
|
||||
content_type: # 必填,内容类型, 枚举值:json form
|
||||
http_method: # 必填,请求方式,枚举值:GET POST
|
||||
secret: # 选填,密钥
|
||||
url: # 必填,请求地址
|
||||
branch_filter: # 必填,分支白名单 推送、创建,删除分支事件的分支白名单,使用 glob 模式匹配指定。若为空或 ,则将报告所有分支的事件。
|
||||
events: # 必填,事件,枚举值:push create delete issues_only issue_assign issue_label issue_comment pull_request_only pull_request_assign pull_request_comment
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assert_status:
|
||||
message: 断言接口status=403
|
||||
expect_value: 403
|
||||
assert_type: ==
|
||||
type_jsonpath: $.status
|
||||
assert_message:
|
||||
message: 断言接口message=你不是管理员,没有权限操作
|
||||
expect_value: 你不是管理员,没有权限操作
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
@@ -0,0 +1,78 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: Webhook
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- webhook
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时还未完成
|
||||
# 仅仓库管理员及以上角色才有权限
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_get_repo_webhook_detail_01
|
||||
title: 仓库管理员获取Webhook详情,获取成功
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/webhooks/${webhook_id}.json
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: params
|
||||
payload:
|
||||
owner:
|
||||
repo:
|
||||
id:
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回包括字段total_count
|
||||
expect_value: total_count
|
||||
assert_type: contains
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
# 新建私有仓库
|
||||
interface: gitlink_projects_new_project_02
|
||||
# teardown:
|
||||
# # 删除仓库
|
||||
# interface: gitlink_projects_delete_project_01
|
||||
|
||||
-
|
||||
id: gitlink_get_repo_webhook_detail_02
|
||||
title: 非仓库管理员获取Webhook详情,获取失败
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/webhooks/${webhook_id}.json
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: params
|
||||
payload:
|
||||
owner:
|
||||
repo:
|
||||
id:
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assert_status:
|
||||
message: 断言接口status=403
|
||||
expect_value: 403
|
||||
assert_type: ==
|
||||
type_jsonpath: $.status
|
||||
assert_message:
|
||||
message: 断言接口message=你不是管理员,没有权限操作
|
||||
expect_value: 你不是管理员,没有权限操作
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
@@ -0,0 +1,78 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: Webhook
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- webhook
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时还未完成
|
||||
# 仅仓库管理员及以上角色才有权限
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_get_repo_webhook_history_list_01
|
||||
title: 仓库管理员获取Webhook历史推送列表,获取成功
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/webhooks/${id}/hooktasks.json.json
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: params
|
||||
payload:
|
||||
owner:
|
||||
repo:
|
||||
id:
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回包括字段total_count
|
||||
expect_value: total_count
|
||||
assert_type: contains
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
# 新建私有仓库
|
||||
interface: gitlink_projects_new_project_02
|
||||
# teardown:
|
||||
# # 删除仓库
|
||||
# interface: gitlink_projects_delete_project_01
|
||||
|
||||
-
|
||||
id: gitlink_get_repo_webhook_history_list_02
|
||||
title: 非仓库管理员获取Webhook历史推送列表,获取失败
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/${env_repo_owner}/${env_repo_identifier}/webhooks/${id}/hooktasks.json.json
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: params
|
||||
payload:
|
||||
owner:
|
||||
repo:
|
||||
id:
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assert_status:
|
||||
message: 断言接口status=403
|
||||
expect_value: 403
|
||||
assert_type: ==
|
||||
type_jsonpath: $.status
|
||||
assert_message:
|
||||
message: 断言接口message=你不是管理员,没有权限操作
|
||||
expect_value: 你不是管理员,没有权限操作
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
@@ -0,0 +1,76 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: Webhook
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- webhook
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时还未完成
|
||||
# 仅仓库管理员及以上角色才有权限
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_get_repo_webhook_list_01
|
||||
title: 仓库管理员获取Webhook列表,获取成功
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/webhooks.json
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
page: 1
|
||||
limit: 15
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回包括字段total_count
|
||||
expect_value: total_count
|
||||
assert_type: contains
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
# 新建私有仓库
|
||||
interface: gitlink_projects_new_project_02
|
||||
# teardown:
|
||||
# # 删除仓库
|
||||
# interface: gitlink_projects_delete_project_01
|
||||
|
||||
-
|
||||
id: gitlink_get_repo_webhook_list_02
|
||||
title: 非仓库管理员获取Webhook列表,获取失败
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/${env_repo_owner}/${env_repo_identifier}/webhooks.json
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
page: 1
|
||||
limit: 15
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assert_status:
|
||||
message: 断言接口status=403
|
||||
expect_value: 403
|
||||
assert_type: ==
|
||||
type_jsonpath: $.status
|
||||
assert_message:
|
||||
message: 断言接口message=你不是管理员,没有权限操作
|
||||
expect_value: 你不是管理员,没有权限操作
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
@@ -0,0 +1,78 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: Webhook
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- webhook
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时还未完成
|
||||
# 仅仓库管理员及以上角色才有权限
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_get_repo_webhook_test_01
|
||||
title: 仓库管理员测试Webhook推送,请求成功
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/webhooks/${id}/tests.json
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: params
|
||||
payload:
|
||||
owner:
|
||||
repo:
|
||||
id:
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回包括字段total_count
|
||||
expect_value: total_count
|
||||
assert_type: contains
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
# 新建私有仓库
|
||||
interface: gitlink_projects_new_project_02
|
||||
# teardown:
|
||||
# # 删除仓库
|
||||
# interface: gitlink_projects_delete_project_01
|
||||
|
||||
-
|
||||
id: gitlink_get_repo_webhook_test_02
|
||||
title: 非仓库管理员测试Webhook推送,请求失败
|
||||
severity: normal
|
||||
run: True
|
||||
url: /api/${repo_owner}/${repo_identifier}/webhooks/${id}/tests.json
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: params
|
||||
payload:
|
||||
owner:
|
||||
repo:
|
||||
id:
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assert_status:
|
||||
message: 断言接口status=403
|
||||
expect_value: 403
|
||||
assert_type: ==
|
||||
type_jsonpath: $.status
|
||||
assert_message:
|
||||
message: 断言接口message=你不是管理员,没有权限操作
|
||||
expect_value: 你不是管理员,没有权限操作
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
@@ -0,0 +1,49 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: Wiki
|
||||
case_markers:
|
||||
- gitlink
|
||||
- repo_wiki
|
||||
- gitea
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时跳过
|
||||
|
||||
|
||||
common_dependence:
|
||||
setup:
|
||||
env_vars:
|
||||
env_page_title: 新页面_${generate_words()}
|
||||
env_page_content: ${generate_paragraph}
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_repo_delete_wiki_01
|
||||
title: 删除wiki页面
|
||||
severity: critical
|
||||
run: True
|
||||
url: ${wiki_host}/api/wiki/deleteWiki
|
||||
method: DELETE
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
owner: ${env_repo_owner} # 必填,仓库拥有者标识
|
||||
repo: ${env_repo_identifier} # 必填,仓库标识
|
||||
projectId: ${env_project_id} # 必填 gitlink项目id
|
||||
pageName: ${env_page_title} # 必填,当前页标题
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回的message
|
||||
expect_value: 204
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface: gitlink_repo_new_wiki_01
|
||||
@@ -0,0 +1,93 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: Wiki
|
||||
case_markers:
|
||||
- gitlink
|
||||
- repo_wiki
|
||||
- gitea
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时跳过
|
||||
|
||||
|
||||
common_dependence:
|
||||
setup:
|
||||
interface: gitlink_get_repo_simple_01
|
||||
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_repo_export_wiki_01
|
||||
title: 导出wiki库(pdf), 导出成功
|
||||
severity: normal
|
||||
run: True
|
||||
url: ${wiki_host}/api/wikiExport/wikiExport-wrapper
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: params
|
||||
payload:
|
||||
owner: ${env_repo_owner} # 必填,仓库拥有者标识
|
||||
repoName: ${env_repo_identifier} # 必填,仓库标识
|
||||
projectId: ${env_project_id} # 必填 gitlink项目id
|
||||
projectName: ${repo_project_name} # 必填,项目名称
|
||||
type: pdf # 类型,pdf or markdown or html
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
|
||||
|
||||
-
|
||||
id: gitlink_repo_export_wiki_02
|
||||
title: 导出wiki库(markdown), 导出成功
|
||||
severity: normal
|
||||
run: True
|
||||
url: ${wiki_host}/api/wikiExport/wikiExport-wrapper
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: params
|
||||
payload:
|
||||
owner: ${env_repo_owner} # 必填,仓库拥有者标识
|
||||
repoName: ${env_repo_identifier} # 必填,仓库标识
|
||||
projectId: ${env_project_id} # 必填 gitlink项目id
|
||||
projectName: ${repo_project_name} # 必填,项目名称
|
||||
type: markdown # 类型,pdf or markdown or html
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
|
||||
-
|
||||
id: gitlink_repo_export_wiki_03
|
||||
title: 导出wiki库(html), 导出成功
|
||||
severity: normal
|
||||
run: True
|
||||
url: ${wiki_host}/api/wikiExport/wikiExport-wrapper
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: params
|
||||
payload:
|
||||
owner: ${env_repo_owner} # 必填,仓库拥有者标识
|
||||
repoName: ${env_repo_identifier} # 必填,仓库标识
|
||||
projectId: ${env_project_id} # 必填 gitlink项目id
|
||||
projectName: ${repo_project_name} # 必填,项目名称
|
||||
type: html # 类型,pdf or markdown or html
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
@@ -0,0 +1,53 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: Wiki
|
||||
case_markers:
|
||||
- gitlink
|
||||
- repo_wiki
|
||||
- gitea
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时跳过
|
||||
|
||||
# 前提条件:新建一个wiki页面,确保wiki库不为空
|
||||
|
||||
common_dependence:
|
||||
setup:
|
||||
env_vars:
|
||||
env_page_title: 新页面_${generate_words()}
|
||||
env_page_content: ${generate_paragraph}
|
||||
interface: gitlink_repo_new_wiki_01
|
||||
teardown:
|
||||
interface: gitlink_repo_delete_wiki_01
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_repo_get_wiki_detail_01
|
||||
title: 获取wiki页面详情
|
||||
severity: normal
|
||||
run: True
|
||||
url: ${wiki_host}/api/wiki/getWiki
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: params
|
||||
payload:
|
||||
owner: ${env_repo_owner} # 必填,仓库拥有者标识
|
||||
repo: ${env_repo_identifier} # 必填,仓库标识
|
||||
projectId: ${env_project_id} # 必填 gitlink项目id
|
||||
pageName: ${wiki_page_sub_url} # 必填,当前页标题 (特殊字符处理后的标题)
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回的message
|
||||
expect_value: 200
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface: gitlink_repo_get_wiki_page_01
|
||||
@@ -0,0 +1,42 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: Wiki
|
||||
case_markers:
|
||||
- gitlink
|
||||
- repo_wiki
|
||||
- gitea
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时跳过
|
||||
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_repo_get_wiki_page_01
|
||||
title: 获取wiki库所有页面
|
||||
severity: normal
|
||||
run: True
|
||||
url: ${wiki_host}/api/wiki/wikiPages
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: params
|
||||
payload:
|
||||
owner: ${env_repo_owner} # 必填,仓库拥有者标识
|
||||
repo: ${env_repo_identifier} # 必填,仓库标识
|
||||
projectId: ${env_project_id} # 必填 gitlink项目id
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回的message
|
||||
expect_value: 200
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
type_jsonpath:
|
||||
wiki_page_sub_url: $.data[0].sub_url
|
||||
case_dependence:
|
||||
@@ -0,0 +1,43 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: Wiki
|
||||
case_markers:
|
||||
- gitlink
|
||||
- repo_wiki
|
||||
- gitea
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时跳过
|
||||
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_repo_get_wiki_sidebar_01
|
||||
title: 获取wiki库的sidebar信息
|
||||
severity: normal
|
||||
run: True
|
||||
url: ${wiki_host}/api/wiki/wikiPages
|
||||
method: GET
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: params
|
||||
payload:
|
||||
owner: ${env_repo_owner} # 必填,仓库拥有者标识
|
||||
repo: ${env_repo_identifier} # 必填,仓库标识
|
||||
projectId: ${env_project_id} # 必填 gitlink项目id
|
||||
pageName: _Sidebar
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回的message
|
||||
expect_value: 200
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
type_jsonpath:
|
||||
wiki_sidebar_content: $.data.md_content
|
||||
case_dependence:
|
||||
@@ -0,0 +1,75 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: Wiki
|
||||
case_markers:
|
||||
- gitlink
|
||||
- repo_wiki
|
||||
- gitea
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时跳过
|
||||
|
||||
# 仅支持txt, markdown文件的导入
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_repo_import_wiki_01
|
||||
title: 导入wiki页面(txt文件), 导入成功
|
||||
severity: critical
|
||||
run: True
|
||||
url: ${wiki_host}/api/wikiExport/uploadWiki/${env_repo_owner}/${env_repo_identifier}/${env_project_id}
|
||||
method: POST
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: file
|
||||
payload:
|
||||
multipartFile
|
||||
files: GitLink,新一代开源创新服务平台.txt
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回的message
|
||||
expect_value: 201
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
teardown:
|
||||
env_vars:
|
||||
env_page_title: GitLink,新一代开源创新服务平台
|
||||
interface: gitlink_repo_delete_wiki_01
|
||||
|
||||
|
||||
-
|
||||
id: gitlink_repo_import_wiki_02
|
||||
title: 导入wiki页面(md文件), 导入成功
|
||||
severity: critical
|
||||
run: True
|
||||
url: ${wiki_host}/api/wikiExport/uploadWiki/${env_repo_owner}/${env_repo_identifier}/${env_project_id}
|
||||
method: POST
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: file
|
||||
payload:
|
||||
multipartFile
|
||||
files: GitLink编程夏令营(GLCC).md
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回的message
|
||||
expect_value: 201
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
teardown:
|
||||
env_vars:
|
||||
env_page_title: GitLink编程夏令营(GLCC)
|
||||
interface: gitlink_repo_delete_wiki_01
|
||||
|
||||
@@ -4,10 +4,11 @@ case_common:
|
||||
allure_story: Wiki
|
||||
case_markers:
|
||||
- gitlink
|
||||
- projects
|
||||
- repo_wiki
|
||||
- gitea
|
||||
- new_wiki
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时跳过
|
||||
|
||||
|
||||
common_dependence:
|
||||
@@ -30,13 +31,13 @@ case_info:
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
owner: ${env_repo_owner}
|
||||
repo: ${env_repo_identifier}
|
||||
projectId: ${env_project_id}
|
||||
pageName: ${env_page_title} # 当前页标题
|
||||
title: ${env_page_title} # 标题
|
||||
message:
|
||||
content_base64: ${string_to_base64('${env_page_content}')}
|
||||
owner: ${env_repo_owner} # 必填,仓库拥有者标识
|
||||
repo: ${env_repo_identifier} # 必填,仓库标识
|
||||
projectId: ${env_project_id} # 必填 gitlink项目id
|
||||
pageName: ${env_page_title} # 必填,当前页标题
|
||||
title: ${env_page_title} # 必填,标题
|
||||
message: # 选填,提交信息
|
||||
content_base64: ${string_to_base64('${env_page_content}')} # 必填,wiki内容
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
@@ -48,3 +49,5 @@ case_info:
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
teardown:
|
||||
interface: gitlink_repo_delete_wiki_01
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: Wiki
|
||||
case_markers:
|
||||
- gitlink
|
||||
- repo_wiki
|
||||
- gitea
|
||||
- new_wiki
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时跳过
|
||||
|
||||
|
||||
# 前提条件:新建一个wiki页面,确保wiki库不为空
|
||||
|
||||
common_dependence:
|
||||
setup:
|
||||
env_vars:
|
||||
env_page_title: 新页面_${generate_words()}
|
||||
env_page_content: ${generate_paragraph}
|
||||
interface: gitlink_repo_new_wiki_01
|
||||
teardown:
|
||||
interface: gitlink_repo_delete_wiki_01
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_repo_update_wiki_01
|
||||
title: 编辑wiki页面
|
||||
severity: critical
|
||||
run: True
|
||||
url: ${wiki_host}/api/wiki/updateWiki
|
||||
method: PUT
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
owner: ${env_repo_owner} # 必填,仓库拥有者标识
|
||||
repo: ${env_repo_identifier} # 必填,仓库标识
|
||||
projectId: ${env_project_id} # 必填 gitlink项目id
|
||||
pageName: ${env_page_title} # 必填,当前页标题
|
||||
title: ${env_page_title} # 必填,标题
|
||||
message: # 选填,提交信息
|
||||
content_base64: ${string_to_base64('${env_page_content}')} # 必填,wiki内容
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回的message
|
||||
expect_value: 200
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
@@ -0,0 +1,48 @@
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 开源项目模块
|
||||
allure_story: Wiki
|
||||
case_markers:
|
||||
- gitlink
|
||||
- repo_wiki
|
||||
- gitea
|
||||
- usefixtures: gitlink_login
|
||||
- skip: 暂时跳过
|
||||
|
||||
|
||||
# 前提条件:新建wiki页面是需要同步更新sidebar
|
||||
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_repo_update_wiki_sidebar_01
|
||||
title: 更新wiki库的sidebar
|
||||
severity: critical
|
||||
run: True
|
||||
url: ${wiki_host}/api/wiki/updateWiki
|
||||
method: PUT
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
cookies: ${cookies}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
owner: ${env_repo_owner} # 必填,仓库拥有者标识
|
||||
repo: ${env_repo_identifier} # 必填,仓库标识
|
||||
projectId: ${env_project_id} # 必填 gitlink项目id
|
||||
pageName: _Sidebar
|
||||
title: _Sidebar
|
||||
message: # 选填,提交信息
|
||||
content_base64:
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assertMessage:
|
||||
message: 断言接口返回的message
|
||||
expect_value: 200
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
case_dependence:
|
||||
setup:
|
||||
interface: gitlink_repo_get_wiki_sidebar_01
|
||||
Reference in New Issue
Block a user