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,10 +1,10 @@
- config:
name: "create user testcases."
variables:
- user_agent: 'iOS/10.3'
- device_sn: ${gen_random_string(15)}
- os_platform: 'ios'
- app_version: '2.8.6'
user_agent: 'iOS/10.3'
device_sn: ${gen_random_string(15)}
os_platform: 'ios'
app_version: '2.8.6'
base_url: ${get_base_url()}
- test:
@@ -28,8 +28,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