5uu5R0GP_test/effort_p1BLKWr0/login_demo.yaml

94 lines
2.4 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接口手动编写用例 # 敏捷里面的概念定义史诗相当于module级的标签, 往下是 feature
allure_feature: 登录模块 # 功能点的描述相当于class级的标签, 理解成模块往下是 story
allure_story: 登录接口 # 故事可以理解为场景相当于method级的标签, 往下是 title
case_markers: # pytest框架的标记 pytest.mark.
- glcc: glcc相关的接口
- get_project
- skip: 跳过执行该用例
# 用例数据
case_info:
-
id: case_login_01
title: 用户名密码正确,登录成功(不校验数据库)
run: True
severity: normal
url: /api/accounts/login.json
method: POST
headers: {"Content-Type": "application/json; charset=utf-8;"}
cookies:
request_type: json
payload: { "login": "${login}","password": "${password}","autologin": 1 }
files:
extract:
nickname: $.username
login: $.login
user_id: $.user_id
assert_response:
eq:
http_code: 200
$.user_id: ${user_id}
in:
$.login: ${login}
gt:
$.user_id: 84955
lt:
$.user_id: 84953
not:
$.user_id: 85390
assert_sql:
-
id: case_login_02
title: 用户名密码正确,登录成功(校验数据库)
run: False
severity: minor
url: /api/accounts/login.json
method: POST
headers: {"Content-Type": "application/json; charset=utf-8;"}
cookies:
request_type: json
payload: { "login": "${login}","password": "${password}","autologin": 1 }
files:
extract:
nickname: $.username
login: $.login
user_id: $.user_id
assert_response:
eq:
http_code: 200
$.user_id: ${user_id}
in:
$.login: ${login}
gt:
$.user_id: 84955
lt:
$.user_id: 84953
not:
$.user_id: 85390
assert_sql:
eq:
sql: select count(*) from tokens where user_id=${user_id};
len: 1
-
id: case_login_03
title: 用户名正确,密码错误,登录失败
severity: critical
run: False
url: /api/accounts/login.json
method: POST
headers: {"Content-Type": "application/json; charset=utf-8;"}
cookies:
request_type: json
payload: { "login": "chytest10","password": "password111","autologin": 1 }
files:
extract:
assert_response:
eq:
http_code: 200
$.status: -2
assert_sql: