mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-08 01:09:44 +08:00
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:
@@ -3,8 +3,8 @@
|
||||
name: "create user and check result."
|
||||
id: create_and_check
|
||||
variables:
|
||||
- uid: 9001
|
||||
- device_sn: "TESTCASE_CREATE_XXX"
|
||||
uid: 9001
|
||||
device_sn: "TESTCASE_CREATE_XXX"
|
||||
base_url: "http://127.0.0.1:5000"
|
||||
|
||||
- test:
|
||||
@@ -17,8 +17,8 @@
|
||||
name: make sure user $uid does not exist
|
||||
api: get_user
|
||||
variables:
|
||||
- uid: $uid
|
||||
- token: $token
|
||||
uid: $uid
|
||||
token: $token
|
||||
validate:
|
||||
- eq: ["status_code", 404]
|
||||
- eq: ["content.success", false]
|
||||
@@ -27,10 +27,10 @@
|
||||
name: create user $uid
|
||||
api: create_user
|
||||
variables:
|
||||
- user_name: "user1"
|
||||
- user_password: "123456"
|
||||
- uid: $uid
|
||||
- token: $token
|
||||
user_name: "user1"
|
||||
user_password: "123456"
|
||||
uid: $uid
|
||||
token: $token
|
||||
validate:
|
||||
- eq: ["status_code", 201]
|
||||
- eq: ["content.success", true]
|
||||
@@ -39,8 +39,8 @@
|
||||
name: check if user $uid exists
|
||||
api: get_user
|
||||
variables:
|
||||
- uid: $uid
|
||||
- token: $token
|
||||
uid: $uid
|
||||
token: $token
|
||||
validate:
|
||||
- eq: ["status_code", 200]
|
||||
- eq: ["content.success", true]
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
name: "setup and reset all."
|
||||
id: setup_and_reset
|
||||
variables:
|
||||
- user_agent: 'iOS/10.3'
|
||||
- device_sn: "TESTCASE_SETUP_XXX"
|
||||
- os_platform: 'ios'
|
||||
- app_version: '2.8.6'
|
||||
user_agent: 'iOS/10.3'
|
||||
device_sn: "TESTCASE_SETUP_XXX"
|
||||
os_platform: 'ios'
|
||||
app_version: '2.8.6'
|
||||
base_url: "http://127.0.0.1:5000"
|
||||
verify: False
|
||||
output:
|
||||
@@ -15,10 +15,10 @@
|
||||
name: get token (setup)
|
||||
api: get_token
|
||||
variables:
|
||||
- user_agent: 'iOS/10.3'
|
||||
- device_sn: $device_sn
|
||||
- os_platform: 'ios'
|
||||
- app_version: '2.8.6'
|
||||
user_agent: 'iOS/10.3'
|
||||
device_sn: $device_sn
|
||||
os_platform: 'ios'
|
||||
app_version: '2.8.6'
|
||||
extract:
|
||||
- token: content.token
|
||||
validate:
|
||||
@@ -29,4 +29,4 @@
|
||||
name: reset all users
|
||||
api: reset_all
|
||||
variables:
|
||||
- token: $token
|
||||
token: $token
|
||||
|
||||
Reference in New Issue
Block a user