mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-14 02:39:41 +08:00
new mapping style:
"variables": {
"a": 1,
"b": 2
}
Also, the former list style is still valid:
"variables": [
{"a": 1},
{"b": 2}
]
47 lines
987 B
YAML
47 lines
987 B
YAML
|
|
- config:
|
|
name: "create user and check result."
|
|
id: create_and_check
|
|
variables:
|
|
uid: 9001
|
|
device_sn: "TESTCASE_CREATE_XXX"
|
|
base_url: "http://127.0.0.1:5000"
|
|
|
|
- test:
|
|
name: setup and reset all (override).
|
|
testcase: testcases/setup.yml
|
|
output:
|
|
- token
|
|
|
|
- test:
|
|
name: make sure user $uid does not exist
|
|
api: get_user
|
|
variables:
|
|
uid: $uid
|
|
token: $token
|
|
validate:
|
|
- eq: ["status_code", 404]
|
|
- eq: ["content.success", false]
|
|
|
|
- test:
|
|
name: create user $uid
|
|
api: create_user
|
|
variables:
|
|
user_name: "user1"
|
|
user_password: "123456"
|
|
uid: $uid
|
|
token: $token
|
|
validate:
|
|
- eq: ["status_code", 201]
|
|
- eq: ["content.success", true]
|
|
|
|
- test:
|
|
name: check if user $uid exists
|
|
api: get_user
|
|
variables:
|
|
uid: $uid
|
|
token: $token
|
|
validate:
|
|
- eq: ["status_code", 200]
|
|
- eq: ["content.success", true]
|