测试报告

测试结果汇总

图表展示

详细信息

编号 测试类 测试方法 用例描述 执行时间 执行结果 详细信息
1 TestCase0 test_01_post json-demo-1 0.503s 成功
请求方法:POST 请求地址:http://httpbin.org/post 响应状态码:200
【INFO】| 2021-06-24 17:02:38.532480 |: 开始执行用例:【test_01_post (apin.core.basecase.TestCase0)】
【DEBUG】| 2021-06-24 17:02:38.533477 |: 全局变量:
host:'http://api.lemonban.com/futureloan/3'
【DEBUG】| 2021-06-24 17:02:38.533477 |: 局部变量:
user_mobile:'17792837966'
admin_mobile:'17792837966'
timestamp:1624525358.5334773
【INFO】| 2021-06-24 17:02:38.533477 |: 正在发送请求:
【DEBUG】| 2021-06-24 17:02:39.032002 |: [POST]: http://httpbin.org/post 
【DEBUG】| 2021-06-24 17:02:39.033002 |: 请求信息如下:
Request Headers:
      User-Agent:python-requests/2.24.0
      Accept-Encoding:gzip, deflate
      Accept:*/*
      Connection:keep-alive
      X-Lemonban-Media-Type:lemonban.v2
      Content-Length:50
      Content-Type:application/json
Request body:
{
  "mobile_phone": "17792837966",
  "pwd": "lemonban"
}
【DEBUG】| 2021-06-24 17:02:39.033002 |: 接收后台的响应结果,响应信息如下:
Response Headers:
      User-Agent:python-requests/2.24.0
      Accept-Encoding:gzip, deflate
      Accept:*/*
      Connection:keep-alive
      X-Lemonban-Media-Type:lemonban.v2
      Content-Length:50
      Content-Type:application/json
Response body:
{
  "args": {},
  "data": "{\"mobile_phone\": \"17792837966\", \"pwd\": \"lemonban\"}",
  "files": {},
  "form": {},
  "headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate",
    "Content-Length": "50",
    "Content-Type": "application/json",
    "Host": "httpbin.org",
    "User-Agent": "python-requests/2.24.0",
    "X-Amzn-Trace-Id": "Root=1-60d44a2e-2679157f5f68795c1135a855",
    "X-Lemonban-Media-Type": "lemonban.v2"
  },
  "json": {
    "mobile_phone": "17792837966",
    "pwd": "lemonban"
  },
  "origin": "175.9.120.74",
  "url": "http://httpbin.org/post"
}
【INFO】| 2021-06-24 17:02:39.033002 |: 从响应结果中开始提取数据
【INFO】| 2021-06-24 17:02:39.034027 |: 提取变量:token,提取方式【jsonpath】,提取表达式:$..json,提取值为:{'mobile_phone': '17792837966', 'pwd': 'lemonban'}
【INFO】| 2021-06-24 17:02:39.034027 |: 提取变量:member_id,提取方式【jsonpath】,提取表达式:$..headers,提取值为:{'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Content-Length': '50', 'Content-Type': 'application/json', 'Host': 'httpbin.org', 'User-Agent': 'python-requests/2.24.0', 'X-Amzn-Trace-Id': 'Root=1-60d44a2e-2679157f5f68795c1135a855', 'X-Lemonban-Media-Type': 'lemonban.v2'}
【DEBUG】| 2021-06-24 17:02:39.034027 |: 全局变量:
host:'http://api.lemonban.com/futureloan/3'
member_id:{'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Content-Length': '50', 'Content-Type': 'application/json', 'Host': 'httpbin.org', 'User-Agent': 'python-requests/2.24.0', 'X-Amzn-Trace-Id': 'Root=1-60d44a2e-2679157f5f68795c1135a855', 'X-Lemonban-Media-Type': 'lemonban.v2'}
【DEBUG】| 2021-06-24 17:02:39.034027 |: 局部变量:
user_mobile:'17792837966'
admin_mobile:'17792837966'
timestamp:1624525358.5334773
token:{'mobile_phone': '17792837966', 'pwd': 'lemonban'}
【INFO】| 2021-06-24 17:02:39.034027 |: 断言表达式:['eq', 200, 'status_code']
【INFO】| 2021-06-24 17:02:39.034027 |: 断言http响应状态码是否和预期一致
【INFO】| 2021-06-24 17:02:39.034027 |: 预期结果:200 
【INFO】| 2021-06-24 17:02:39.034027 |: 实际结果:200
【INFO】| 2021-06-24 17:02:39.035027 |: 断言通过!
【INFO】| 2021-06-24 17:02:39.035027 |: test_01_post (apin.core.basecase.TestCase0)执行——>【通过】
预期结果 实际结果 断言方法 断言结果
200 200 eq 通过
host:'http://api.lemonban.com/futureloan/3'
member_id:{'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Content-Length': '50', 'Content-Type': 'application/json', 'Host': 'httpbin.org', 'User-Agent': 'python-requests/2.24.0', 'X-Amzn-Trace-Id': 'Root=1-60d44a2e-2679157f5f68795c1135a855', 'X-Lemonban-Media-Type': 'lemonban.v2'}
user_mobile:'17792837966'
admin_mobile:'17792837966'
timestamp:1624525358.5334773
token:{'mobile_phone': '17792837966', 'pwd': 'lemonban'}
变量名 级别 提取方式 提取规则 提取结果
token env jsonpath $..json

{'mobile_phone': '17792837966', 'pwd': 'lemonban'}

member_id ENV jsonpath $..headers

{'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Content-Length': '50', 'Content-Type': 'application/json', 'Host': 'httpbin.org', 'User-Agent': 'python-requests/2.24.0', 'X-Amzn-Trace-Id': 'Root=1-60d44a2e-2679157f5f68795c1135a855', 'X-Lemonban-Media-Type': 'lemonban.v2'}

User-Agent:python-requests/2.24.0
Accept-Encoding:gzip, deflate
Accept:*/*
Connection:keep-alive
X-Lemonban-Media-Type:lemonban.v2
Content-Length:50
Content-Type:application/json
{
  "mobile_phone": "17792837966",
  "pwd": "lemonban"
}
Date:Thu, 24 Jun 2021 09:02:38 GMT
Content-Type:application/json
Content-Length:601
Connection:keep-alive
Server:gunicorn/19.9.0
Access-Control-Allow-Origin:*
Access-Control-Allow-Credentials:true
{
  "args": {},
  "data": "{\"mobile_phone\": \"17792837966\", \"pwd\": \"lemonban\"}",
  "files": {},
  "form": {},
  "headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate",
    "Content-Length": "50",
    "Content-Type": "application/json",
    "Host": "httpbin.org",
    "User-Agent": "python-requests/2.24.0",
    "X-Amzn-Trace-Id": "Root=1-60d44a2e-2679157f5f68795c1135a855",
    "X-Lemonban-Media-Type": "lemonban.v2"
  },
  "json": {
    "mobile_phone": "17792837966",
    "pwd": "lemonban"
  },
  "origin": "175.9.120.74",
  "url": "http://httpbin.org/post"
}
2 TestCase0 test_02_post json-demo-2 0.244s 成功
请求方法:POST 请求地址:http://httpbin.org/post 响应状态码:200
【INFO】| 2021-06-24 17:02:39.035027 |: 开始执行用例:【test_02_post (apin.core.basecase.TestCase0)】
【DEBUG】| 2021-06-24 17:02:39.035027 |: 全局变量:
host:'http://api.lemonban.com/futureloan/3'
member_id:{'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Content-Length': '50', 'Content-Type': 'application/json', 'Host': 'httpbin.org', 'User-Agent': 'python-requests/2.24.0', 'X-Amzn-Trace-Id': 'Root=1-60d44a2e-2679157f5f68795c1135a855', 'X-Lemonban-Media-Type': 'lemonban.v2'}
【DEBUG】| 2021-06-24 17:02:39.035027 |: 局部变量:
user_mobile:'17792837966'
admin_mobile:'17792837966'
timestamp:1624525359.0350273
token:{'mobile_phone': '17792837966', 'pwd': 'lemonban'}
【INFO】| 2021-06-24 17:02:39.035027 |: 正在发送请求:
【DEBUG】| 2021-06-24 17:02:39.277351 |: [POST]: http://httpbin.org/post 
【DEBUG】| 2021-06-24 17:02:39.278349 |: 请求信息如下:
Request Headers:
      User-Agent:python-requests/2.24.0
      Accept-Encoding:gzip, deflate
      Accept:*/*
      Connection:keep-alive
      X-Lemonban-Media-Type:lemonban.v2
      Content-Length:61
      Content-Type:application/json
Request body:
{
  "mobile_phone": "17792837966",
  "pwd": "lemonban",
  "type": 0
}
【DEBUG】| 2021-06-24 17:02:39.278349 |: 接收后台的响应结果,响应信息如下:
Response Headers:
      User-Agent:python-requests/2.24.0
      Accept-Encoding:gzip, deflate
      Accept:*/*
      Connection:keep-alive
      X-Lemonban-Media-Type:lemonban.v2
      Content-Length:61
      Content-Type:application/json
Response body:
{
  "args": {},
  "data": "{\"mobile_phone\": \"17792837966\", \"pwd\": \"lemonban\", \"type\": 0}",
  "files": {},
  "form": {},
  "headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate",
    "Content-Length": "61",
    "Content-Type": "application/json",
    "Host": "httpbin.org",
    "User-Agent": "python-requests/2.24.0",
    "X-Amzn-Trace-Id": "Root=1-60d44a2f-1c848bdd6b66e0eb7dcea472",
    "X-Lemonban-Media-Type": "lemonban.v2"
  },
  "json": {
    "mobile_phone": "17792837966",
    "pwd": "lemonban",
    "type": 0
  },
  "origin": "175.9.120.74",
  "url": "http://httpbin.org/post"
}
【INFO】| 2021-06-24 17:02:39.278349 |: 从响应结果中开始提取数据
【INFO】| 2021-06-24 17:02:39.278349 |: 提取变量:token,提取方式【jsonpath】,提取表达式:$..json,提取值为:{'mobile_phone': '17792837966', 'pwd': 'lemonban', 'type': 0}
【INFO】| 2021-06-24 17:02:39.278349 |: 提取变量:member_id,提取方式【jsonpath】,提取表达式:$..data,提取值为:{"mobile_phone": "17792837966", "pwd": "lemonban", "type": 0}
【DEBUG】| 2021-06-24 17:02:39.278349 |: 全局变量:
host:'http://api.lemonban.com/futureloan/3'
member_id:{'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Content-Length': '50', 'Content-Type': 'application/json', 'Host': 'httpbin.org', 'User-Agent': 'python-requests/2.24.0', 'X-Amzn-Trace-Id': 'Root=1-60d44a2e-2679157f5f68795c1135a855', 'X-Lemonban-Media-Type': 'lemonban.v2'}
【DEBUG】| 2021-06-24 17:02:39.279347 |: 局部变量:
user_mobile:'17792837966'
admin_mobile:'17792837966'
timestamp:1624525359.0350273
token:{'mobile_phone': '17792837966', 'pwd': 'lemonban', 'type': 0}
member_id:'{"mobile_phone": "17792837966", "pwd": "lemonban", "type": 0}'
【INFO】| 2021-06-24 17:02:39.279347 |: 断言表达式:['eq', 200, 'status_code']
【INFO】| 2021-06-24 17:02:39.279347 |: 断言http响应状态码是否和预期一致
【INFO】| 2021-06-24 17:02:39.279347 |: 预期结果:200 
【INFO】| 2021-06-24 17:02:39.279347 |: 实际结果:200
【INFO】| 2021-06-24 17:02:39.279347 |: 断言通过!
【INFO】| 2021-06-24 17:02:39.279347 |: test_02_post (apin.core.basecase.TestCase0)执行——>【通过】
预期结果 实际结果 断言方法 断言结果
200 200 eq 通过
host:'http://api.lemonban.com/futureloan/3'
member_id:{'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Content-Length': '50', 'Content-Type': 'application/json', 'Host': 'httpbin.org', 'User-Agent': 'python-requests/2.24.0', 'X-Amzn-Trace-Id': 'Root=1-60d44a2e-2679157f5f68795c1135a855', 'X-Lemonban-Media-Type': 'lemonban.v2'}
user_mobile:'17792837966'
admin_mobile:'17792837966'
timestamp:1624525359.0350273
token:{'mobile_phone': '17792837966', 'pwd': 'lemonban', 'type': 0}
member_id:'{"mobile_phone": "17792837966", "pwd": "lemonban", "type": 0}'
变量名 级别 提取方式 提取规则 提取结果
token env jsonpath $..json

{'mobile_phone': '17792837966', 'pwd': 'lemonban', 'type': 0}

member_id env jsonpath $..data

{"mobile_phone": "17792837966", "pwd": "lemonban", "type": 0}

User-Agent:python-requests/2.24.0
Accept-Encoding:gzip, deflate
Accept:*/*
Connection:keep-alive
X-Lemonban-Media-Type:lemonban.v2
Content-Length:61
Content-Type:application/json
{
  "mobile_phone": "17792837966",
  "pwd": "lemonban",
  "type": 0
}
Date:Thu, 24 Jun 2021 09:02:39 GMT
Content-Type:application/json
Content-Length:630
Connection:keep-alive
Server:gunicorn/19.9.0
Access-Control-Allow-Origin:*
Access-Control-Allow-Credentials:true
{
  "args": {},
  "data": "{\"mobile_phone\": \"17792837966\", \"pwd\": \"lemonban\", \"type\": 0}",
  "files": {},
  "form": {},
  "headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate",
    "Content-Length": "61",
    "Content-Type": "application/json",
    "Host": "httpbin.org",
    "User-Agent": "python-requests/2.24.0",
    "X-Amzn-Trace-Id": "Root=1-60d44a2f-1c848bdd6b66e0eb7dcea472",
    "X-Lemonban-Media-Type": "lemonban.v2"
  },
  "json": {
    "mobile_phone": "17792837966",
    "pwd": "lemonban",
    "type": 0
  },
  "origin": "175.9.120.74",
  "url": "http://httpbin.org/post"
}