Files
httprunner/tests/httpbin/validate.yml
debugtalk ff24fdb9d7 2.4.0
feat: validate with python script, ref #773
2019-12-04 17:38:13 +08:00

35 lines
754 B
YAML

- config:
name: basic test with httpbin
base_url: http://httpbin.org/
- test:
name: validate response with json path
request:
url: /get
params:
a: 1
b: 2
method: GET
validate:
- eq: ["status_code", 200]
- eq: ["json.args.a", '1']
- eq: ["json.args.b", '2']
validate_script:
- "assert status_code == 200"
- test:
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'"