Files
httprunner/tests/testcases/setup.yml
debugtalk 2ec2d3c2d8 make variables in testcase template compatible with mapping style:
new mapping style:
"variables": {
    "a": 1,
    "b": 2
}

Also, the former list style is still valid:
"variables": [
    {"a": 1},
    {"b": 2}
]
2018-11-28 12:14:06 +08:00

33 lines
705 B
YAML

- config:
name: "setup and reset all."
id: setup_and_reset
variables:
user_agent: 'iOS/10.3'
device_sn: "TESTCASE_SETUP_XXX"
os_platform: 'ios'
app_version: '2.8.6'
base_url: "http://127.0.0.1:5000"
verify: False
output:
- token
- test:
name: get token (setup)
api: get_token
variables:
user_agent: 'iOS/10.3'
device_sn: $device_sn
os_platform: 'ios'
app_version: '2.8.6'
extract:
- token: content.token
validate:
- eq: ["status_code", 200]
- len_eq: ["content.token", 16]
- test:
name: reset all users
api: reset_all
variables:
token: $token