mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-01 13:59:37 +08:00
change variable marker and function marker:
1, variable marker: ${var} => $var;
2, function marker: {'func': 'gen_random_string', 'args': [5]} => ${gen_random_string(5).
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
- test.data.custom_functions
|
||||
variable_binds:
|
||||
- TOKEN: debugtalk
|
||||
- json: {"name": "user", "password": "123456"}
|
||||
- random: {"func": "gen_random_string", "args": [5]}
|
||||
- authorization: {"func": "gen_md5", "args": ["${TOKEN}", "${json}", "${random}"]}
|
||||
- json: {}
|
||||
- random: ${gen_random_string(5)}
|
||||
- authorization: ${gen_md5($TOKEN, $json, $random)}
|
||||
|
||||
- test:
|
||||
name: create user which does not exist
|
||||
@@ -17,9 +17,9 @@
|
||||
method: POST
|
||||
headers:
|
||||
Content-Type: application/json
|
||||
authorization: "${authorization}"
|
||||
random: "${random}"
|
||||
json: "${json}"
|
||||
authorization: $authorization
|
||||
random: $random
|
||||
json: $json
|
||||
validators:
|
||||
- {"check": "status_code", "comparator": "eq", "expected": 201}
|
||||
- {"check": "content.success", "comparator": "eq", "expected": true}
|
||||
@@ -33,9 +33,9 @@
|
||||
method: POST
|
||||
headers:
|
||||
Content-Type: application/json
|
||||
authorization: "${authorization}"
|
||||
random: "${random}"
|
||||
json: "${json}"
|
||||
authorization: $authorization
|
||||
random: $random
|
||||
json: $json
|
||||
validators:
|
||||
- {"check": "status_code", "comparator": "eq", "expected": 500}
|
||||
- {"check": "content.success", "comparator": "eq", "expected": false}
|
||||
|
||||
Reference in New Issue
Block a user