fix
This commit is contained in:
parent
b3934d5f65
commit
afd736b564
|
@ -1,103 +0,0 @@
|
|||
2023-04-25 16:02:29.218 | WARNING | utils.requests_control:cookie_token:32 - 未获取到登录认证信息,请检查: EOF occurred in violation of protocol (_ssl.c:1131)
|
||||
2023-04-25 16:02:29.260 | WARNING | conftest:__init__:83 - 当前数据库配置: 关闭
|
||||
2023-04-25 16:02:30.574 | INFO | utils.decorator_control:wrapper:34 -
|
||||
请求地址: https://open.xwdsp.com/phegda/advrest
|
||||
请求方法: POST
|
||||
请求头: {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'}
|
||||
请求数据: {'terminal': 'PC', 'apiVersion': '1.0.1', 'site': {'Siteid': 1015, 'siteName': 'waibu', 'qid': '04478', 'pageType': 'null', 'pageUrl': 'https://www.tianqi.com/shanghai/', 'newsType': 'null', 'keywords': '上海天气,上海天气预报,上海天气预报查询,上海今日天气,上海周末天气,上海一周天气预报,上海天气预报一周,天气预报查询一周,上海天气预报10天,上海天气预报查询15天,上海未来一周的天气预报,上海天气情况,上海40日天气预报,天气预报40天,上海30日天气预报,天气预报30天'}, 'device': {'userAgent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36', 'geo': {'country': '', 'city': ''}, 'dnt': 0, 'deviceType': 'PC', 'os': 'MACOS', 'osVersion': 'X', 'height': 1080, 'width': 1920}, 'user': {'userId': '16805156868205498'}, 'imp': [{'slotId': 102298, 'pageNum': '4', 'styleId': [1004]}], 'requestId': '16805156922345810'}
|
||||
响应数据: {'msg': 'bad request ...', 'success': False}
|
||||
响应耗时(ms): 1240.0
|
||||
接口响应码: 400
|
||||
|
||||
2023-04-25 17:15:42.582 | WARNING | utils.requests_control:cookie_token:33 - 未获取到登录认证信息,请检查: <urllib3.connection.HTTPSConnection object at 0x104059dc0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known
|
||||
2023-04-25 17:15:42.621 | WARNING | conftest:__init__:83 - 当前数据库配置: 关闭
|
||||
2023-04-25 17:15:42.769 | INFO | utils.decorator_control:wrapper:34 -
|
||||
请求地址: https://open.xwdsp.com/phegda/advrest
|
||||
请求方法: POST
|
||||
请求头: {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'}
|
||||
请求数据: {'terminal': 'PC', 'apiVersion': '1.0.1', 'site': {'Siteid': 1015, 'siteName': 'waibu', 'qid': '04478', 'pageType': 'null', 'pageUrl': 'https://www.tianqi.com/shanghai/', 'newsType': 'null', 'keywords': '上海天气,上海天气预报,上海天气预报查询,上海今日天气,上海周末天气,上海一周天气预报,上海天气预报一周,天气预报查询一周,上海天气预报10天,上海天气预报查询15天,上海未来一周的天气预报,上海天气情况,上海40日天气预报,天气预报40天,上海30日天气预报,天气预报30天'}, 'device': {'userAgent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36', 'geo': {'country': '', 'city': ''}, 'dnt': 0, 'deviceType': 'PC', 'os': 'MACOS', 'osVersion': 'X', 'height': 1080, 'width': 1920}, 'user': {'userId': '16805156868205498'}, 'imp': [{'slotId': 102298, 'pageNum': '5', 'styleId': [1004]}], 'requestId': '16805156922345810'}
|
||||
响应数据: {'msg': 'bad request ...', 'success': False}
|
||||
响应耗时(ms): 80.0
|
||||
接口响应码: 400
|
||||
|
||||
2023-04-25 17:16:53.820 | WARNING | utils.requests_control:cookie_token:33 - 未获取到登录认证信息,请检查: <urllib3.connection.HTTPSConnection object at 0x106295cd0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known
|
||||
2023-04-25 17:16:53.836 | ERROR | utils.read_yaml_control:read_yaml:22 - 文件路径不存在,请检查
|
||||
2023-04-25 17:17:43.671 | WARNING | utils.requests_control:cookie_token:33 - 未获取到登录认证信息,请检查: <urllib3.connection.HTTPSConnection object at 0x102f2ec70>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known
|
||||
2023-04-25 17:17:43.706 | WARNING | conftest:__init__:83 - 当前数据库配置: 关闭
|
||||
2023-04-25 17:17:43.842 | INFO | utils.decorator_control:wrapper:24 - 请求返回结果为text类型
|
||||
2023-04-25 17:17:43.842 | INFO | utils.decorator_control:wrapper:34 -
|
||||
请求地址: https://open.xwdsp.com/login
|
||||
请求方法: POST
|
||||
请求头: {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'}
|
||||
请求数据: {'account': '{{phone_number()}}', 'password': 'xxxxxxxxxx'}
|
||||
响应数据: 404
|
||||
响应耗时(ms): 84.0
|
||||
接口响应码: 404
|
||||
|
||||
2023-04-25 17:17:43.890 | WARNING | conftest:__init__:83 - 当前数据库配置: 关闭
|
||||
2023-04-25 17:17:43.970 | INFO | utils.decorator_control:wrapper:24 - 请求返回结果为text类型
|
||||
2023-04-25 17:17:43.970 | INFO | utils.decorator_control:wrapper:34 -
|
||||
请求地址: https://open.xwdsp.com/login
|
||||
请求方法: POST
|
||||
请求头: {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'}
|
||||
请求数据: {'account': '18900001000', 'password': 'xxxxxx'}
|
||||
响应数据: 404
|
||||
响应耗时(ms): 78.0
|
||||
接口响应码: 404
|
||||
|
||||
2023-04-25 17:28:23.447 | WARNING | utils.requests_control:cookie_token:33 - 未获取到登录认证信息,请检查: <urllib3.connection.HTTPSConnection object at 0x102d1ed00>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known
|
||||
2023-04-25 17:28:23.488 | WARNING | conftest:__init__:83 - 当前数据库配置: 关闭
|
||||
2023-04-25 17:28:23.627 | INFO | utils.decorator_control:wrapper:24 - 请求返回结果为text类型
|
||||
2023-04-25 17:28:23.627 | INFO | utils.decorator_control:wrapper:34 -
|
||||
请求地址: https://open.xwdsp.com/imports
|
||||
请求方法: POST
|
||||
请求头: {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'}
|
||||
请求数据: {'key': '14584996399', 'key2': None}
|
||||
响应数据: 404
|
||||
响应耗时(ms): 89.0
|
||||
接口响应码: 404
|
||||
|
||||
2023-04-25 17:28:23.670 | WARNING | conftest:__init__:83 - 当前数据库配置: 关闭
|
||||
2023-04-25 17:28:23.746 | INFO | utils.decorator_control:wrapper:24 - 请求返回结果为text类型
|
||||
2023-04-25 17:28:23.746 | INFO | utils.decorator_control:wrapper:34 -
|
||||
请求地址: https://open.xwdsp.com/imports
|
||||
请求方法: POST
|
||||
请求头: {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'}
|
||||
请求数据: {'key': ['9819'], 'key2': [None]}
|
||||
响应数据: 404
|
||||
响应耗时(ms): 75.0
|
||||
接口响应码: 404
|
||||
|
||||
2023-04-25 17:28:40.603 | WARNING | utils.requests_control:cookie_token:33 - 未获取到登录认证信息,请检查: <urllib3.connection.HTTPSConnection object at 0x10519ed30>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known
|
||||
2023-04-25 17:28:40.643 | WARNING | conftest:__init__:83 - 当前数据库配置: 关闭
|
||||
2023-04-25 17:28:40.728 | INFO | utils.decorator_control:wrapper:34 -
|
||||
请求地址: https://open.xwdsp.com/phegda/advrest
|
||||
请求方法: POST
|
||||
请求头: {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'}
|
||||
请求数据: {'terminal': 'PC', 'apiVersion': '1.0.1', 'site': {'Siteid': 1015, 'siteName': 'waibu', 'qid': '04478', 'pageType': 'null', 'pageUrl': 'https://www.tianqi.com/shanghai/', 'newsType': 'null', 'keywords': '上海天气,上海天气预报,上海天气预报查询,上海今日天气,上海周末天气,上海一周天气预报,上海天气预报一周,天气预报查询一周,上海天气预报10天,上海天气预报查询15天,上海未来一周的天气预报,上海天气情况,上海40日天气预报,天气预报40天,上海30日天气预报,天气预报30天'}, 'device': {'userAgent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36', 'geo': {'country': '', 'city': ''}, 'dnt': 0, 'deviceType': 'PC', 'os': 'MACOS', 'osVersion': 'X', 'height': 1080, 'width': 1920}, 'user': {'userId': '16805156868205498'}, 'imp': [{'slotId': 102298, 'pageNum': '4', 'styleId': [1004]}], 'requestId': '16805156922345810'}
|
||||
响应数据: {'data': {'ad': [], 'bidId': '3af5848b85f7e4bb31e493d38f3061ca', 'requestId': '16805156922345810'}, 'success': True}
|
||||
响应耗时(ms): 83.0
|
||||
接口响应码: 200
|
||||
|
||||
2023-04-25 17:28:53.645 | WARNING | utils.requests_control:cookie_token:33 - 未获取到登录认证信息,请检查: <urllib3.connection.HTTPSConnection object at 0x105b56d00>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known
|
||||
2023-04-25 17:28:53.677 | WARNING | conftest:__init__:83 - 当前数据库配置: 关闭
|
||||
2023-04-25 17:28:53.760 | INFO | utils.decorator_control:wrapper:34 -
|
||||
请求地址: https://open.xwdsp.com/phegda/advrest
|
||||
请求方法: POST
|
||||
请求头: {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'}
|
||||
请求数据: {'terminal': 'PC', 'apiVersion': '1.0.1', 'site': {'Siteid': 1015, 'siteName': 'waibu', 'qid': '04478', 'pageType': 'null', 'pageUrl': 'https://www.tianqi.com/shanghai/', 'newsType': 'null', 'keywords': '上海天气,上海天气预报,上海天气预报查询,上海今日天气,上海周末天气,上海一周天气预报,上海天气预报一周,天气预报查询一周,上海天气预报10天,上海天气预报查询15天,上海未来一周的天气预报,上海天气情况,上海40日天气预报,天气预报40天,上海30日天气预报,天气预报30天'}, 'device': {'userAgent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36', 'geo': {'country': '', 'city': ''}, 'dnt': 0, 'deviceType': 'PC', 'os': 'MACOS', 'osVersion': 'X', 'height': 1080, 'width': 1920}, 'user': {'userId': '16805156868205498'}, 'imp': [{'slotId': 102298, 'pageNum': '1', 'styleId': [1004]}], 'requestId': '16805156922345810'}
|
||||
响应数据: {'data': {'ad': [], 'bidId': '0253b4be85f76ad63563e788d83061ca', 'requestId': '16805156922345810'}, 'success': True}
|
||||
响应耗时(ms): 81.0
|
||||
接口响应码: 200
|
||||
|
||||
2023-04-25 17:29:20.790 | WARNING | utils.requests_control:cookie_token:33 - 未获取到登录认证信息,请检查: <urllib3.connection.HTTPSConnection object at 0x103b72d30>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known
|
||||
2023-04-25 17:29:20.830 | WARNING | conftest:__init__:83 - 当前数据库配置: 关闭
|
||||
2023-04-25 17:29:21.012 | INFO | utils.decorator_control:wrapper:34 -
|
||||
请求地址: https://open.xwdsp.com/phegda/advrest
|
||||
请求方法: POST
|
||||
请求头: {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'}
|
||||
请求数据: {'terminal': 'PC', 'apiVersion': '1.0.1', 'site': {'Siteid': 1015, 'siteName': 'waibu', 'qid': '04478', 'pageType': 'null', 'pageUrl': 'https://www.tianqi.com/shanghai/', 'newsType': 'null', 'keywords': '上海天气,上海天气预报,上海天气预报查询,上海今日天气,上海周末天气,上海一周天气预报,上海天气预报一周,天气预报查询一周,上海天气预报10天,上海天气预报查询15天,上海未来一周的天气预报,上海天气情况,上海40日天气预报,天气预报40天,上海30日天气预报,天气预报30天'}, 'device': {'userAgent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36', 'geo': {'country': '', 'city': ''}, 'dnt': 0, 'deviceType': 'PC', 'os': 'MACOS', 'osVersion': 'X', 'height': 1080, 'width': 1920}, 'user': {'userId': '16805156868205498'}, 'imp': [{'slotId': 102298, 'pageNum': '3', 'styleId': [1004]}], 'requestId': '16805156922345810'}
|
||||
响应数据: {'msg': 'bad request ...', 'success': False}
|
||||
响应耗时(ms): 109.0
|
||||
接口响应码: 400
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
2023-04-26 09:19:24.317 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/tianqi目录已存在, 跳过创建
|
||||
2023-04-26 09:19:24.317 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/imports目录已存在, 跳过创建
|
||||
2023-04-26 09:19:24.318 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/login目录已存在, 跳过创建
|
||||
2023-04-26 09:19:48.804 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/tianqi目录已存在, 跳过创建
|
||||
2023-04-26 09:19:48.804 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/imports目录已存在, 跳过创建
|
||||
2023-04-26 09:19:48.804 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/login目录已存在, 跳过创建
|
||||
2023-04-26 09:20:08.911 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/tianqi目录已存在, 跳过创建
|
||||
2023-04-26 09:20:08.912 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/imports目录已存在, 跳过创建
|
||||
2023-04-26 09:20:08.912 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/login目录已存在, 跳过创建
|
||||
2023-04-26 09:21:01.890 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/tianqi目录已存在, 跳过创建
|
||||
2023-04-26 09:21:01.891 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/imports目录已存在, 跳过创建
|
||||
2023-04-26 09:21:01.891 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/login目录已存在, 跳过创建
|
||||
2023-04-26 09:21:08.008 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/imports目录已存在, 跳过创建
|
||||
2023-04-26 09:21:08.009 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/login目录已存在, 跳过创建
|
||||
2023-04-26 09:43:38.487 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/tianqi目录已存在, 跳过创建
|
||||
2023-04-26 09:43:38.487 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/imports目录已存在, 跳过创建
|
||||
2023-04-26 09:43:38.487 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/login目录已存在, 跳过创建
|
||||
2023-04-26 09:43:43.583 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/tianqi目录已存在, 跳过创建
|
||||
2023-04-26 09:43:43.584 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/imports目录已存在, 跳过创建
|
||||
2023-04-26 09:43:43.584 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/login目录已存在, 跳过创建
|
||||
2023-04-26 09:43:50.623 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/imports目录已存在, 跳过创建
|
||||
2023-04-26 09:43:50.623 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/login目录已存在, 跳过创建
|
||||
2023-04-26 10:10:15.205 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/tianqi目录已存在, 跳过创建
|
||||
2023-04-26 10:10:15.205 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/login目录已存在, 跳过创建
|
||||
2023-04-26 10:10:15.206 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/upload目录已存在, 跳过创建
|
||||
2023-04-26 10:55:26.707 | WARNING | utils.requests_control:cookie_token:34 - 未获取到登录认证信息,请检查: <urllib3.connection.HTTPSConnection object at 0x10765cca0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known
|
||||
2023-04-26 10:55:26.747 | WARNING | conftest:__init__:83 - 当前数据库配置: 关闭
|
||||
2023-04-26 10:55:26.894 | INFO | utils.log_control:wrapper:54 -
|
||||
请求地址: https://open.xwdsp.com/phegda/advrest
|
||||
请求方法: POST
|
||||
请求头: {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'}
|
||||
请求数据: {'terminal': 'PC', 'apiVersion': '1.0.1', 'site': {'Siteid': 1015, 'siteName': 'waibu', 'qid': '04478', 'pageType': 'null', 'pageUrl': 'https://www.tianqi.com/shanghai/', 'newsType': 'null', 'keywords': '上海天气,上海天气预报,上海天气预报查询,上海今日天气,上海周末天气,上海一周天气预报,上海天气预报一周,天气预报查询一周,上海天气预报10天,上海天气预报查询15天,上海未来一周的天气预报,上海天气情况,上海40日天气预报,天气预报40天,上海30日天气预报,天气预报30天'}, 'device': {'userAgent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36', 'geo': {'country': '', 'city': ''}, 'dnt': 0, 'deviceType': 'PC', 'os': 'MACOS', 'osVersion': 'X', 'height': 1080, 'width': 1920}, 'user': {'userId': '16805156868205498'}, 'imp': [{'slotId': 102298, 'pageNum': '1', 'styleId': [1004]}], 'requestId': '16805156922345810'}
|
||||
响应数据: {'data': {'ad': [], 'bidId': 'ea35511171386ad63563b4361b3061ca', 'requestId': '16805156922345810'}, 'success': True}
|
||||
响应耗时(ms): 98.0
|
||||
接口响应码: 200
|
||||
|
|
@ -13,3 +13,15 @@
|
|||
2023-04-26 15:54:55.309 | ERROR | __main__:__call__:33 - 未获取到对应方法,请检查
|
||||
2023-04-26 15:55:01.989 | ERROR | __main__:__call__:33 - 未获取到对应方法,请检查
|
||||
2023-04-26 15:55:18.824 | ERROR | __main__:__call__:33 - 未获取到对应方法,请检查
|
||||
2023-04-26 16:51:49.870 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/tianqi目录已存在, 跳过创建
|
||||
2023-04-26 16:51:49.870 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/login目录已存在, 跳过创建
|
||||
2023-04-26 16:51:49.870 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/upload目录已存在, 跳过创建
|
||||
2023-04-26 16:52:32.539 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/tianqi目录已存在, 跳过创建
|
||||
2023-04-26 16:52:32.539 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/login目录已存在, 跳过创建
|
||||
2023-04-26 16:52:32.539 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/upload目录已存在, 跳过创建
|
||||
2023-04-26 16:52:52.648 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/tianqi目录已存在, 跳过创建
|
||||
2023-04-26 16:52:52.648 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/login目录已存在, 跳过创建
|
||||
2023-04-26 16:52:52.648 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/upload目录已存在, 跳过创建
|
||||
2023-04-26 16:53:06.035 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/tianqi目录已存在, 跳过创建
|
||||
2023-04-26 16:53:06.036 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/login目录已存在, 跳过创建
|
||||
2023-04-26 16:53:06.036 | INFO | __main__:generate_test_case:76 - /Users/tanlinhai/PythonProjects/t2-api-autotest/test_cases/upload目录已存在, 跳过创建
|
||||
|
|
|
@ -5,17 +5,14 @@ import allure
|
|||
import pytest
|
||||
|
||||
|
||||
@allure.feature('upload')
|
||||
@allure.title('upload接口')
|
||||
@pytest.mark.upload
|
||||
@pytest.mark.datafile('test_data/upload/test_upload.yml')
|
||||
def test_upload(core, env, case, inputs, expectation):
|
||||
@allure.feature('XXX模块')
|
||||
@allure.title('XXX接口')
|
||||
@pytest.mark.imports
|
||||
@pytest.mark.datafile('test_data/imports/test_imports.yml')
|
||||
def test_imports(core, env, case, inputs, expectation):
|
||||
# core.requests: 返回请求方法对象
|
||||
# core.headers: 返回全局请求头
|
||||
# core.sql: 返回查询方法对象
|
||||
# core.cache: 返回缓存处理方法对象
|
||||
res = core.requests.request(env, data=inputs['json'], headers=core.headers, files=inputs['file']).json()
|
||||
core.cache.add_cache('test_upload', res['msg'])
|
||||
assert res == expectation['response']
|
||||
|
||||
|
||||
assert res == expectation['response']
|
|
@ -1,24 +1,16 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2023-04-26 10:10:15
|
||||
# @Time : 2023-04-25 11:52:55
|
||||
import allure
|
||||
import pytest
|
||||
from utils.json_control import JsonHandler
|
||||
from utils.assert_control import Assert
|
||||
|
||||
|
||||
@allure.feature('登录模块')
|
||||
@allure.title('登录接口')
|
||||
@pytest.mark.login
|
||||
@allure.feature('login')
|
||||
@pytest.mark.datafile('test_data/login/test_login.yml')
|
||||
def test_tianqi(core, env, case, inputs, expectation):
|
||||
res = core.requests.request(env, data=inputs['params'], headers=core.headers).json()
|
||||
assert Assert(JsonHandler(res).find_one(inputs['assert_key']), expectation['response']).ast(inputs['assert_way']) is True
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
core.cache.add_cache('test_login', res['key'])
|
||||
assert res == expectation['response']
|
Binary file not shown.
|
@ -1,14 +1,17 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2023-04-26 09:43:50
|
||||
# @Time : 2023-04-24 17:07:07
|
||||
import allure
|
||||
import pytest
|
||||
from utils.json_control import JsonHandler
|
||||
from utils.assert_control import Assert
|
||||
|
||||
|
||||
@allure.feature('tianqi')
|
||||
@allure.feature('天气模块')
|
||||
@allure.title('天气查询接口')
|
||||
@pytest.mark.datafile('test_data/tianqi/test_tianqi.yml')
|
||||
def test_tianqi(core, env, case, inputs, expectation):
|
||||
res = core.requests.request(env, json=inputs['json'], headers=core.headers).json()
|
||||
assert Assert(JsonHandler(res).find_one(inputs['assert_key']), expectation['response']).ast(inputs['assert_way']) is True
|
||||
# core.requests: 返回请求方法对象
|
||||
# core.headers: 返回全局请求头
|
||||
# core.sql: 返回查询方法
|
||||
# core.cache: 返回缓存处理方法对象
|
||||
res = core.requests.request(env, data=inputs['json'], headers=core.headers).json()
|
||||
assert res['success'] == expectation['response']
|
Binary file not shown.
|
@ -72,7 +72,7 @@ class TestCaseAutoCreate(CaseHandler):
|
|||
data_dict = {k: v for k, v in zip(self.get_data_path[1], self.get_yaml_data)}
|
||||
for file_path, case_detail in data_dict.items():
|
||||
for data in case_detail.get('tests'):
|
||||
params, jsons, sql = data['inputs'].get('params'), data['inputs'].get('json'), data['inputs'].get('sql')
|
||||
params, files = data['inputs'].get('params'), data['inputs'].get('file')
|
||||
logger.info(f'{file_path}目录已存在, 跳过创建') if FileUtils.is_exist(file_path) else FileUtils.create_dir(file_path) # 创建目录
|
||||
case_path = file_path / f'test_{file_path.stem}.py'
|
||||
if not FileUtils.is_exist(case_path):
|
||||
|
@ -80,13 +80,15 @@ class TestCaseAutoCreate(CaseHandler):
|
|||
file_path.stem,
|
||||
f'test_{file_path.stem}',
|
||||
params,
|
||||
jsons,
|
||||
sql
|
||||
files
|
||||
)) # 写入python文件
|
||||
|
||||
def case_content(self, feature, datafile, params, jsons, sql):
|
||||
def case_content(self, feature, datafile, params, files):
|
||||
"""生成测试用例内容"""
|
||||
|
||||
if files:
|
||||
file = "files=input['file'], "
|
||||
else:
|
||||
file = ""
|
||||
content = f"""#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Time : {Mock().now_time()}
|
||||
|
@ -99,7 +101,7 @@ from utils.assert_control import Assert
|
|||
@allure.feature('{feature}')
|
||||
@pytest.mark.datafile('test_data/{feature}/{datafile}.yml')
|
||||
def test_tianqi(core, env, case, inputs, expectation):
|
||||
res = core.requests.request(env, {'data' if params else 'json'}=inputs[{"'params'" if params else "'json'"}], headers=core.headers).json()
|
||||
res = core.requests.request(env, {'data' if params else 'json'}=inputs[{"'params'" if params else "'json'"}], {file}headers=core.headers).json()
|
||||
assert Assert(JsonHandler(res).find_one(inputs['assert_key']), expectation['response']).ast(inputs['assert_way']) is True"""
|
||||
|
||||
return content
|
||||
|
|
Loading…
Reference in New Issue