提交 2914f0fd authored 作者: 陈泽健's avatar 陈泽健

补充实现展会的AI创会的简单代码处理,调整config.json配置项增加长安大学的配置信息。

上级 139e6d5d
import sys
import os
# 获取当前脚本的绝对路径
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__))
# 构建XLSX文件的绝对路径
xlsx_file_path = os.path.join(current_dir, '..', '..', '测试数据', '会议预定测试用例.xlsx')
class AIMeeting:
tags = ['新-AI创会测试']
"""
执行指令是:
1.cd 预定系统
2.hytest --report_title AI创会测试报告 --report_url_prefix http://nat.ubainsyun.com:31133 --tag 新-AI创会测试
"""
def teststeps(self):
wd = GSTORE['wd']
ddt_cases = read_xlsx_data(xlsx_file_path, "AI创会")
# 遍历 ddt_cases 并获取每一个 JSON 对象
for case in ddt_cases:
for step in case:
print(f"当前步骤: {step}")
# 先赋值
locator_type = get_by_enum(step.get('locator_type'))
locator_value = step.get('locator_value')
element_type = step.get('element_type')
element_value = step.get('element_value')
expented_result = step.get('expented_result')
# 将会议名称赋值,后面调用函数结束会议
message_name = element_value
# 判断页面功能类型
if step.get("page") == "AIMeeting":
if element_type == "input":
# 查询会议
safe_send_keys((locator_type, locator_value), element_value, wd)
send_keyboard((locator_type, locator_value), wd)
sleep(2)
elif element_type == "click":
safe_click((locator_type, locator_value), wd)
sleep(2)
\ No newline at end of file
import sys
import os
# 获取当前脚本的绝对路径
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, "初始化浏览器")
# 初始化浏览器与系统地址
browser_init("标准版预定系统")
admin_login("admin@Test", "Ubains@4321")
sleep(2)
def suite_teardown():
wd = GSTORE['wd']
wd.quit()
\ No newline at end of file
topic,action,thirdPartyMeetingId,thirdPartyRoomId,conferenceName,messageName,startTime,endTime,companyNumber,signInBeforeMinutes,signEndTime,enableSignOut,signOutMinutesAfterSignIn,signOutAfterEndMinutes topic,action,thirdPartyMeetingId,thirdPartyRoomId,conferenceName,messageName,startTime,endTime,companyNumber,signInBeforeMinutes,signEndTime,enableSignOut,signOutMinutesAfterSignIn,signOutAfterEndMinutes
/meeting/message/sync,mod,7565416702283087811,2,表处办公室2号会议室,富创预约,2025-03-12 17:15:00.0,2025-03-12 17:20:00.0,CN-E8V-UBAINS,5,1,1,2,1 /meeting/message/sync,mod,7565416702283099013,2,表处办公室2号会议室,1富创预约修改,2025-03-13 10:42:00.0,2025-03-13 10:46:00.0,CN-E8V-UBAINS,3,1,1,3,1
\ No newline at end of file \ No newline at end of file
topic,action,thirdPartyMeetingId,thirdPartyRoomId,conferenceName,messageName,startTime,endTime,companyNumber,signInBeforeMinutes,signEndTime,enableSignOut,signOutMinutesAfterSignIn,signOutAfterEndMinutes topic,action,thirdPartyMeetingId,thirdPartyRoomId,conferenceName,messageName,startTime,endTime,companyNumber,signInBeforeMinutes,signEndTime,enableSignOut,signOutMinutesAfterSignIn,signOutAfterEndMinutes
/meeting/message/sync,add,7565416702283099001,2,表处办公室2号会议室,第一场富创预约,2025-03-12 20:10:00.0,2025-03-12 20:20:00.0,CN-E8V-UBAINS,3,1,0,1,1 /meeting/message/sync,add,7565416702283099015,2,表处办公室2号会议室,1富创预约,2025-03-13 14:45:00.0,2025-03-13 14:47:00.0,CN-E8V-UBAINS,3,1,1,2,1
\ No newline at end of file \ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论