新增用例:删除项目,修改用户手机号,修改用户密码,修改用户邮箱
This commit is contained in:
45
interface/gitlink/users/test_user_change_email.yaml
Normal file
45
interface/gitlink/users/test_user_change_email.yaml
Normal file
@@ -0,0 +1,45 @@
|
||||
# 公共参数
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 用户
|
||||
allure_story: 账号管理
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- change_email
|
||||
- login: 登录接口
|
||||
- usefixtures: get_oauth_token
|
||||
|
||||
# 用例数据
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_user_change_email_01
|
||||
title: 用户修改邮箱
|
||||
run: True
|
||||
severity: normal
|
||||
url: api/v1/${login}/update_email.json
|
||||
method: PATCH
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
Authorization: ${token_type} ${access_token}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
email: ${generate_email()}
|
||||
password: ${password}
|
||||
code: ${green_code}
|
||||
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:
|
||||
80
interface/gitlink/users/test_user_change_password.yaml
Normal file
80
interface/gitlink/users/test_user_change_password.yaml
Normal file
@@ -0,0 +1,80 @@
|
||||
# 公共参数
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 用户
|
||||
allure_story: 账号管理
|
||||
case_markers:
|
||||
- gitlink
|
||||
- gitea
|
||||
- change_pwd
|
||||
- login: 登录接口
|
||||
- usefixtures: get_oauth_token
|
||||
- skip: 跳过执行该用例
|
||||
|
||||
# 用例数据
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_user_change_password_01
|
||||
title: 用户修改密码, 新密码和确认密码一致,修改成功
|
||||
run: True
|
||||
severity: normal
|
||||
url: /api/accounts/change_password.json
|
||||
method: POST
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
Authorization: ${token_type} ${access_token}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
login: ${login}
|
||||
old_password: ${password} # 原始密码
|
||||
password: ${password} # 新密码
|
||||
new_password_repeat: ${password} # 确认密码
|
||||
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:
|
||||
|
||||
-
|
||||
id: gitlink_user_change_password_02
|
||||
title: 用户修改密码, 新密码和确认密码不一致,修改失败
|
||||
run: True
|
||||
severity: normal
|
||||
url: /api/accounts/change_password.json
|
||||
method: POST
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
Authorization: ${token_type} ${access_token}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
login: ${login}
|
||||
old_password: ${password} # 原始密码
|
||||
password: ${generate_identifier()} # 新密码
|
||||
new_password_repeat: ${generate_identifier()} # 确认密码
|
||||
files:
|
||||
assert_response:
|
||||
status_code: 200
|
||||
assert_status:
|
||||
message: 断言接口status=-2
|
||||
expect_value: -2
|
||||
assert_type: ==
|
||||
type_jsonpath: $.status
|
||||
assert_message:
|
||||
message: 断言接口message=success
|
||||
expect_value: 新密码与确认密码不一致
|
||||
assert_type: ==
|
||||
type_jsonpath: $.message
|
||||
assert_sql:
|
||||
extract:
|
||||
44
interface/gitlink/users/test_user_change_phone.yaml
Normal file
44
interface/gitlink/users/test_user_change_phone.yaml
Normal file
@@ -0,0 +1,44 @@
|
||||
# 公共参数
|
||||
case_common:
|
||||
allure_epic: GitLink接口
|
||||
allure_feature: 用户
|
||||
allure_story: 账号管理
|
||||
case_markers:
|
||||
- gitlink
|
||||
- change_phone
|
||||
- login: 登录接口
|
||||
- usefixtures: get_oauth_token
|
||||
|
||||
# 用例数据
|
||||
case_info:
|
||||
-
|
||||
id: gitlink_user_change_phone_01
|
||||
title: 用户修改手机号码
|
||||
run: True
|
||||
severity: normal
|
||||
url: api/v1/${login}/update_phone.json
|
||||
method: PATCH
|
||||
headers:
|
||||
Content-Type: application/json; charset=utf-8;
|
||||
Authorization: ${token_type} ${access_token}
|
||||
cookies:
|
||||
request_type: json
|
||||
payload:
|
||||
phone: ${generate_phone(lan='zh')}
|
||||
password: ${password}
|
||||
code: ${green_code}
|
||||
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:
|
||||
Reference in New Issue
Block a user