httprunner:testcases--testcase_projects_list.yml

# yaml出现多个variables,优先级:testsuites parameters> testsuites config> testsuites variables > testcases config > extract > testcase teststep > api
# base_url.优先级:与上边相反
# a.若无重复定义的变量,会合并
# b.重复会被覆盖
config:
name: "获取项目列表数据"
# variables:
# device_sn: "ABC"
# username: ${ENV(USERNAME)}
# password: ${ENV(PASSWORD)}
base_url: "http://127.0.0.1:8000"
#测试步骤
teststeps:
-
name: 登录接口
api: api/login_api.yml
# variables:
# user_agent: 'iOS/10.3'
# device_sn: $device_sn
extract:
# a.指定提取数据,并设为变量
# b.可在下方任意地方调用
# c.extract提取的变量优先级较高
# 变量名:提取的变量值
- token: content.token
# validate:
# - eq: ["status_code", 200]
-
name: 获取项目列表数据
api: api/projects_list.yml
# variables:
# token: $token
posted @ 2021-01-23 22:39  zxy_ang  阅读(134)  评论(0)    收藏  举报