Files
httprunner/tests/data/demo_testset_layer.yml
debugtalk 3792da8105 add output:
1, change return value of running testset;
2, print extracted variables at the end of testset.
2017-09-19 15:24:11 +08:00

41 lines
1.2 KiB
YAML

- config:
name: "create user testsets."
variable_binds:
- user_agent: 'iOS/10.3'
- device_sn: ${gen_random_string(15)}
- os_platform: 'ios'
- app_version: '2.8.6'
request:
base_url: $BASE_URL
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)
extract_binds:
- token: content.token
- test:
name: create user which does not exist
variable_binds:
- user_name: "user1"
- user_password: "123456"
api: create_user(1000, $user_name, $user_password, $token)
validators:
- {"check": "status_code", "comparator": "eq", "expected": 201}
- {"check": "content.success", "comparator": "eq", "expected": true}
- test:
name: create user which does not exist
variable_binds:
- user_name: "user1"
- user_password: "123456"
api: create_user(1000, $user_name, $user_password, $token)
validators:
- {"check": "status_code", "comparator": "eq", "expected": 500}
- {"check": "content.success", "comparator": "eq", "expected": false}