forked from PAWPAW/lib_rgb
整合测试框架
- 整合了原有的功能用例与接口测试
This commit is contained in:
24
testcases/main.py
Normal file
24
testcases/main.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import os
|
||||
import pytest
|
||||
from commons.operate_log import OperateLog
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 获取当前脚本文件所在的目录路径
|
||||
current_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))).replace('\\', '/')
|
||||
reports_path = os.path.join(current_path, 'reports')
|
||||
allure_path = os.path.join(current_path, 'reports', 'allure')
|
||||
test_result_path = os.path.join(current_path, 'reports', 'test_result')
|
||||
if not os.path.exists(reports_path):
|
||||
os.makedirs(reports_path)
|
||||
if not os.path.exists(allure_path):
|
||||
os.makedirs(allure_path)
|
||||
if not os.path.exists(test_result_path):
|
||||
os.makedirs(test_result_path)
|
||||
|
||||
#每次执行全部用例之前删除logs下的日志文件
|
||||
OperateLog().delete_logs()
|
||||
# 执行测试用例
|
||||
pytest.main(['-q', "--alluredir", allure_path, '--clean-alluredir'])
|
||||
#合并生成的日志文件
|
||||
OperateLog().merge_logs('lib_rgb_test.log')
|
||||
Reference in New Issue
Block a user