mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-25 17:44:02 +08:00
115 lines
4.1 KiB
JSON
115 lines
4.1 KiB
JSON
{
|
|
"project_mapping":{
|
|
"env":{},
|
|
"PWD":"/Users/debugtalk/MyProjects/HttpRunner-dev/httprunner-docs-v2x/docs/data",
|
|
"debugtalk.py":"/Users/debugtalk/MyProjects/HttpRunner-dev/httprunner-docs-v2x/docs/data/debugtalk.py",
|
|
"test_path":"docs/data/demo-quickstart-6.json"
|
|
},
|
|
"testcases":[
|
|
{
|
|
"config":{
|
|
"name":"testcase description",
|
|
"base_url":"http://127.0.0.1:5000",
|
|
"variables":{
|
|
"device_sn":"${gen_random_string(15)}"
|
|
}
|
|
},
|
|
"teststeps":[
|
|
{
|
|
"name":"/api/get-token",
|
|
"variables":{
|
|
"os_platform":"ios",
|
|
"app_version":"2.8.6"
|
|
},
|
|
"request":{
|
|
"url":"/api/get-token",
|
|
"method":"POST",
|
|
"headers":{
|
|
"User-Agent":"python-requests/2.18.4",
|
|
"device_sn":"$device_sn",
|
|
"os_platform":"$os_platform",
|
|
"app_version":"$app_version",
|
|
"Content-Type":"application/json"
|
|
},
|
|
"json":{
|
|
"sign":"${get_sign($device_sn, $os_platform, $app_version)}"
|
|
}
|
|
},
|
|
"extract":[
|
|
{
|
|
"token":"content.token"
|
|
}
|
|
],
|
|
"validate":[
|
|
{
|
|
"eq":[
|
|
"status_code",
|
|
200
|
|
]
|
|
},
|
|
{
|
|
"eq":[
|
|
"headers.Content-Type",
|
|
"application/json"
|
|
]
|
|
},
|
|
{
|
|
"eq":[
|
|
"content.success",
|
|
true
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name":"/api/users/$user_id",
|
|
"variables":{
|
|
"user_id":"${gen_user_id()}"
|
|
},
|
|
"request":{
|
|
"url":"/api/users/$user_id",
|
|
"method":"POST",
|
|
"headers":{
|
|
"User-Agent":"python-requests/2.18.4",
|
|
"device_sn":"$device_sn",
|
|
"token":"$token",
|
|
"Content-Type":"application/json"
|
|
},
|
|
"json":{
|
|
"name":"user1",
|
|
"password":"123456"
|
|
}
|
|
},
|
|
"validate":[
|
|
{
|
|
"eq":[
|
|
"status_code",
|
|
201
|
|
]
|
|
},
|
|
{
|
|
"eq":[
|
|
"headers.Content-Type",
|
|
"application/json"
|
|
]
|
|
},
|
|
{
|
|
"eq":[
|
|
"content.success",
|
|
true
|
|
]
|
|
},
|
|
{
|
|
"eq":[
|
|
"content.msg",
|
|
"user created successfully."
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"path":"/Users/debugtalk/MyProjects/HttpRunner-dev/httprunner-docs-v2x/docs/data/demo-quickstart-6.json",
|
|
"type":"testcase"
|
|
}
|
|
]
|
|
} |