Files
apiautotest/interface/gitlink/login_oauth_token.yaml

70 lines
1.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 公共参数
case_common:
allure_epic: GitLink接口
allure_feature: 登录模块
allure_story: 登录接口
case_markers:
- gitlink
- login: 登录接口
# 用例数据
case_info:
-
id: gitlink_login_oauth_token_01
title: 用户登录(密码模式)
run: True
severity: normal
url: /oauth/token
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies:
request_type: json
payload:
grant_type: password
username: ${env_login}
password: ${env_password}
client_id: ${client_id}
client_secret: ${client_secret}
files:
assert_response:
status_code: 200
access_token_in_response:
message: 断言接口返回中存在access_token字段
expect_value: access_token
assert_type: contains
assert_sql:
extract:
type_jsonpath:
access_token: $.access_token
token_type: $.token_type
token_expires_in: $.expires_in
-
id: gitlink_login_oauth_token_02
title: 用户登录(客户端模式) # 这种登录方式适用于一个application没有账号密码的情况
run: True
severity: normal
url: /oauth/token
method: POST
headers:
Content-Type: application/json; charset=utf-8;
cookies:
request_type: json
payload:
grant_type: client_credentials
client_id: ${client_id}
client_secret: ${client_secret}
files:
assert_response:
status_code: 200
access_token_in_response:
message: 断言接口返回中存在access_token字段
expect_value: access_token
assert_type: contains
assert_sql:
extract:
type_jsonpath:
access_token: $.access_token
token_type: $.token_type
token_expires_in: $.expires_in