This commit is contained in:
Albert 2023-11-29 10:49:50 +08:00
parent 764dc03d01
commit c38c21b93e
2 changed files with 109 additions and 2 deletions

105
logs/2023_11_29_104806.log Normal file
View File

@ -0,0 +1,105 @@
[INFO]-[2023-11-29 10:48:06,213]---------------------------------------------------------------------------------------------------------
_ _ _____ _
__ _ _ __ (_) / \ _ _| |_ __|_ _|__ ___| |_
/ _` | '_ \| | / _ \| | | | __/ _ \| |/ _ \/ __| __|
| (_| | |_) | |/ ___ \ |_| | || (_) | | __/\__ \ |_
\__,_| .__/|_/_/ \_\__,_|\__\___/|_|\___||___/\__|
|_|
-----------------------------------------------------------------开始执行接口自动化测试项目
[INFO]-[2023-11-29 10:48:06,410]--------------成功连接到Mysql数据库host:api.lemonban.comdatabase:future-----------------
[INFO]-[2023-11-29 10:48:06,430]----------------------------------------------接口请求开始---------------------------------------------
[INFO]-[2023-11-29 10:48:06,431]-接口名称:外卖注册
[INFO]-[2023-11-29 10:48:06,431]-请求方式:post
[INFO]-[2023-11-29 10:48:06,431]-请求路径:https://api.tttt.one/rest-v2/login/sign_up
[INFO]-[2023-11-29 10:48:06,432]-请求头:{}
[INFO]-[2023-11-29 10:48:06,432]-请求参数:{'password': '12345678', 'email': '97245820@qq.com'}
[INFO]-[2023-11-29 10:48:06,433]-文件上传None
[INFO]-[2023-11-29 10:48:08,194]-响应头content_type:application/json
[INFO]-[2023-11-29 10:48:08,195]-预期结果:[{'contains': 'create_datetime'}]
[INFO]-[2023-11-29 10:48:08,196]-实际结果:{'id': 48, 'email': '97245820@qq.com', 'create_datetime': '2023-11-29T02:48:05.691797+00:00', 'update_datetime': '2023-11-29T02:48:05.894800+00:00'}
[INFO]-[2023-11-29 10:48:08,196]-接口请求成功!
[INFO]-[2023-11-29 10:48:08,196]---------------------------------------------接口请求结束--------------------------------------------
[INFO]-[2023-11-29 10:48:08,226]----------------------------------------------接口请求开始---------------------------------------------
[INFO]-[2023-11-29 10:48:08,226]-接口名称:外卖登录
[INFO]-[2023-11-29 10:48:08,226]-请求方式:post
[INFO]-[2023-11-29 10:48:08,226]-请求路径:https://api.tttt.one/rest-v2/login/access_token
[INFO]-[2023-11-29 10:48:08,227]-请求头:{}
[INFO]-[2023-11-29 10:48:08,227]-请求参数:{'password': '12345678', 'email': '1144961647@qq.com'}
[INFO]-[2023-11-29 10:48:08,227]-文件上传None
[INFO]-[2023-11-29 10:48:08,788]-响应头content_type:application/json
[INFO]-[2023-11-29 10:48:08,791]-提取到接口关联的参数:{'token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDE5MTcyODYsInN1YiI6IjQ3In0.SliYp1aHfHUG58bJS-IwjAR-x_mxUssic9Ct6B2dD7U'}
[INFO]-[2023-11-29 10:48:08,792]-预期结果:[{'contains': 'access_token'}]
[INFO]-[2023-11-29 10:48:08,792]-实际结果:{'access_token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDE5MTcyODYsInN1YiI6IjQ3In0.SliYp1aHfHUG58bJS-IwjAR-x_mxUssic9Ct6B2dD7U', 'token_type': 'bearer'}
[INFO]-[2023-11-29 10:48:08,792]-接口请求成功!
[INFO]-[2023-11-29 10:48:08,793]---------------------------------------------接口请求结束--------------------------------------------
[INFO]-[2023-11-29 10:48:08,838]----------------------------------------------接口请求开始---------------------------------------------
[INFO]-[2023-11-29 10:48:08,838]-接口名称:外卖任务创建
[INFO]-[2023-11-29 10:48:08,838]-请求方式:post
[INFO]-[2023-11-29 10:48:08,839]-请求路径:https://api.tttt.one/rest-v2/todo
[INFO]-[2023-11-29 10:48:08,839]-请求头:{'Content-Type': 'application/json', 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDE5MTcyODYsInN1YiI6IjQ3In0.SliYp1aHfHUG58bJS-IwjAR-x_mxUssic9Ct6B2dD7U'}
[INFO]-[2023-11-29 10:48:08,839]-请求参数:{'title': 'null', 'is_done': False}
[INFO]-[2023-11-29 10:48:08,840]-文件上传None
[INFO]-[2023-11-29 10:48:09,195]-响应头content_type:application/json
[INFO]-[2023-11-29 10:48:09,197]-提取到接口关联的参数:{'todo_id': 20}
[INFO]-[2023-11-29 10:48:09,197]-预期结果:[{'contains': 'id'}]
[INFO]-[2023-11-29 10:48:09,198]-实际结果:{'id': 20, 'title': 'null', 'is_done': False, 'create_datetime': '2023-11-29T02:48:06.897748+00:00', 'done_datetime': '2023-11-29T02:48:06.897760+00:00'}
[INFO]-[2023-11-29 10:48:09,198]-接口请求成功!
[INFO]-[2023-11-29 10:48:09,198]---------------------------------------------接口请求结束--------------------------------------------
[INFO]-[2023-11-29 10:48:09,234]----------------------------------------------接口请求开始---------------------------------------------
[INFO]-[2023-11-29 10:48:09,235]-接口名称:外卖任务查询
[INFO]-[2023-11-29 10:48:09,235]-请求方式:get
[INFO]-[2023-11-29 10:48:09,235]-请求路径:https://api.tttt.one/rest-v2/todo
[INFO]-[2023-11-29 10:48:09,235]-请求头:{'Content-Type': 'application/json', 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDE5MTcyODYsInN1YiI6IjQ3In0.SliYp1aHfHUG58bJS-IwjAR-x_mxUssic9Ct6B2dD7U'}
[INFO]-[2023-11-29 10:48:09,235]-文件上传None
[INFO]-[2023-11-29 10:48:09,591]-响应头content_type:application/json
[INFO]-[2023-11-29 10:48:09,593]-预期结果:[{'contains': 'items'}]
[INFO]-[2023-11-29 10:48:09,593]-实际结果:{'items': [{'id': 20, 'title': 'null', 'is_done': False, 'create_datetime': '2023-11-29T02:48:06.897748+00:00', 'done_datetime': '2023-11-29T02:48:06.897760+00:00'}, {'id': 19, 'title': 'null', 'is_done': False, 'create_datetime': '2023-11-29T02:47:42.161323+00:00', 'done_datetime': '2023-11-29T02:47:42.161338+00:00'}], 'total': 2, 'page': 1, 'size': 50}
[INFO]-[2023-11-29 10:48:09,594]-接口请求成功!
[INFO]-[2023-11-29 10:48:09,594]---------------------------------------------接口请求结束--------------------------------------------
[INFO]-[2023-11-29 10:48:09,629]----------------------------------------------接口请求开始---------------------------------------------
[INFO]-[2023-11-29 10:48:09,630]-接口名称:外卖任务详情
[INFO]-[2023-11-29 10:48:09,630]-请求方式:get
[INFO]-[2023-11-29 10:48:09,630]-请求路径:https://api.tttt.one/rest-v2/todo
[INFO]-[2023-11-29 10:48:09,630]-请求头:{'Content-Type': 'application/json', 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDE5MTcyODYsInN1YiI6IjQ3In0.SliYp1aHfHUG58bJS-IwjAR-x_mxUssic9Ct6B2dD7U'}
[INFO]-[2023-11-29 10:48:09,631]-请求参数:{'todo_id': '20'}
[INFO]-[2023-11-29 10:48:09,631]-文件上传None
[INFO]-[2023-11-29 10:48:10,882]-响应头content_type:application/json
[INFO]-[2023-11-29 10:48:10,884]-预期结果:[{'contains': 'id'}]
[INFO]-[2023-11-29 10:48:10,884]-实际结果:{'items': [{'id': 20, 'title': 'null', 'is_done': False, 'create_datetime': '2023-11-29T02:48:06.897748+00:00', 'done_datetime': '2023-11-29T02:48:06.897760+00:00'}, {'id': 19, 'title': 'null', 'is_done': False, 'create_datetime': '2023-11-29T02:47:42.161323+00:00', 'done_datetime': '2023-11-29T02:47:42.161338+00:00'}], 'total': 2, 'page': 1, 'size': 50}
[INFO]-[2023-11-29 10:48:10,885]-接口请求成功!
[INFO]-[2023-11-29 10:48:10,885]---------------------------------------------接口请求结束--------------------------------------------
[INFO]-[2023-11-29 10:48:10,918]----------------------------------------------接口请求开始---------------------------------------------
[INFO]-[2023-11-29 10:48:10,919]-接口名称:外卖任务修改
[INFO]-[2023-11-29 10:48:10,919]-请求方式:put
[INFO]-[2023-11-29 10:48:10,919]-请求路径:https://api.tttt.one/rest-v2/todo/todo_id=20
[INFO]-[2023-11-29 10:48:10,919]-请求头:{'Content-Type': 'application/json', 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDE5MTcyODYsInN1YiI6IjQ3In0.SliYp1aHfHUG58bJS-IwjAR-x_mxUssic9Ct6B2dD7U'}
[INFO]-[2023-11-29 10:48:10,920]-请求参数:{'title': 'null', 'is_done': False}
[INFO]-[2023-11-29 10:48:10,921]-文件上传None
[INFO]-[2023-11-29 10:48:11,284]-响应头content_type:application/json
[INFO]-[2023-11-29 10:48:11,286]-预期结果:[{'contains': 'id'}]
[INFO]-[2023-11-29 10:48:11,286]-实际结果:{'detail': [{'loc': ['path', 'todo_id'], 'msg': 'value is not a valid integer', 'type': 'type_error.integer'}]}
[INFO]-[2023-11-29 10:48:11,286]-接口请求成功!
[INFO]-[2023-11-29 10:48:11,287]---------------------------------------------接口请求结束--------------------------------------------
[INFO]-[2023-11-29 10:48:11,331]----------------------------------------------接口请求开始---------------------------------------------
[INFO]-[2023-11-29 10:48:11,331]-接口名称:外卖任务删除
[INFO]-[2023-11-29 10:48:11,332]-请求方式:delete
[INFO]-[2023-11-29 10:48:11,340]-请求路径:https://api.tttt.one/rest-v2/todo
[INFO]-[2023-11-29 10:48:11,341]-请求头:{'Content-Type': 'application/json', 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDE5MTcyODYsInN1YiI6IjQ3In0.SliYp1aHfHUG58bJS-IwjAR-x_mxUssic9Ct6B2dD7U'}
[INFO]-[2023-11-29 10:48:11,355]-请求参数:{'todo_id': '20'}
[INFO]-[2023-11-29 10:48:11,355]-文件上传None
[INFO]-[2023-11-29 10:48:11,711]-响应头content_type:application/json
[INFO]-[2023-11-29 10:48:11,712]-预期结果:[{'contains': 'detail'}]
[INFO]-[2023-11-29 10:48:11,713]-实际结果:{'detail': [{'loc': ['query', 'all'], 'msg': 'field required', 'type': 'value_error.missing'}]}
[INFO]-[2023-11-29 10:48:11,713]-接口请求成功!
[INFO]-[2023-11-29 10:48:11,713]---------------------------------------------接口请求结束--------------------------------------------
[INFO]-[2023-11-29 10:48:11,813]--------------------------------------------单条数据查询成功!-------------------------------------------
[INFO]-[2023-11-29 10:48:11,814]-接口自动化测试垃圾数据处理结果为:{'id': 108100, 'reg_name': '裴育', 'pwd': '25D55AD283AA400AF464C76D713C07AD', 'mobile_phone': '18326074762', 'type': 1, 'leave_amount': Decimal('12500005.00'), 'reg_time': datetime.datetime(2023, 5, 8, 17, 42, 27)}
[INFO]-[2023-11-29 10:48:11,816]------------------------------------------------接口自动化测试结束------------------------------------------------
[INFO]-[2023-11-29 10:48:21,382]-接口自动化测试完成!

View File

@ -153,7 +153,8 @@ def delete_user():
@api.route('/dar/user/updateUser', methods=['post'])
def update_user():
"""修改用户接口"""
update_user_info = {'username': 'adduser', 'password': '12345678', 'role_id': '89588181111112343', 'dates': '2023-12-31', 'phone': '13800000000'}
update_user_info = {'username': 'adduser', 'password': '12345678', 'role_id': '89588181111112343',
'dates': '2023-12-31', 'phone': '13800000000'}
username = flask.request.form.get('username')
password = flask.request.form.get('password')
role_id = flask.request.form.get('role_id')
@ -502,8 +503,9 @@ def check_logistics_status():
if __name__ == '__main__':
# 第一种启动模式
# debug=True开启debug模式改代码后不用重启会自动重启
# debug=True # 开启debug模式改代码后不用重启会自动重启
# api.run(host='127.0.0.1', port=8080, debug=True)
# 第二种启动模式
api.debug = True
server = pywsgi.WSGIServer(('127.0.0.1', 8080), api)