提交 838aaf3b authored 作者: 陈泽健's avatar 陈泽健

补充历史会议模块中会议筛选功能的自动化验证处理。

上级 cc80a433
......@@ -123,4 +123,5 @@
- 补充统一平台的软终端入会流程,完善统一平台的会控巡检流程。
25. 2024-12-23
- 调整富创项目的MQTT消息体,补充参会人数据推送。处理展厅巡检的时间格式问题。
- 补充对于服务器状态的监测,并体现在报告中做判断。
\ No newline at end of file
- 补充对于服务器状态的监测,并体现在报告中做判断。
- 补充历史会议模块中会议筛选功能的自动化验证处理。
\ No newline at end of file
from datetime import datetime, timedelta
from time import sleep
import sys
import os
from selenium.webdriver.support.expected_conditions import element_to_be_clickable
# 获取当前脚本的绝对路径
current_dir = os.path.dirname(os.path.abspath(__file__))
# 构建预定系统的绝对路径
预定系统_path = os.path.abspath(os.path.join(current_dir, '..','..','..'))
# 添加路径
sys.path.append(预定系统_path)
# 导入模块
from 预定系统.Base.base import *
# 获取当前脚本所在的目录
current_dir = os.path.dirname(os.path.abspath(__file__))
# 构建CSV文件的绝对路径
csv_file_path = os.path.join(current_dir, '../../测试数据/会议历史记录/历史会议筛选.csv')
# 定义时间格式
time_format = "%H:%M"
class History_Book_000x:
"""
执行指令:
1.cd 预定系统
2.hytest --report_title 会议预约测试报告 --report_url_prefix http://nat.ubainsyun.com:31133 --test 历史会议筛选_0**
"""
ddt_cases = read_csv_data(csv_file_path)
def teststeps(self):
"""
执行测试步骤以会议室删除功能。
本函数根据参数输入会议室名称进行搜索并删除会议室,并检查删除后的提示信息是否与预期相符。
字段含义:
name:用例名称
query_message_name:查询的会议名称
check_text:检查提示文本
"""
# 初始化通知文本为空字符串
notify_text = ""
# 从全局存储中获取webdriver实例
wd = GSTORE['wd']
name = self.name
query_message_name, query_type, check_text = self.para
# 输入会议名称进行筛选
STEP(1, "输入查询文本:{}".format(query_message_name))
safe_send_keys((By.XPATH,"//input[@placeholder='输入关键字搜索']"), query_message_name, wd)
send_keyboard((By.XPATH, "//input[@placeholder='输入关键字搜索']"), wd)
sleep(2)
# 判断查询方式
if query_type == "错误查询":
STEP(3, "检查提示文本")
# 检查查询结果
notify_text = elment_get_text((By.XPATH,
"//span[contains(@class,'el-table__empty-text')]"),
wd)
INFO(f"查询结果为:{notify_text}")
CHECK_POINT("查询结果是否正确", "暂无数据" in notify_text)
else:
# 检查查询结果
notify_text = elment_get_text((By.CSS_SELECTOR,
"body > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(3) > div:nth-child(1) > div:nth-child(3) > div:nth-child(3) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > div:nth-child(1)"),
wd)
INFO(f"查询结果为:{notify_text}")
CHECK_POINT("查询结果是否正确", query_message_name in notify_text)
sleep(1)
\ No newline at end of file
import sys
import os
from time import sleep
# 获取当前脚本的绝对路径
current_dir = os.path.dirname(os.path.abspath(__file__))
# 构建预定系统的绝对路径
预定系统_path = os.path.abspath(os.path.join(current_dir, '..','..'))
# 添加路径
sys.path.append(预定系统_path)
# 导入模块
from 预定系统.Base.base import *
def suite_setup():
STEP(1, "初始化浏览器")
# login_url = 'https://192.168.5.218/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046"
login_url = 'http://192.168.5.200:8080/#/login/logindf'
browser_init(login_url)
wd = GSTORE['wd']
admin_login("admin@ZDH", "Ubains@4321")
sleep(2)
# 进入历史记录界面
safe_click((By.XPATH,"//span[contains(text(),'历史记录')]"), wd)
\ No newline at end of file
......@@ -152,18 +152,19 @@ class Exhibition_hall_inspection_000x:
# 点击【下一步】进入会议预定第二步界面
safe_click((By.XPATH, "//div[contains(text(),'下一步')]"),wd)
sleep(1)
# 根据参会人名称搜搜对应参会人
# ipn = ['赵嘉诚','CZJ','向彩娇','马晓丽','王兵','陈林','李立键','丁海洪','刘建胜','潘松林','卢培锽','黄史恭','罗一龙','彭甘宇']
# for i in range(0, 14):
# safe_send_keys((By.XPATH, "//input[@placeholder='账号/用户名']"), ipn[i], wd)
# send_keyboard((By.XPATH, "//input[@placeholder='账号/用户名']"), wd)
# sleep(1)
# # 选择内部参会人
# safe_click((By.XPATH, "//th[contains(@class,'is-leaf el-table__cell')]//span[contains(@class,'el-checkbox__inner')]"), wd)
# # 获取已选的参会人名称
# notify_text = elment_get_text((By.XPATH, f"//span[normalize-space()='{ipn[i]}']"), wd)
# INFO(f"已选择参会人:{ipn}")
# SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Meeting_Message", "选择内部参会人")
ipn = ['赵嘉诚','CZJ','向彩娇','马晓丽','王兵','陈林','李立键','丁海洪','刘建胜','潘松林','卢培锽','黄史恭','罗一龙','彭甘宇']
for i in range(0, 14):
safe_send_keys((By.XPATH, "//input[@placeholder='账号/用户名']"), ipn[i], wd)
send_keyboard((By.XPATH, "//input[@placeholder='账号/用户名']"), wd)
sleep(1)
# 选择内部参会人
safe_click((By.XPATH, "//th[contains(@class,'is-leaf el-table__cell')]//span[contains(@class,'el-checkbox__inner')]"), wd)
# 获取已选的参会人名称
# notify_text = elment_get_text((By.XPATH, f"//span[normalize-space()='{ipn[i]}']"), wd)
INFO(f"已选择参会人:{ipn}")
SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "Meeting_Message", "选择内部参会人")
# 点击【下一步】按钮
safe_click((By.XPATH,"//div[contains(text(),'下一步')]"),wd)
......
......@@ -26,11 +26,18 @@ def suite_setup():
admin_login("Test02", "ubains@123")
sleep(5)
STEP(2, "无纸化会议信息")
SELENIUM_LOG_SCREEN(wd,"50%","Exhibit_Inspect","No_PaperLess","无纸化会议信息截图")
SELENIUM_LOG_SCREEN(wd,"50%","Exhibit_Inspect","No_PaperLess","无纸化首页截图")
STEP(3, "无纸化议题信息")
INFO("请查看议题显示")
SELENIUM_LOG_SCREEN(wd,"50%","Exhibit_Inspect","No_PaperLess","议题文件截图")
INFO("请查看议题文件1显示")
SELENIUM_LOG_SCREEN(wd,"50%","Exhibit_Inspect","No_PaperLess","议题文件1截图")
INFO("请查看议题文件2显示")
SELENIUM_LOG_SCREEN(wd,"50%","Exhibit_Inspect","No_PaperLess","议题文件2截图")
INFO("请查看议题文件3显示")
SELENIUM_LOG_SCREEN(wd,"50%","Exhibit_Inspect","No_PaperLess","议题文件3截图")
def suite_teardown():
......
......@@ -24,7 +24,7 @@ class Server_monitoring_0001:
info = fetch_and_parse_check_txt(url, save_path, extract_info)
if info:
for key, value in info.items():
STEP(i+1, f"服务器{key} 服务状态巡检")
STEP(++i, f"服务器{key} 服务状态巡检")
INFO(f"监测到{key} 服务的状态:{value}")
CHECK_POINT(f"{key}服务的状态是否正常", value == "服务正常")
else:
......
......@@ -16,8 +16,10 @@ def on_message(client, userdata, msg):
logging.info(f"接收到消息: 主题={msg.topic}, 消息体={msg.payload.decode()}")
if __name__ == "__main__":
broker_address = "192.168.5.218"
port = 1883
# 5.218测试环境 192.168.5.218 1883
broker_address = "nat.ubainsyun.com"
port = 18685
# 创建 MQTT 客户端实例
mqtt_client = mqtt.Client()
......
......@@ -70,11 +70,11 @@ start_workers(3)
# 每天早上07:50执行后台系统设置功能测试
schedule.every().saturday.at("12:00").do(run_task, run_automation_test, report_title="预定系统_后台管理功能_测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="后台管理功能", ding_type="标准版巡检")
schedule.every().monday.at("08:00").do(run_task, run_automation_test, report_title="展厅巡检_会议预约测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
schedule.every().tuesday.at("08:00").do(run_task, run_automation_test, report_title="展厅巡检_会议预约测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
schedule.every().wednesday.at("08:00").do(run_task, run_automation_test, report_title="展厅巡检_会议预约测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
schedule.every().thursday.at("08:00").do(run_task, run_automation_test, report_title="展厅巡检_会议预约测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
schedule.every().friday.at("08:00").do(run_task, run_automation_test, report_title="展厅巡检_会议预约测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
schedule.every().monday.at("07:55").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:55").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:55").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:55").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:55").do(run_task, run_automation_test, report_title="展厅巡检测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检", ding_type="展厅巡检")
# schedule.every().day.at("08:25").do(run_task, run_automation_test, report_title="展厅巡检_腾讯终端入会测试报告", report_url_prefix="http://nat.ubainsyun.com:31133", test_case="展厅巡检_腾讯会议")
......
name,query_message_name,query_type,check_text
历史会议筛选_001,哈哈哈哈会议,精确查询,哈哈哈哈会议
历史会议筛选_002,展厅巡检,错误查询,
历史会议筛选_003,哈哈,模糊查询,哈哈哈哈会议
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论