提交 2eab86e2 authored 作者: 陈泽健's avatar 陈泽健

删除中控屏操作的多余截屏函数调用。处理get_screenshot_with_retry函数的目录构建传参问题。

上级 968d86a2
......@@ -530,7 +530,6 @@ def curtain_control(app_drive, wd):
click_with_retry(curtain_up_button)
sleep(2)
INFO("请检查窗帘上升状态是否正常")
SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Control_Manage", "curtain_up")
# 截图获取当前中控屏软件窗帘上升的界面
get_screenshot_with_retry(wd, app_drive, "Exhibit_Inspect", "Control_Manage", "curtain_up")
......@@ -556,7 +555,6 @@ def curtain_control(app_drive, wd):
sleep(2)
sleep(30)
INFO("请检查窗帘下降状态是否正常")
SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Control_Manage", "curtain_down")
get_screenshot_with_retry(wd, app_drive, "Exhibit_Inspect", "Control_Manage", "curtain_down")
# 截图获取当前中控屏软件窗帘上升的界面
# 测试报告中补充窗帘下降的截图
......@@ -587,7 +585,6 @@ def air_condition_control(app_drive, wd):
# 这是空调开启的状态显示
INFO("请检查空调开启的状态是否正常")
SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Control_Manage", "air_condition_on")
get_screenshot_with_retry(wd, app_drive, "Exhibit_Inspect", "Control_Manage", "air_condition_on")
sleep(2)
......@@ -600,7 +597,6 @@ def air_condition_control(app_drive, wd):
# 这是空调关闭的状态显示
INFO("请检查空调关闭的状态是否正常")
SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Control_Manage", "air_condition_off")
get_screenshot_with_retry(wd, app_drive, "Exhibit_Inspect", "Control_Manage", "air_condition_off")
sleep(2)
......@@ -696,7 +692,6 @@ def music_control(app_drive, wd):
sleep(5)
# 这是音乐开启播放后的界面显示
INFO("请检查中控屏软件打开音乐播放后的界面状态显示")
SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Control_Manage", "music_on")
get_screenshot_with_retry(wd, app_drive, "Exhibit_Inspect", "Control_Manage", "music_on")
# 点击【关闭播放音乐】
......@@ -707,7 +702,6 @@ def music_control(app_drive, wd):
sleep(5)
# 这是音乐关闭播放后的界面显示
INFO("请检查中控屏软件关闭音乐播放后的界面状态显示")
SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Control_Manage", "music_off")
get_screenshot_with_retry(wd, app_drive, "Exhibit_Inspect", "Control_Manage", "music_off")
# 中控屏控制函数
......@@ -830,11 +824,11 @@ def get_screenshot_with_retry(wd,app_drive, module_name, function_name, step_nam
# 获取当前文件的父级目录
parent_dir = os.path.dirname(current_file_path)
# 构造目标目录路径
target_dir = os.path.join(parent_dir, '..', 'reports', 'imgs', 'Exhibit_Inspect', module_name)
target_dir = os.path.join(parent_dir, '..', 'reports', 'imgs', module_name, function_name)
# 确保目标目录存在,如果不存在则创建
os.makedirs(target_dir, exist_ok=True)
# 构造文件路径
file_path = os.path.join(target_dir, f"{function_name}.png")
file_path = os.path.join(target_dir, f"{step_name}.png")
#截屏
SELENIUM_LOG_SCREEN(wd, "75%", module_name, function_name, f"{step_name}")
......
......@@ -240,4 +240,6 @@
- 补充展厅无纸化中控2.0的同屏巡检代码。补充展厅无纸化2.0的主流程验证代码。
- 处理展厅统一平台因会议室变动导致的异常,会议室搜索改为模糊查询,会控界面的终端拖拽元素调整更新。
- 处理测试用例JSON读取登录功能测试脚本。
- Base函数库中的函数缩略补充函数使用说明,增加相关注释,删除无用函数。
\ No newline at end of file
- Base函数库中的函数缩略补充函数使用说明,增加相关注释,删除无用函数。
64. 2025-03-07
- 删除中控屏操作的多余截屏函数调用。处理get_screenshot_with_retry函数的目录构建传参问题。
\ No newline at end of file
......@@ -61,7 +61,6 @@ class Exhibition_hall_Control_000x:
# 这是全部灯光关闭后在软件界面上的状态显示
INFO("请检查中控屏软件的灯光关闭状态显示是否正常")
SELENIUM_LOG_SCREEN(wd, "75%", "Exhibit_Inspect", "Control_Manage", "light_all_off")
# app_drive.get_screenshot_as_file(r"D:\GithubData\自动化\ubains-module-test\预定系统\reports\imgs\Exhibit_Inspect\Control_Manage\light_all_off.png")
# 截图获取当前软件的灯光控制界面
get_screenshot_with_retry(wd,app_drive, "Exhibit_Inspect","Control_Manage", "light_all_off")
......@@ -70,7 +69,6 @@ class Exhibition_hall_Control_000x:
# 这是全部灯光开启后在软件界面上的状态显示
INFO("请检查中控屏软件的灯光开启状态显示是否正常")
SELENIUM_LOG_SCREEN(wd, "75%", "Exhibit_Inspect", "Control_Manage", "light_all_on")
# app_drive.get_screenshot_as_file(r"D:\GithubData\自动化\ubains-module-test\预定系统\reports\imgs\Exhibit_Inspect\Control_Manage\light_all_on.png")
# 截图获取当前软件的灯光控制界面
get_screenshot_with_retry(wd,app_drive, "Exhibit_Inspect","Control_Manage", "light_all_on")
......
......@@ -5,9 +5,9 @@ from 预定系统.Base.base import *
current_dir = os.path.dirname(os.path.abspath(__file__))
# 构建会议预约CSV文件的绝对路径
csv_file_path = os.path.join(current_dir, '../../测试数据/MQTT模块/富创项目/富创项目_会议预约推送.csv')
# csv_file_path = os.path.join(current_dir, '../../测试数据/MQTT模块/富创项目/富创项目_会议预约推送.csv')
# 构建会议修改CSV文件的绝对路径
# csv_file_path = os.path.join(current_dir, '../../测试数据/MQTT模块/富创项目/富创项目_会议修改推送.csv')
csv_file_path = os.path.join(current_dir, '../../测试数据/MQTT模块/富创项目/富创项目_会议修改推送.csv')
# 构建会议删除CSV文件的绝对路径
# csv_file_path = os.path.join(current_dir, '../../测试数据/MQTT模块/富创项目/富创项目_会议删除推送.csv')
......@@ -15,7 +15,7 @@ if __name__ == "__main__":
# 读取配置文件
configs = Mqtt.read_config_from_csv(csv_file_path)
broker_address = "192.168.5.218"
broker_address = "192.168.1.193"
port = 1883
num_repeats = 1000 # 重复执行的次数
interval_between_repeats = 0.2 # 每次重复之间的间隔时间(秒)
......
......@@ -16,7 +16,7 @@ def on_message(client, userdata, msg):
logging.info(f"接收到消息: 主题={msg.topic}, 消息体={msg.payload.decode()}")
if __name__ == "__main__":
broker_address = "192.168.5.218"
broker_address = "192.168.1.193"
port = 1883
# 创建 MQTT 客户端实例
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论