提交 139e6d5d authored 作者: 陈泽健's avatar 陈泽健

处理异常情况,补充截图操作。

上级 9dbb3b60
...@@ -256,4 +256,4 @@ ...@@ -256,4 +256,4 @@
- 补充读取测试用例JSON数据会议审批和会议室管理的部分功能测试。优化message_meeting函数传参。 - 补充读取测试用例JSON数据会议审批和会议室管理的部分功能测试。优化message_meeting函数传参。
- 补充读取测试用例JSON数据授权码管理的部分功能测试。 - 补充读取测试用例JSON数据授权码管理的部分功能测试。
- 补充读取测试用例JSON数据安卓信息、系统管理和信息发布模块的部分功能测试。处理优化富创项目的新需求topic主题与MQTT消息体。 - 补充读取测试用例JSON数据安卓信息、系统管理和信息发布模块的部分功能测试。处理优化富创项目的新需求topic主题与MQTT消息体。
- 处理优化。 - 处理异常情况,补充截图操作。
\ No newline at end of file \ No newline at end of file
...@@ -58,18 +58,21 @@ class SMCMeeting_00x: ...@@ -58,18 +58,21 @@ class SMCMeeting_00x:
sleep(1) sleep(1)
safe_click((By.XPATH, "//div[@slot='footer']//span[contains(text(),'确定')]"), wd) safe_click((By.XPATH, "//div[@slot='footer']//span[contains(text(),'确定')]"), wd)
sleep(2) sleep(2)
elif element_type == "click": elif element_type == "click":
safe_click((locator_type, locator_value), wd) safe_click((locator_type, locator_value), wd)
sleep(2) sleep(2)
elif element_type == "getText":
# 切换到新窗口 # 切换到新窗口
wd.switch_to.window(wd.window_handles[1]) wd.switch_to.window(wd.window_handles[1])
notify_text = elment_get_text((By.XPATH, "//div[@id='tab-smcList']"), wd) notify_text = elment_get_text((locator_type, locator_value), wd)
INFO(f"当前页面标题为:{notify_text}") INFO(f"当前页面标题为:{notify_text}")
CHECK_POINT(f"当前页面标题为:{notify_text}", expented_result in notify_text) CHECK_POINT(f"当前页面标题为:{notify_text}", expented_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "SMC会控") SELENIUM_LOG_SCREEN(wd, "50")
# 切换窗口 # 切换窗口
wd.switch_to.window(wd.window_handles[0]) wd.switch_to.window(wd.window_handles[0])
wd.refresh() wd.refresh()
# 调用会议结束函数,传入会议名称 # 调用会议结束函数,传入会议名称
INFO(f"调用message_satus_control函数结束{message_name}名称的会议") INFO(f"调用message_satus_control函数结束{message_name}名称的会议")
message_satus_control(message_name, "会控", "提前结束",wd) message_satus_control(message_name, "会控", "提前结束", wd)
\ No newline at end of file \ No newline at end of file
...@@ -62,15 +62,18 @@ class TxcentMeeting_00x: ...@@ -62,15 +62,18 @@ class TxcentMeeting_00x:
sleep(1) sleep(1)
safe_click((By.XPATH, "//div[@slot='footer']//span[contains(text(),'确定')]"), wd) safe_click((By.XPATH, "//div[@slot='footer']//span[contains(text(),'确定')]"), wd)
sleep(2) sleep(2)
elif element_type == "click": elif element_type == "click":
safe_click((locator_type, locator_value), wd) safe_click((locator_type, locator_value), wd)
sleep(2) sleep(2)
elif element_type == "getText":
# 切换到新窗口 # 切换到新窗口
wd.switch_to.window(wd.window_handles[1]) wd.switch_to.window(wd.window_handles[1])
notify_text = elment_get_text((By.XPATH, "//div[@id='tab-Tencent']"), wd) notify_text = elment_get_text((locator_type,locator_value), wd)
INFO(f"当前页面标题为:{notify_text}") INFO(f"当前页面标题为:{notify_text}")
CHECK_POINT(f"当前页面标题为:{notify_text}", expented_result in notify_text) CHECK_POINT(f"当前页面标题为:{notify_text}", expented_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "腾讯会控界面") SELENIUM_LOG_SCREEN(wd, "50")
# 切换窗口 # 切换窗口
wd.switch_to.window(wd.window_handles[0]) wd.switch_to.window(wd.window_handles[0])
wd.refresh() wd.refresh()
......
...@@ -58,24 +58,26 @@ class EditMessage_00x: ...@@ -58,24 +58,26 @@ class EditMessage_00x:
if step.get("page") == "MessageNameTest": if step.get("page") == "MessageNameTest":
# 这是会议名称字符测试用例 # 这是会议名称字符测试用例
if element_type == "input": if element_type == "input":
if expented_result is "": # 输入会议名称
# 输入会议名称 safe_send_keys((locator_type, locator_value), element_value, wd)
safe_send_keys((locator_type, locator_value), element_value, wd) sleep(1)
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": elif element_type == "click":
safe_click((locator_type, locator_value), wd) safe_click((locator_type, locator_value), wd)
sleep(2) sleep(2)
\ No newline at end of file
elif element_type == "getText":
# 搜索会议数据,获取会议列表的会议名称
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)
SELENIUM_LOG_SCREEN(wd, "50")
# 调用会议删除函数
INFO("调用会议删除函数")
del_message(message_name, wd)
\ No newline at end of file
...@@ -52,28 +52,30 @@ class MeetingMessage_00x: ...@@ -52,28 +52,30 @@ class MeetingMessage_00x:
if step.get("page") == "MessageNameTest": if step.get("page") == "MessageNameTest":
# 这是会议名称字符测试用例 # 这是会议名称字符测试用例
if element_type == "input": if element_type == "input":
if expented_result is "": # 输入会议名称
# 输入会议名称 safe_send_keys((locator_type, locator_value), element_value, wd)
safe_send_keys((locator_type, locator_value), element_value, wd) sleep(1)
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": elif element_type == "click":
# 点击快速预定按钮 # 点击快速预定按钮
safe_click((locator_type, locator_value), wd) safe_click((locator_type, locator_value), wd)
safe_click((locator_type, locator_value), wd) safe_click((locator_type, locator_value), wd)
sleep(2) sleep(2)
safe_click((By.XPATH, "//button[@type='button']//span[contains(text(),'预定')]"), wd) safe_click((By.XPATH, "//button[@type='button']//span[contains(text(),'预定')]"), wd)
sleep(2) sleep(2)
\ No newline at end of file
elif element_type == "getText":
# 搜索会议数据,获取会议列表的会议名称
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)
SELENIUM_LOG_SCREEN(wd, "50")
# 调用会议删除函数
INFO("调用会议删除函数")
del_message(message_name, wd)
\ No newline at end of file
...@@ -53,8 +53,9 @@ class HistoryMessage_00x: ...@@ -53,8 +53,9 @@ class HistoryMessage_00x:
# 点击按钮 # 点击按钮
safe_click((locator_type, locator_value), wd) safe_click((locator_type, locator_value), wd)
sleep(2) sleep(2)
elif element_type == "text": elif element_type == "getText":
# 获取列表筛选数据 # 获取列表筛选数据
notify_text = elment_get_text((locator_type, locator_value), wd) notify_text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取列表筛选数据:{notify_text}") INFO(f"获取列表筛选数据:{notify_text}")
CHECK_POINT(f"判断列表筛选数据是否正确", expented_result in notify_text) CHECK_POINT(f"判断列表筛选数据是否正确", expented_result in notify_text)
\ No newline at end of file SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
...@@ -60,11 +60,13 @@ class MessageApproval: ...@@ -60,11 +60,13 @@ class MessageApproval:
notify_text = get_notify_text(wd, (locator_type, locator_value), "Message_Template", "Template_Edit", "编辑模板") notify_text = get_notify_text(wd, (locator_type, locator_value), "Message_Template", "Template_Edit", "编辑模板")
INFO(f"提示信息为:{notify_text}") INFO(f"提示信息为:{notify_text}")
CHECK_POINT("编辑测试判断是否正确", expented_result in notify_text) CHECK_POINT("编辑测试判断是否正确", expented_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
elif element_type == "getText": elif element_type == "getText":
notify_text = elment_get_text((locator_type, locator_value), wd) notify_text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取文本信息为:{notify_text}") INFO(f"获取文本信息为:{notify_text}")
CHECK_POINT("获取文本判断是否正确", expented_result in notify_text) CHECK_POINT("获取文本判断是否正确", expented_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
# 取消审批会议数据 # 取消审批会议数据
safe_click((By.XPATH, "//span[contains(text(),'取消审批')]"), wd) safe_click((By.XPATH, "//span[contains(text(),'取消审批')]"), wd)
......
...@@ -65,4 +65,5 @@ class MeetingList_000x: ...@@ -65,4 +65,5 @@ class MeetingList_000x:
INFO(f"提示信息为:{notify_text}") INFO(f"提示信息为:{notify_text}")
# 判断提示信息是否正确 # 判断提示信息是否正确
sleep(1) sleep(1)
CHECK_POINT("提示信息是否正确", expented_result in notify_text) CHECK_POINT("提示信息是否正确", expented_result in notify_text)
\ No newline at end of file SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
...@@ -56,4 +56,5 @@ class ConferenceStatistics: ...@@ -56,4 +56,5 @@ class ConferenceStatistics:
elif element_type == "getText": elif element_type == "getText":
notify_text = elment_get_text((locator_type, locator_value), wd) notify_text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取到的文本为:{notify_text}") INFO(f"获取到的文本为:{notify_text}")
CHECK_POINT(f"判断查询结果是否正确", expented_result in notify_text) CHECK_POINT(f"判断查询结果是否正确", expented_result in notify_text)
\ No newline at end of file SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
...@@ -56,6 +56,7 @@ class MessageTemplate_00x: ...@@ -56,6 +56,7 @@ class MessageTemplate_00x:
notify_text = get_notify_text(wd, (locator_type, locator_value), "Message_Template", "Template_Edit", "编辑模板") notify_text = get_notify_text(wd, (locator_type, locator_value), "Message_Template", "Template_Edit", "编辑模板")
INFO(f"提示信息为:{notify_text}") INFO(f"提示信息为:{notify_text}")
CHECK_POINT("编辑测试判断是否正确", expented_result in notify_text) CHECK_POINT("编辑测试判断是否正确", expented_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
# 切换至会议模板模块 # 切换至会议模板模块
safe_click( safe_click(
(By.XPATH, "//ul[contains(@class,'meeting_list')]//span[contains(text(),'会议模板')]"), wd) (By.XPATH, "//ul[contains(@class,'meeting_list')]//span[contains(text(),'会议模板')]"), wd)
\ No newline at end of file
...@@ -55,4 +55,5 @@ class AndroidInformation: ...@@ -55,4 +55,5 @@ class AndroidInformation:
elif element_type == "getText": elif element_type == "getText":
notify_text = elment_get_text((locator_type,locator_value), wd) notify_text = elment_get_text((locator_type,locator_value), wd)
INFO(f"获取的文本为:{notify_text}") INFO(f"获取的文本为:{notify_text}")
CHECK_POINT("判断当前界面是否正确", expented_result in notify_text) CHECK_POINT("判断当前界面是否正确", expented_result in notify_text)
\ No newline at end of file SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
...@@ -48,5 +48,6 @@ class ConferenceStatistics: ...@@ -48,5 +48,6 @@ class ConferenceStatistics:
if element_type == "click": if element_type == "click":
safe_click((locator_type, locator_value), wd) safe_click((locator_type, locator_value), wd)
sleep(1) sleep(1)
SELENIUM_LOG_SCREEN(wd, "50")
elif element_type == "input": elif element_type == "input":
safe_send_keys((locator_type, locator_value), element_value, wd) safe_send_keys((locator_type, locator_value), element_value, wd)
\ No newline at end of file
...@@ -48,6 +48,7 @@ class GlobalConfiguration: ...@@ -48,6 +48,7 @@ class GlobalConfiguration:
if element_type == "click": if element_type == "click":
safe_click((locator_type, locator_value), wd) safe_click((locator_type, locator_value), wd)
sleep(2) sleep(2)
SELENIUM_LOG_SCREEN(wd, "50")
elif element_type == "input": elif element_type == "input":
safe_send_keys((locator_type, locator_value), element_value, wd) safe_send_keys((locator_type, locator_value), element_value, wd)
sleep(2) sleep(2)
\ No newline at end of file
...@@ -54,4 +54,5 @@ class AndroidInformation: ...@@ -54,4 +54,5 @@ class AndroidInformation:
elif element_type == "getText": elif element_type == "getText":
notify_text = elment_get_text((locator_type,locator_value), wd) notify_text = elment_get_text((locator_type,locator_value), wd)
INFO(f"获取的文本为:{notify_text}") INFO(f"获取的文本为:{notify_text}")
CHECK_POINT("判断当前界面是否正确", expented_result in notify_text) CHECK_POINT("判断当前界面是否正确", expented_result in notify_text)
\ No newline at end of file SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
...@@ -57,4 +57,5 @@ class TokenManage: ...@@ -57,4 +57,5 @@ class TokenManage:
elif element_type == "getText": elif element_type == "getText":
notify_text = elment_get_text((locator_type, locator_value), wd) notify_text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取到的文本为:{notify_text}") INFO(f"获取到的文本为:{notify_text}")
CHECK_POINT(f"获取到的文本为:{notify_text}", expented_result in notify_text) CHECK_POINT(f"获取到的文本为:{notify_text}", expented_result in notify_text)
\ No newline at end of file SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
...@@ -58,4 +58,5 @@ class SystemManage: ...@@ -58,4 +58,5 @@ class SystemManage:
elif element_type == "getText": elif element_type == "getText":
notify_text = elment_get_text((locator_type,locator_value), wd) notify_text = elment_get_text((locator_type,locator_value), wd)
INFO(f"获取的文本为:{notify_text}") INFO(f"获取的文本为:{notify_text}")
CHECK_POINT("判断当前界面是否正确", expented_result in notify_text) CHECK_POINT("判断当前界面是否正确", expented_result in notify_text)
\ No newline at end of file SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
...@@ -54,4 +54,5 @@ class ConferenceStatistics: ...@@ -54,4 +54,5 @@ class ConferenceStatistics:
elif element_type == "getTips": elif element_type == "getTips":
notify_text = get_notify_text(wd, (locator_type, locator_value)) notify_text = get_notify_text(wd, (locator_type, locator_value))
INFO(f"获取到的提示信息为:{notify_text}") INFO(f"获取到的提示信息为:{notify_text}")
CHECK_POINT(f"获取到的提示信息为:{notify_text}", expented_result in notify_text) CHECK_POINT(f"获取到的提示信息为:{notify_text}", expented_result in notify_text)
\ No newline at end of file SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论