Files
httprunner/internal/scaffold/templates/testcases/demo_ref_api.json
2025-02-06 11:03:41 +08:00

76 lines
2.2 KiB
JSON

{
"config": {
"name": "api test demo",
"variables": {
"user_agent": "iOS/10.3",
"device_sn": "TESTCASE_SETUP_XXX",
"os_platform": "ios",
"app_version": "2.8.6"
},
"base_url": "https://postman-echo.com",
"headers": {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate, br",
"Cache-Control": "no-cache",
"Connection": "keep-alive",
"Host": "postman-echo.com",
"User-Agent": "PostmanRuntime/7.28.4"
},
"verify": false,
"export": [
"session_token"
]
},
"teststeps": [
{
"name": "test api /get",
"api": "api/get.json",
"variables": {
"user_agent": "iOS/10.4",
"device_sn": "$device_sn",
"os_platform": "ios",
"app_version": "2.8.7"
},
"extract": {
"session_token": "body.headers.\"postman-token\""
}
},
{
"name": "test api /post",
"api": "api/post.json",
"variables": {
"user_agent": "iOS/10.5",
"device_sn": "$device_sn",
"os_platform": "ios",
"app_version": "2.8.9"
},
"validate": [
{
"check": "status_code",
"assert": "equal",
"expect": 200,
"msg": "check status_code"
},
{
"check": "body.headers.\"postman-token\"",
"assert": "equal",
"expect": "ea19464c-ddd4-4724-abe9-5e2b254c2723",
"msg": "check body.headers.postman-token"
}
]
},
{
"name": "test api /put",
"api": "api/put.json",
"variables": {
"user_agent": "iOS/10.6",
"device_sn": "$device_sn",
"os_platform": "ios",
"app_version": "2.8.10"
},
"extract": {
"session_token": "body.headers.\"postman-token\""
}
}
]
}