Files
httprunner/examples/hrp/httpbin.json
2022-03-23 10:36:24 +08:00

51 lines
1.8 KiB
JSON

{
"config": {
"name": "testcase description",
"variables": {},
"verify": false
},
"teststeps": [
{
"name": "/get",
"request": {
"url": "http://httpbin.org/get",
"method": "GET",
"headers": {
"Host": "httpbin.org",
"Connection": "keep-alive",
"accept": "application/json",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.50",
"Referer": "http://httpbin.org/",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6"
}
},
"validate": [
{
"check": "status_code",
"assert": "equals",
"expect": 200,
"msg": "assert response status code"
},
{
"check": "headers.\"Content-Type\"",
"assert": "equals",
"expect": "application/json",
"msg": "assert response header Content-Type"
},
{
"check": "body.origin",
"assert": "equals",
"expect": "117.176.133.109",
"msg": "assert response body origin"
},
{
"check": "body.url",
"assert": "equals",
"expect": "http://httpbin.org/get",
"msg": "assert response body url"
}
]
}
]
}