提交 015b6f24 authored 作者: 陈泽健's avatar 陈泽健

feat(新统一平台): 更新平台配置与测试逻辑

- 新统一前后台浏览器初始化名称
- 修改配置文件中前后台系统URL
- 调整ngrok远程端口
- 更新后台测试用例标签及数据源- 修改定时任务执行脚本路径与参数
- 生成新测试报告文件
上级 7ee620ce
......@@ -941,7 +941,7 @@ def dingding_send_message(latest_report, title, mobile, ding_type):
logging.info(f"钉钉机器人Webhook URL: {final_webhook_url}")
# 调用测试结果获取函数
browser_init("兰州中石化项目测试环境")
browser_init("新统一平台前台")
wd = GSTORE['wd']
# print(latest_report)
test_result = get_test_result(latest_report, wd)
......
......@@ -8,7 +8,7 @@ from 新统一平台.Base.base import *
def suite_setup():
STEP(1, "初始化浏览器")
browser_init("新统一平台")
browser_init("标准版新统一平台前台")
def suite_teardown():
browser_quit()
\ No newline at end of file
......@@ -8,7 +8,7 @@ from 新统一平台.Base.base import *
def suite_setup():
STEP(1, "初始化浏览器")
browser_init("新统一平台")
browser_init("标准版新统一平台后台")
def suite_teardown():
browser_quit()
\ No newline at end of file
......@@ -10,13 +10,13 @@ sys.path.append(platform_path)
from 新统一平台.Base.base import *
# 构建XLSX文件的绝对路径
xlsx_file_path = os.path.join(current_dir,'..', '测试数据', '会议预定测试用例.xlsx')
xlsx_file_path = os.path.join(current_dir,'..', '测试数据', '新统一平台测试用例.xlsx')
class NewUnifiedPlatform:
#执行指令:
# cd ./统一平台/
# hytest --tag 新统一平台
tags = ['新统一平台后台系统标准版']
tags = ['新统一平台后台系统']
ddt_cases = read_xlsx_data(xlsx_file_path, sheet_name="管理后台", case_type="标准版")
def teststeps(self):
......
{
"标准版新统一平台": "https://192.168.5.44"
"新统一平台前台": "https://192.168.5.44",
"新统一平台后台系统": "https://192.168.5.44/#/LoginAdmin"
}
\ No newline at end of file
......@@ -4,4 +4,4 @@ tunnels:
nat1:
proto:
tcp: 127.0.0.1:80
remote_port: 31136
remote_port: 31137
此差异已折叠。
......@@ -3,7 +3,8 @@ import queue
from Base.base import *
import time
import logging
import os
import sys
if getattr(sys, 'frozen', False):
base_dir = os.path.dirname(sys.executable)
......@@ -16,31 +17,19 @@ if not os.path.isdir(cases_dir):
raise FileNotFoundError("请将 cases 目录放在程序同级目录下!")
"""
调试主机-执行指令:
1.打开一个终端输入:
- cd .\预定系统\
- python -m http.server 81 --directory reports
2.打开新终端输入:
- cd .\预定系统\ngrok\ngrok-调试主机\
- .\start.bat
3.再打开一个终端输入:
- cd .\预定系统\
- python .\定时执行功能测试.py
自动化运行虚拟机-执行指令:
1.打开一个终端输入:
- cd .\预定系统\
- python -m http.server 81 --directory reports
- cd .\新统一平台\
- python -m http.server 80 --directory reports
2.打开新终端输入:
- cd .\预定系统\ngrok\ngrok-自动化运行虚拟机
- cd .\新统一平台\ngrok
- .\start.bat
3.再打开一个终端输入:
- cd .\预定系统\
- cd .\新统一平台\
- python .\定时执行功能测试.py
"""
import os
import sys
def get_resource_path(relative_path):
"""
......@@ -94,21 +83,8 @@ def start_workers(num_workers):
# 启动3个工作线程
start_workers(3)
# 定时执行预定系统测试任务
schedule.every().day.at("10:00").do(run_task, run_automation_test, report_title="预定系统测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="JSON测试", ding_type="标准版巡检")
schedule.every().day.at("07:00").do(run_task, run_automation_test, report_title="兰州中石化项目测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", 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="展厅巡检")
schedule.every().monday.at("07:42").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
schedule.every().thursday.at("07:42").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
schedule.every().wednesday.at("07:42").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
schedule.every().tuesday.at("07:42").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
schedule.every().friday.at("07:42").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
# schedule.every().saturday.at("07:42").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31136", test_case="展厅巡检", ding_type="展厅巡检")
# schedule.every().sunday.at("07:42").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31136", test_case="展厅巡检", ding_type="展厅巡检")
# 定时执行新统一平台标准版
schedule.every().day.at("14:18").do(run_task, run_automation_test, report_title="新统一平台测试报告", report_url_prefix="http://nat.ubainsyun.com:31137", test_case="新统一平台后台系统", ding_type="标准版巡检")
try:
# 无限循环,持续检查并执行计划任务
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论