mirror of
https://github.com/httprunner/httprunner.py.git
synced 2026-06-06 00:01:38 +08:00
init: move from httprunner/httprunner
This commit is contained in:
35
examples/httpbin/validate.yml
Normal file
35
examples/httpbin/validate.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
config:
|
||||
name: basic test with httpbin
|
||||
base_url: ${get_httpbin_server()}
|
||||
|
||||
teststeps:
|
||||
-
|
||||
name: validate response with json path
|
||||
request:
|
||||
url: /get
|
||||
params:
|
||||
a: 1
|
||||
b: 2
|
||||
method: GET
|
||||
validate:
|
||||
- eq: ["status_code", 200]
|
||||
- eq: ["body.args.a", "1"]
|
||||
- eq: ["body.args.b", "2"]
|
||||
validate_script:
|
||||
- "assert status_code == 200"
|
||||
|
||||
|
||||
-
|
||||
name: validate response with python script
|
||||
request:
|
||||
url: /get
|
||||
params:
|
||||
a: 1
|
||||
b: 2
|
||||
method: GET
|
||||
validate:
|
||||
- eq: ["status_code", 200]
|
||||
validate_script:
|
||||
- "assert status_code == 201"
|
||||
- "a = response_json.get('args').get('a')"
|
||||
- "assert a == '1'"
|
||||
Reference in New Issue
Block a user