提交 0b259ae7 authored 作者: 陈泽健's avatar 陈泽健

fix(预定系统): 优化资源释放和测试执行时间

- 在 base.py 中添加 workbook 关闭逻辑,确保资源正确释放
- 更新兰州中石化项目测试的执行时间
- 调整定时执行任务的时间安排
上级 0752081c
......@@ -530,6 +530,10 @@ def read_xlsx_data(xlsx_file_path, sheet_name=None, case_type=None):
logging.error(f"处理文件时出错: {e}")
raise
finally:
if workbook:
workbook.close()
import openpyxl
def clear_columns_in_xlsx(xlsx_file_path, sheet_name=None, columns_to_clear=None):
......
......@@ -19,6 +19,7 @@ class LanzhouSinopecProject:
执行指令是:
1.cd 预定系统
2.hytest --report_title 兰州中石化项目测试报告 --report_url_prefix http://nat.ubainsyun.com:31135 --tag 兰州中石化项目
3.hytest --report_title 兰州中石化项目测试报告 --report_url_prefix https://192.168.1.67 --tag 兰州中石化项目
"""
ddt_cases = read_xlsx_data(xlsx_file_path, case_type="兰州中石化项目25-05-24")
# 测试开始前调用clear_columns_in_xlsx函数,将测试用例中的测试结果和日志截图置空
......@@ -26,7 +27,7 @@ class LanzhouSinopecProject:
def teststeps(self):
"""
执行测试步骤函数,主要用于执行读取的测试用例并进行信息统计模块功能测试操作1
执行测试步骤函数,主要用于执行读取的测试用例并进行信息统计模块功能测试操作
"""
# 从全局存储中获取webdriver对象
wd = GSTORE['wd']
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -67,11 +67,11 @@ def start_workers(num_workers):
# 启动3个工作线程
start_workers(3)
# 定时执行预定系统测试任务1
schedule.every().day.at("12:00").do(run_task, run_automation_test, report_title="预定系统测试报告", report_url_prefix="http://nat.ubainsyun.com:31134", test_case="JSON测试", ding_type="标准版巡检")
# 定时执行预定系统测试任务
schedule.every().day.at("10:00").do(run_task, run_automation_test, report_title="预定系统测试报告", report_url_prefix="http://nat.ubainsyun.com:31134", test_case="JSON测试", ding_type="标准版巡检")
# 定时执行兰州中石化项目测试任务
schedule.every().day.at("10:00").do(run_task, run_automation_test, report_title="兰州中石化项目测试报告", report_url_prefix="http://nat.ubainsyun.com:31135", test_case="兰州中石化项目", ding_type="标准版巡检")
schedule.every().day.at("06:00").do(run_task, run_automation_test, report_title="兰州中石化项目测试报告", report_url_prefix="http://nat.ubainsyun.com:31135", test_case="兰州中石化项目", ding_type="标准版巡检")
# 定时执行展厅巡检任务
# schedule.every().day.at("07:45").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31136", test_case="展厅巡检", ding_type="展厅巡检")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论