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}
]
This commit is contained in:
httprunner
2018-11-28 12:11:50 +08:00
parent a4ce29e656
commit 9a62f778fb
20 changed files with 141 additions and 142 deletions

View File

@@ -1,16 +1,16 @@
- config:
name: "create user testcases."
variables:
- device_sn: 'HZfFBh6tU59EdXJ'
device_sn: 'HZfFBh6tU59EdXJ'
base_url: ${get_base_url()}
- test:
name: get token
variables:
- user_agent: 'iOS/10.3'
- os_platform: 'ios'
- app_version: '2.8.6'
- sign: f1219719911caae89ccc301679857ebfda115ca2
user_agent: 'iOS/10.3'
os_platform: 'ios'
app_version: '2.8.6'
sign: f1219719911caae89ccc301679857ebfda115ca2
request:
url: /api/get-token
method: POST
@@ -31,8 +31,8 @@
- test:
name: create user which does not exist
variables:
- user_name: "user1"
- user_password: "123456"
user_name: "user1"
user_password: "123456"
request:
url: /api/users/1000
method: POST