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

127 lines
2.8 KiB
YAML

case_common:
allure_epic: GitLink接口
allure_feature: 开源项目模块
allure_story: 项目
case_markers:
- gitlink
- projects
- gitea
- follow_project
- usefixtures: gitlink_login
common_dependence:
setup:
interface:
- gitlink_projects_new_project_01
teardown:
interface:
- gitlink_projects_delete_project_01
case_info:
-
id: gitlink_projects_follow_project_01
title: 关注项目
severity: critical
run: True
url: /api/watchers/follow.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
target_type: project
id: ${project_id}
files:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assertMessage:
message: 断言接口返回message
expect_value: success
assert_type: ==
type_jsonpath: $.message
assertPraised:
message: 断言接口返回watched=true
expect_value: true
assert_type: ==
type_jsonpath: $.watched
assert_sql:
extract:
case_dependence:
-
id: gitlink_projects_follow_project_02
title: 关注项目 - 已关注过了继续关注
severity: critical
run: True
url: /api/watchers/follow.json
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
target_type: project
id: ${project_id}
files:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=2
expect_value: 2
assert_type: ==
type_jsonpath: $.status
assertMessage:
message: 断言接口返回message
expect_value: 你已关注了
assert_type: ==
type_jsonpath: $.message
assert_sql:
extract:
case_dependence:
-
id: gitlink_projects_unfollow_project_03
title: 取消关注项目
severity: critical
run: True
url: /api/watchers/unfollow.json
method: DELETE
headers:
Content-Type: application/json; charset=utf-8;
cookies: ${cookies}
cookies:
request_type: params
payload:
target_type: project
id: ${project_id}
files:
assert_response:
status_code: 200
assertStatus:
message: 断言接口返回status=0
expect_value: 0
assert_type: ==
type_jsonpath: $.status
assertMessage:
message: 断言接口返回message
expect_value: success
assert_type: ==
type_jsonpath: $.message
assertPraised:
message: 断言接口返回watched=false
expect_value: false
assert_type: ==
type_jsonpath: $.watched
assert_sql:
extract:
case_dependence: