diff --git a/OutPut/reports/report.html b/OutPut/reports/report.html index aee4558..666fc67 100644 --- a/OutPut/reports/report.html +++ b/OutPut/reports/report.html @@ -220,7 +220,7 @@
- 2023-09-12 19:13:50 + 2023-09-14 03:57:30
@@ -230,7 +230,7 @@
- 8.96 S + 0.65 S
@@ -240,11 +240,11 @@
- 3 + 2
- 25% + 16%
@@ -269,6 +269,13 @@ + + 2023-09-14 03:57:30 + 12 + 2 + 16% + + 2023-09-12 19:13:50 12 @@ -1796,8 +1803,96 @@ 1 TestProjectApi - test_api_001_清表 - 初始化查询sql + test_api_001_postman + 注册-/api/auth/register + 0.413s + + 成功 + + + + + + + + +
| 请求地址 --> https://api.shop.eduwork.cn/api/auth/register
+| 请求方法 --> POST
+| 请求头 --> {'Content-Length': '106', 'Content-Type': 'application/json'}
+| 请求 body --> b'{"name": "69209", "email": "xiulanjiang@example.net", "password": 123456, "password_confirmation": 123456}'
+| 接口状态--> 201
+| 接口耗时--> 0:00:00.283209
+| 接口响应--> 
+| 断言结果-->[{'检查项': '201', '期望值': '201', '实际值': '201', '断言方法': 'eq:实际值与期望值相等', '断言结果': '通过'}]
+
+--------------------------------------------------我是分割线--------------------------------------------------
+test_api_001_postman (test_executor.TestProjectApi)执行——>【通过】
+
+ + + + + + + 2 + TestProjectApi + test_api_002_postman + 登录-/api/auth/login + 0.23s + + 成功 + + + + + + + + +
| 请求地址 --> https://api.shop.eduwork.cn/api/auth/login
+| 请求方法 --> POST
+| 请求头 --> {'Content-Length': '56', 'Content-Type': 'application/json'}
+| 请求 body --> b'{"email": "xiulanjiang@example.net", "password": 123456}'
+| 接口状态--> 200
+| 接口耗时--> 0:00:00.143225
+| 接口响应--> {"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2FwaS5zaG9wLmVkdXdvcmsuY24vYXBpL2F1dGgvbG9naW4iLCJpYXQiOjE2OTQ2MzUwNTAsImV4cCI6MTY5NDk5NTA1MCwibmJmIjoxNjk0NjM1MDUwLCJqdGkiOiJtTFlxbEY0dHc3STNPbjFYIiwic3ViIjoiMTcyMjAiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.HoiAdlA7a_AQ1yEGHSUbN6j8cH9JxwSDssy9ZWM4F0Y","token_type":"Bearer","expires_in":360000}
+| 断言结果-->[{'检查项': '200', '期望值': '200', '实际值': '200', '断言方法': 'eq:实际值与期望值相等', '断言结果': '通过'}]
+
+--------------------------------------------------我是分割线--------------------------------------------------
+test_api_002_postman (test_executor.TestProjectApi)执行——>【通过】
+
+ + + + + + + 3 + TestProjectApi + test_api_003_postman + 刷新token-api/auth/refresh + 0.001s + + 跳过 + + + + + + + + +
这个测试用例听说泡面比较好吃,所以放弃执行了!!
+ + + + + + + 4 + TestProjectApi + test_api_004_postman + 查询商品列表-/api/goods 0.0s 跳过 @@ -1815,182 +1910,14 @@ - - 2 - TestProjectApi - test_api_002_注册 - 正确的随机邮箱注册成功 - 6.19s - - 成功 - - - - - - - - -
| 执行 sql 成功--> {'select_one': [{'name': 'kira', 'age': 18}]}
-pm----------------> {'Url': '/api/register', 'Headers': '{"Content-Type": "application/json"}', 'HeadersCrypto': None, 'QueryString': None, 'RequestDataType': 'json', 'RequestData': '{"email": "{{email}}", "password": "{{password}}"}', 'RequestDataCrypto': None, 'Response': '', 'Assertion': '', 'ErrorLog': '', None: None}
-前置脚本请求对象= {'Url': '/api/register', 'Headers': '{"Content-Type": "application/json"}', 'HeadersCrypto': None, 'QueryString': None, 'RequestDataType': 'json', 'RequestData': '{"email": "{{email}}", "password": "{{password}}"}', 'RequestDataCrypto': None, 'Response': '', 'Assertion': '', 'ErrorLog': '', None: None}
-获取请求URL: /api/register
-获取请求Header: {'Content-Type': 'application/json'}
-获取请求数据: {'email': '{{email}}', 'password': '{{password}}'}
----->获取环境变量=这个是你想要的值
-| 第1次请求参数=【(Action(), 'https://reqres.in', '/api/register', 'post')__{'json': '{"email": "eve.holt@reqres.in", "password": "pistol"}', 'headers': '{"Content-Type": "application/json"}', 'params': None}】
-| 请求地址 --> https://reqres.in/api/register
-| 请求方法 --> POST
-| 请求头 --> {'Content-Type': 'application/json', 'Content-Length': '53'}
-| 请求 body --> b'{"email": "eve.holt@reqres.in", "password": "pistol"}'
-| 接口状态--> 200
-| 接口耗时--> 0:00:00.811371
-| 接口响应--> {"id":4,"token":"QpwL5tke4Pnpja7X4"}
-后置脚本响应对象= (Response [200])
-响应对象转json: {'id': 4, 'token': 'QpwL5tke4Pnpja7X4'}
-响应对象转text: {"id":4,"token":"QpwL5tke4Pnpja7X4"}
-获取环境变量={'id': 4, 'token': 'QpwL5tke4Pnpja7X4'}
-| 断言结果-->[{'检查项': '200', '期望值': '200', '实际值': '200', '断言方法': 'eq:实际值与期望值相等', '断言结果': '通过'}]
-
---------------------------------------------------我是分割线--------------------------------------------------
-test_api_002_注册 (test_executor.TestProjectApi)执行——>【通过】
-
- - - - - - - 3 - TestProjectApi - test_api_003_登录 - 注册成功的账号可以登录成功 - 1.07s - - 成功 - - - - - - - - -
| 请求地址 --> https://reqres.in/api/login
-| 请求方法 --> POST
-| 请求头 --> {'Content-Type': 'application/json', 'Content-Length': '53'}
-| 请求 body --> b'{"email": "eve.holt@reqres.in", "password": "pistol"}'
-| 接口状态--> 200
-| 接口耗时--> 0:00:00.463100
-| 接口响应--> {"token":"QpwL5tke4Pnpja7X4"}
-请求地址 --> https://reqres.in/api/login
-请求头 --> {'Content-Type': 'application/json', 'Content-Length': '53'}
-请求 body --> b'{"email": "eve.holt@reqres.in", "password": "pistol"}'
-接口状态--> 200
-接口耗时--> 0:00:00.463100
-接口响应--> {"token":"QpwL5tke4Pnpja7X4"}
-| 断言结果-->[{'检查项': '200', '期望值': '200', '实际值': '200', '断言方法': 'eq:实际值与期望值相等', '断言结果': '通过'}, {'检查项': 463.1, '期望值': 300, '实际值': 463.1, '断言方法': 'gte:实际值大于或等于期望值', '断言结果': '通过'}]
-
---------------------------------------------------我是分割线--------------------------------------------------
-test_api_003_登录 (test_executor.TestProjectApi)执行——>【通过】
-
- - - - - - - 4 - TestProjectApi - test_api_004_用户列表 - 查询用户列表 - 0.257s - - 失败 - - - - - - - - -
开始执行md5_sign加密,待加密参数={'Content-Type': 'application/json;charset=utf-8', 'token': 'QpwL5tke4Pnpja7X4'}
-| 请求地址 --> https://reqres.in/api/users?page=1
-| 请求方法 --> GET
-| 请求头 --> {'Content-Type': 'application/json;charset=utf-8', 'token': 'QpwL5tke4Pnpja7X4', 'sign': '14f25b9fed8dac0feba78ea42acf8b35'}
-| 请求 body --> None
-| 接口状态--> 200
-| 接口耗时--> 0:00:00.160911
-| 接口响应--> {"page":1,"per_page":6,"total":12,"total_pages":2,"data":[{"id":1,"email":"george.bluth@reqres.in","first_name":"George","last_name":"Bluth","avatar":"https://reqres.in/img/faces/1-image.jpg"},{"id":2,"email":"janet.weaver@reqres.in","first_name":"Janet","last_name":"Weaver","avatar":"https://reqres.in/img/faces/2-image.jpg"},{"id":3,"email":"emma.wong@reqres.in","first_name":"Emma","last_name":"Wong","avatar":"https://reqres.in/img/faces/3-image.jpg"},{"id":4,"email":"eve.holt@reqres.in","first_name":"Eve","last_name":"Holt","avatar":"https://reqres.in/img/faces/4-image.jpg"},{"id":5,"email":"charles.morris@reqres.in","first_name":"Charles","last_name":"Morris","avatar":"https://reqres.in/img/faces/5-image.jpg"},{"id":6,"email":"tracey.ramos@reqres.in","first_name":"Tracey","last_name":"Ramos","avatar":"https://reqres.in/img/faces/6-image.jpg"}],"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}}
-| 断言结果-->[{'检查项': '200', '期望值': 200, '实际值': '200', '断言方法': 'eq:实际值与期望值相等', '断言结果': '失败'}]
-
---------------------------------------------------我是分割线--------------------------------------------------
-test_api_004_用户列表 (test_executor.TestProjectApi)执行——>【失败】
-
- -
Traceback (most recent call last):
-
- -
  File "d:\python3.9\lib\unittest\case.py", line 59, in testPartExecutor
-    yield
-
- -
  File "d:\python3.9\lib\unittest\case.py", line 593, in run
-    self._callTestMethod(testMethod)
-
- -
  File "d:\python3.9\lib\unittest\case.py", line 550, in _callTestMethod
-    method()
-
- -
  File "E:\production\apitest\common\core\dataDriver.py", line 43, in wrapper
-    return func(self, params, *args, **kwargs)
-
- -
  File "E:\production\apitest\test_script\test_executor.py", line 50, in test_api
-    self.action.execute_validation(excel, sheet, iid, name, desc, expected)
-
- -
  File "E:\production\apitest\common\core\action.py", line 96, in execute_validation
-    raise e
-
- -
  File "E:\production\apitest\common\core\action.py", line 86, in execute_validation
-    res = self.run_validate(expected, self.response_json)
-
- -
  File "E:\production\apitest\common\validation\validator.py", line 116, in run_validate
-    self.validate(resp)
-
- -
  File "E:\production\apitest\common\validation\validator.py", line 87, in validate
-    raise e
-
- -
  File "E:\production\apitest\common\validation\validator.py", line 83, in validate
-    fun(actual_value=actual_value, expect_value=expect_value)
-
- -
  File "E:\production\apitest\common\validation\comparators.py", line 30, in eq
-    assert actual_value == expect_value, p_string(actual_value, expect_value)
-
- -
AssertionError: 预期:200 -> (class 'str'), 实际:200 -> (class 'int')
-
- - - - - 5 TestProjectApi - test_api_005_用户列表 - 获取指定用户的信息 - 0.251s + test_api_005_postman + 获取商品详情-/api/goods/{{goodId}} + 0.0s - 成功 + 跳过 @@ -1999,18 +1926,7 @@ test_api_004_用户列表 (test_executor.TestProjectApi)执行——>【失败 -
| 请求地址 --> https://reqres.in/api/users/4
-| 请求方法 --> GET
-| 请求头 --> {'Content-Type': 'application/json;charset=utf-8', 'token': 'QpwL5tke4Pnpja7X4'}
-| 请求 body --> None
-| 接口状态--> 200
-| 接口耗时--> 0:00:00.165761
-| 接口响应--> {"data":{"id":4,"email":"eve.holt@reqres.in","first_name":"Eve","last_name":"Holt","avatar":"https://reqres.in/img/faces/4-image.jpg"},"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}}
-| 断言结果-->[{'检查项': '$.data.id', '期望值': 4, '实际值': 4, '断言方法': 'eq:实际值与期望值相等', '断言结果': '通过'}, {'检查项': '$.data.email', '期望值': 'eve.holt@reqres.in', '实际值': 'eve.holt@reqres.in', '断言方法': 'eq:实际值与期望值相等', '断言结果': '通过'}, {'检查项': '200', '期望值': '200', '实际值': '200', '断言方法': 'eq:实际值与期望值相等', '断言结果': '通过'}]
-
---------------------------------------------------我是分割线--------------------------------------------------
-test_api_005_用户列表 (test_executor.TestProjectApi)执行——>【通过】
-
+
这个测试用例听说泡面比较好吃,所以放弃执行了!!
@@ -2019,9 +1935,9 @@ test_api_005_用户列表 (test_executor.TestProjectApi)执行——>【通过 6 TestProjectApi - test_api_006_None - None - 0.001s + test_api_006_postman + 查看购物车列表-/api/carts + 0.0s 跳过 @@ -2041,11 +1957,11 @@ test_api_005_用户列表 (test_executor.TestProjectApi)执行——>【通过 7 TestProjectApi - test_api_007_文件上传 - 文件上传 - 1.19s + test_api_007_postman + 添加商品进入购物车-/api/carts + 0.0s - 失败 + 跳过 @@ -2054,56 +1970,7 @@ test_api_005_用户列表 (test_executor.TestProjectApi)执行——>【通过 -
| 请求地址 --> https://bimdc.bzlrobot.com/bsp/pre/user/ugs/ibs/api/ibs-file/file-upload/upload-image
-| 请求方法 --> POST
-| 请求头 --> {'BSP_TOKEN': '7c7d70bfb079d72182156d9b80d7911c', 'USER_ENV_ID': '1320970534539886592', 'USER_ID': '60629040', 'USER_TENANT': '1320970534539886592', 'Content-Length': '170', 'Content-Type': 'multipart/form-data; boundary=9a150998ef4ddb384b9b3fc8300097bc'}
-| 请求 body --> b'--9a150998ef4ddb384b9b3fc8300097bc\r\nContent-Disposition: form-data; name="file"; filename="test.txt"\r\nContent-Type: text/plain\r\n\r\n\r\n--9a150998ef4ddb384b9b3fc8300097bc--\r\n'
-| 接口状态--> 503
-| 接口耗时--> 0:00:00.079066
-| 接口响应--> {"code":503,"data":null,"message":"Failed to handle request [POST https://ibs-gateway.ibs-pre/ibs-file/file-upload/upload-image]: 503 SERVICE_UNAVAILABLE \"Unable to find instance for APP-API\""}
-| 断言结果-->未填写断言信息,默认执行断言请求返回的状态码!!!
-
---------------------------------------------------我是分割线--------------------------------------------------
-test_api_007_文件上传 (test_executor.TestProjectApi)执行——>【失败】
-
- -
Traceback (most recent call last):
-
- -
  File "d:\python3.9\lib\unittest\case.py", line 59, in testPartExecutor
-    yield
-
- -
  File "d:\python3.9\lib\unittest\case.py", line 593, in run
-    self._callTestMethod(testMethod)
-
- -
  File "d:\python3.9\lib\unittest\case.py", line 550, in _callTestMethod
-    method()
-
- -
  File "E:\production\apitest\common\core\dataDriver.py", line 43, in wrapper
-    return func(self, params, *args, **kwargs)
-
- -
  File "E:\production\apitest\test_script\test_executor.py", line 50, in test_api
-    self.action.execute_validation(excel, sheet, iid, name, desc, expected)
-
- -
  File "E:\production\apitest\common\core\action.py", line 96, in execute_validation
-    raise e
-
- -
  File "E:\production\apitest\common\core\action.py", line 90, in execute_validation
-    eq(200, self.response.status_code)
-
- -
  File "E:\production\apitest\common\validation\comparators.py", line 30, in eq
-    assert actual_value == expect_value, p_string(actual_value, expect_value)
-
- -
AssertionError: 预期:200 -> (class 'int'), 实际:503 -> (class 'int')
-
+
这个测试用例听说泡面比较好吃,所以放弃执行了!!
@@ -2112,8 +1979,8 @@ test_api_007_文件上传 (test_executor.TestProjectApi)执行——>【失败 8 TestProjectApi - test_api_008_None - None + test_api_008_postman + 再次查看购物车列表-/api/carts 0.0s 跳过 @@ -2134,8 +2001,8 @@ test_api_007_文件上传 (test_executor.TestProjectApi)执行——>【失败 9 TestProjectApi - test_api_009_None - None + test_api_009_postman + 修改购物车商品数量-/api/carts/{{cart}} 0.0s 跳过 @@ -2156,9 +2023,9 @@ test_api_007_文件上传 (test_executor.TestProjectApi)执行——>【失败 10 TestProjectApi - test_api_010_None - None - 0.00101s + test_api_010_postman + 购物车改变选中商品-/api/carts/checked + 0.0s 跳过 @@ -2178,8 +2045,8 @@ test_api_007_文件上传 (test_executor.TestProjectApi)执行——>【失败 11 TestProjectApi - test_api_011_None - None + test_api_011_postman + 购物车商品变成预览订单-/api/orders/preview 0.0s 跳过 @@ -2200,8 +2067,8 @@ test_api_007_文件上传 (test_executor.TestProjectApi)执行——>【失败 12 TestProjectApi - test_api_012_None - None + test_api_012_postman + 提交订单-/api/orders 0.0s 跳过 @@ -2229,16 +2096,16 @@ test_api_007_文件上传 (test_executor.TestProjectApi)执行——>【失败