mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
34 lines
859 B
YAML
34 lines
859 B
YAML
- config:
|
|
name: "setup and reset all."
|
|
def: setup_and_reset($device_sn)
|
|
variables:
|
|
- user_agent: 'iOS/10.3'
|
|
- device_sn: ${gen_random_string(15)}
|
|
- os_platform: 'ios'
|
|
- app_version: '2.8.6'
|
|
request:
|
|
"base_url": "http://127.0.0.1:5000"
|
|
"headers":
|
|
"Content-Type": "application/json"
|
|
"device_sn": "$device_sn"
|
|
output:
|
|
- token
|
|
|
|
- test:
|
|
name: get token
|
|
api: get_token($user_agent, $device_sn, $os_platform, $app_version)
|
|
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($token)
|