提交 66698fcc authored 作者: 陈泽健's avatar 陈泽健

实现测试用例中的会议修改和会议历史记录的部分功能测试。

上级 da560ab2
......@@ -247,4 +247,6 @@
- 处理read_xlsx_data函数增加sheet传参,实现测试用例中会议室列表的部分功能。
- 封装获取当前会议时间转换格式函数,用于所有的会议预定功能测试使用。实现测试用例中会控-SMC的部分功能。
66. 2025-03-11
- 实现测试用例中会控-腾讯会议的部分功能。封装会议创建、结束会议与会议状态操作的公用方法,通过会议室名称与会议类型来做判断,减少代码冗杂。实现测试用例中会议创建的部分功能。
\ No newline at end of file
- 实现测试用例中会控-腾讯会议的部分功能。
- 封装会议创建、结束会议与会议状态操作的公用方法,通过会议室名称与会议类型来做判断,减少代码冗杂。实现测试用例中会议创建的部分功能。
- 实现测试用例中的会议修改和会议历史记录的部分功能测试。
\ 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
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 EditMessage_00x:
tags = ['新-会议修改测试']
"""
执行指令是:
1.cd 预定系统
2.hytest --report_title 会议修改测试报告 --report_url_prefix http://nat.ubainsyun.com:31133 --tag 新-会议修改测试
"""
def teststeps(self):
"""
执行测试步骤函数,主要用于执行读取的测试用例并进行会议修改界面操作测试
"""
# 从全局存储中获取webdriver对象
wd = GSTORE['wd']
# 读取Excel文件中的测试用例数据
ddt_cases = read_xlsx_data(xlsx_file_path, "会议修改")
# 遍历 ddt_cases 并获取每一个 JSON 对象
for case in ddt_cases:
# 调用会议创建函数
meeting_message("预约会议室", "普通会议", wd)
# 搜索会议
safe_send_keys((By.XPATH, "//input[@placeholder='输入关键字搜索']"), "普通会议", wd)
send_keyboard((By.XPATH, "//input[@placeholder='输入关键字搜索']"), wd)
sleep(1)
# 点击会议修改按钮
safe_click((By.XPATH, "//button[@type='button']//span[contains(text(),'修改会议')]"), wd)
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") == "MessageNameTest":
# 这是会议名称字符测试用例
if element_type == "input":
if expented_result is "":
# 输入会议名称
safe_send_keys((locator_type, locator_value), element_value, wd)
sleep(1)
elif expented_result is not "":
# 搜索会议数据,获取会议列表的会议名称
safe_send_keys((locator_type, locator_value), element_value, wd)
send_keyboard((locator_type, locator_value), wd)
sleep(2)
# 获取提示文本
notify_text = elment_get_text(
(By.CSS_SELECTOR, "tbody tr[class='el-table__row'] td:nth-child(2) div:nth-child(1)"),
wd)
INFO(f"查询已预定列表的会议名称为:{notify_text}")
CHECK_POINT("判断会议是否创建成功", expented_result in notify_text)
# 调用会议删除函数
INFO("调用会议删除函数")
del_message(message_name, wd)
elif element_type == "click":
safe_click((locator_type, locator_value), wd)
sleep(2)
\ 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, "初始化浏览器")
# 初始化浏览器与系统地址
browser_init("标准版预定系统")
wd = GSTORE['wd']
admin_login("admin@ZDH", "Ubains@4321")
sleep(2)
# 进入历史记录界面
safe_click((By.XPATH,"//span[contains(text(),'历史记录')]"), wd)
def suite_teardown():
browser_quit()
\ No newline at end of file
import sys
import os
from time import sleep
# 获取当前脚本的绝对路径
current_dir = os.path.dirname(os.path.abspath(__file__))
# 构建预定系统的绝对路径
......@@ -14,12 +14,12 @@ def suite_setup():
STEP(1, "初始化浏览器")
# 初始化浏览器与系统地址
browser_init("标准版预定系统")
wd = GSTORE['wd']
admin_login("admin@ZDH", "Ubains@4321")
admin_login("admin@Test", "Ubains@4321")
sleep(2)
# 进入历史记录界面
safe_click((By.XPATH,"//span[contains(text(),'历史记录')]"), wd)
wd = GSTORE['wd']
# 切换至历史会议模块
safe_click((By.XPATH, "//ul[contains(@class,'meeting_list')]//span[contains(text(),'历史记录')]"), wd)
def suite_teardown():
browser_quit()
\ No newline at end of file
wd = GSTORE['wd']
wd.quit()
\ 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 *
# 获取当前脚本所在的目录
current_dir = os.path.dirname(os.path.abspath(__file__))
# 构建XLSX文件的绝对路径
xlsx_file_path = os.path.join(current_dir, '..', '..', '测试数据', '会议预定测试用例.xlsx')
class HistoryMessage_00x:
tags = ['新-会议历史记录测试']
"""
执行指令是:
1.cd 预定系统
2.hytest --report_title 会议历史记录测试报告 --report_url_prefix http://nat.ubainsyun.com:31133 --tag 新-会议历史记录测试
"""
def teststeps(self):
"""
执行测试步骤函数,主要用于执行读取的测试用例并进行会议预定界面操作
"""
# 从全局存储中获取webdriver对象
wd = GSTORE['wd']
# 读取Excel文件中的测试用例数据
ddt_cases = read_xlsx_data(xlsx_file_path, "会议历史记录")
# 遍历 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')
# 判断页面功能类型
if step.get("page") == "MessageQuery":
# 这是会议名称字符测试用例
if element_type == "input":
safe_send_keys((locator_type, locator_value), element_value, wd)
sleep(2)
elif element_type == "click":
# 点击按钮
safe_click((locator_type, locator_value), wd)
sleep(2)
elif element_type == "text":
# 获取列表筛选数据
notify_text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取列表筛选数据:{notify_text}")
CHECK_POINT(f"判断列表筛选数据是否正确", expented_result in notify_text)
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论