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

refactor(预定系统): 修正预期结果变量名

- 将多个测试文件中的 expented_result错别字统一修正为 expected_result
- 涉及到的测试文件包括:
  - AI创会.py
  - SMC会控.py
  - 会议修改.py
  - 会议创建.py
  - 会议历史记录.py
  - 会议审批.py  - 会议室列表功能测试.py
  - 会议室管理.py  - 会议模板.py - 信息发布.py
  -信息统计.py
  - 全局配置.py
  - 兰州中石化测试.py
  - 安卓信息.py
  - 工商银行项目测试.py  - 授权码管理.py  - 新-账号密码登录测试.py
  - 系统设置.py
  - 腾讯会控.py
  -账号管理.py
上级 b67a943f
......@@ -47,7 +47,7 @@ class AIMeeting:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 判断页面功能类型
if page_type == "CreateMeeting":
......
......@@ -50,7 +50,7 @@ class SMCMeeting:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 将会议名称赋值,后面调用函数结束会议
message_name = element_value
......@@ -79,7 +79,7 @@ class SMCMeeting:
wd.switch_to.window(wd.window_handles[1])
notify_text = elment_get_text((locator_type, locator_value), wd)
INFO(f"当前页面标题为:{notify_text}")
CHECK_POINT(f"当前页面标题为:{notify_text}", expented_result in notify_text)
CHECK_POINT(f"当前页面标题为:{notify_text}", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
# 切换窗口
wd.switch_to.window(wd.window_handles[0])
......
......@@ -55,7 +55,7 @@ class TxcentMeeting:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 将会议名称赋值,后面调用函数结束会议
message_name = element_value
......@@ -84,7 +84,7 @@ class TxcentMeeting:
wd.switch_to.window(wd.window_handles[1])
notify_text = elment_get_text((locator_type, locator_value), wd)
INFO(f"当前页面标题为:{notify_text}")
CHECK_POINT(f"当前页面标题为:{notify_text}", expented_result in notify_text)
CHECK_POINT(f"当前页面标题为:{notify_text}", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
# 切换窗口
wd.switch_to.window(wd.window_handles[0])
......
......@@ -60,7 +60,7 @@ class EditMessage:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 将会议名称赋值,后面调用函数结束会议
message_name = element_value
......@@ -87,7 +87,7 @@ class EditMessage:
(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)
CHECK_POINT("判断会议是否创建成功", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
# 调用会议删除函数
INFO("调用会议删除函数")
......
......@@ -54,7 +54,7 @@ class MeetingMessage:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 将会议名称赋值,后面调用函数结束会议
message_name = element_value
......@@ -85,7 +85,7 @@ class MeetingMessage:
(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)
CHECK_POINT("判断会议是否创建成功", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
# 调用会议删除函数
INFO("调用会议删除函数")
......
......@@ -51,7 +51,7 @@ class HistoryMessage:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 判断页面功能类型
if page_type == "MessageQuery":
......@@ -69,5 +69,5 @@ class HistoryMessage:
# 获取列表筛选数据
notify_text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取列表筛选数据:{notify_text}")
CHECK_POINT(f"判断列表筛选数据是否正确", expented_result in notify_text)
CHECK_POINT(f"判断列表筛选数据是否正确", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
......@@ -53,7 +53,7 @@ class MessageApproval:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 判断页面功能类型
if page_type == "ApprovalInitiate":
......@@ -71,13 +71,13 @@ class MessageApproval:
notify_text = get_notify_text(wd, (locator_type, locator_value), "Message_Template",
"Template_Edit", "编辑模板")
INFO(f"提示信息为:{notify_text}")
CHECK_POINT("编辑测试判断是否正确", expented_result in notify_text)
CHECK_POINT("编辑测试判断是否正确", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
elif element_type == "getText":
notify_text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取文本信息为:{notify_text}")
CHECK_POINT("获取文本判断是否正确", expented_result in notify_text)
CHECK_POINT("获取文本判断是否正确", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
# 取消审批会议数据
......
......@@ -48,7 +48,7 @@ class MeetingRoomList:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
if page_type == "MeetingList_MeetingRoomToken":
if element_type == "input":
......@@ -67,7 +67,7 @@ class MeetingRoomList:
safe_click((locator_type, locator_value), wd)
sleep(2)
# 判断是否为已授权的会议室,如果是,则点击会议预定判断是否进入会议预定界面,否则,点击会议预定,查看提示信息
if "会议" in expented_result:
if "会议" in expected_result:
notify_text = elment_get_text((By.XPATH, "//div[@class='reserve_Title']"), wd)
else:
notify_text = get_notify_text(wd, (By.XPATH, "//p[@class='el-message__content']"),
......@@ -75,5 +75,5 @@ class MeetingRoomList:
INFO(f"提示信息为:{notify_text}")
# 判断提示信息是否正确
sleep(1)
CHECK_POINT("提示信息是否正确", expented_result in notify_text)
CHECK_POINT("提示信息是否正确", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
......@@ -51,7 +51,7 @@ class ConferenceRoomManagement:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 判断页面功能类型
if page_type == "ConferenceManageQuery":
......@@ -66,5 +66,5 @@ class ConferenceRoomManagement:
elif element_type == "getText":
notify_text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取到的文本为:{notify_text}")
CHECK_POINT(f"判断查询结果是否正确", expented_result in notify_text)
CHECK_POINT(f"判断查询结果是否正确", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
......@@ -51,7 +51,7 @@ class MessageTemplate:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 判断页面功能类型
if page_type== "EditTemplate":
......@@ -66,7 +66,7 @@ class MessageTemplate:
notify_text = get_notify_text(wd, (locator_type, locator_value), "Message_Template",
"Template_Edit", "编辑模板")
INFO(f"提示信息为:{notify_text}")
CHECK_POINT("编辑测试判断是否正确", expented_result in notify_text)
CHECK_POINT("编辑测试判断是否正确", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
# 切换至会议模板模块
safe_click(
......
......@@ -51,7 +51,7 @@ class InformationDelivery:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 判断页面功能类型
if page_type == "MaterialManagement":
......@@ -65,5 +65,5 @@ class InformationDelivery:
elif element_type == "getText":
notify_text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取的文本为:{notify_text}")
CHECK_POINT("判断当前界面是否正确", expented_result in notify_text)
CHECK_POINT("判断当前界面是否正确", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
......@@ -51,7 +51,7 @@ class InformationStatistics:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 判断页面功能类型
if page_type == "ConferenceStatistics":
......
......@@ -51,7 +51,7 @@ class GlobalConfiguration:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 判断页面功能类型
if page_type == "GlobalConfiguration":
......
......@@ -51,7 +51,7 @@ class AndroidInformation:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 判断页面功能类型
if page_type == "AndroidInformation":
......@@ -64,5 +64,5 @@ class AndroidInformation:
elif element_type == "getText":
notify_text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取的文本为:{notify_text}")
CHECK_POINT("判断当前界面是否正确", expented_result in notify_text)
CHECK_POINT("判断当前界面是否正确", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
......@@ -51,7 +51,7 @@ class TokenManage:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 判断页面功能类型
if page_type == "TokenManage":
......@@ -67,5 +67,5 @@ class TokenManage:
elif element_type == "getText":
notify_text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取到的文本为:{notify_text}")
CHECK_POINT(f"获取到的文本为:{notify_text}", expented_result in notify_text)
CHECK_POINT(f"获取到的文本为:{notify_text}", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
......@@ -51,7 +51,7 @@ class Login:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
if element_type == 'input':
INFO(f"输入值: {element_value}")
......@@ -62,7 +62,7 @@ class Login:
INFO("点击【登录】按钮")
safe_click((locator_type, locator_value), wd)
sleep(2)
if "成功" in expented_result:
if "成功" in expected_result:
# 获取登录成功提示信息
notify_text = elment_get_text((By.CSS_SELECTOR, "div[class='meeting_t'] span:nth-child(1)"), wd)
# 截屏并记录日志
......@@ -93,20 +93,20 @@ class Login:
safe_click((By.XPATH, "//img[@title='退出登录']"), wd)
sleep(2)
elif "错误" in expented_result:
elif "错误" in expected_result:
# 获取登录错误提示信息
notify_text = get_notify_text(
wd,
(By.XPATH, "//p[@class='el-message__content']"),
'Login',
'Login_Pwd',
f"检查{expented_result}登录的提示信息"
f"检查{expected_result}登录的提示信息"
)
# 记录获取到的结果
INFO(f"获取到的结果:{notify_text}")
CHECK_POINT('检查是否出现提示弹窗', expented_result in notify_text)
CHECK_POINT('检查是否出现提示弹窗', expected_result in notify_text)
# 检查提示信息是否包含预期的错误信息
# if CHECK_POINT('检查是否出现提示弹窗', expented_result in notify_text):
# if CHECK_POINT('检查是否出现提示弹窗', expected_result in notify_text):
# # 如果提示信息不正确,记录为失败
# write_xlsx_data(
# xlsx_file_path,
......@@ -126,20 +126,20 @@ class Login:
# )
sleep(2)
elif "请输入" in expented_result:
elif "请输入" in expected_result:
# 获取登录提示信息
notify_text = get_notify_text(
wd,
(By.XPATH, "//p[@class='el-message__content']"),
'Login',
'Login_Pwd',
f"检查{expented_result}登录的提示信息"
f"检查{expected_result}登录的提示信息"
)
# 记录获取到的结果
INFO(f"获取到的结果:{notify_text}")
CHECK_POINT('检查是否出现提示弹窗', expented_result in notify_text)
CHECK_POINT('检查是否出现提示弹窗', expected_result in notify_text)
# 检查提示信息是否包含预期的提示信息
# if CHECK_POINT('检查是否出现提示弹窗', expented_result in notify_text):
# if CHECK_POINT('检查是否出现提示弹窗', expected_result in notify_text):
# # 如果提示信息不正确,记录为失败
# write_xlsx_data(
# xlsx_file_path,
......
......@@ -51,7 +51,7 @@ class SystemManage:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 判断页面功能类型
if page_type == "SystemLog":
......@@ -68,5 +68,5 @@ class SystemManage:
elif element_type == "getText":
notify_text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取的文本为:{notify_text}")
CHECK_POINT("判断当前界面是否正确", expented_result in notify_text)
CHECK_POINT("判断当前界面是否正确", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
......@@ -51,7 +51,7 @@ class AccountManagement:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 判断页面功能类型
if page_type == "CompanyManagement":
......@@ -64,5 +64,5 @@ class AccountManagement:
elif element_type == "getTips":
notify_text = get_notify_text(wd, (locator_type, locator_value))
INFO(f"获取到的提示信息为:{notify_text}")
CHECK_POINT(f"获取到的提示信息为:{notify_text}", expented_result in notify_text)
CHECK_POINT(f"获取到的提示信息为:{notify_text}", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
......@@ -64,10 +64,10 @@ class LanzhouSinopecProject:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 赋值等待时间
# sleep_time = step.get('sleep_time')
INFO(f"页面: {page_type}、元素定位类型: {locator_type}、元素定位值: {locator_value}、元素类型: {element_type}、元素值: {element_value}、预期结果: {expented_result}")
INFO(f"页面: {page_type}、元素定位类型: {locator_type}、元素定位值: {locator_value}、元素类型: {element_type}、元素值: {element_value}、预期结果: {expected_result}")
if element_type == "click":
safe_click((locator_type, locator_value), wd)
......@@ -98,11 +98,11 @@ class LanzhouSinopecProject:
notify_text = get_notify_text(wd, (locator_type, locator_value))
INFO(f"获取到的提示信息为:{notify_text}")
sleep(2)
CHECK_POINT(f"获取到的提示信息为:{notify_text}", expented_result in notify_text)
CHECK_POINT(f"获取到的提示信息为:{notify_text}", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "getText":
text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取到的文本信息为:{text}")
CHECK_POINT(f"获取到的文本信息为:{text}", expented_result in text)
CHECK_POINT(f"获取到的文本信息为:{text}", expected_result in text)
SELENIUM_LOG_SCREEN(wd, "75")
\ No newline at end of file
......@@ -57,8 +57,8 @@ class LicensePlateFilling:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
INFO(f"页面: {page_type}、元素定位类型: {locator_type}、元素定位值: {locator_value}、元素类型: {element_type}、元素值: {element_value}、预期结果: {expented_result}")
expected_result = step.get('expected_result')
INFO(f"页面: {page_type}、元素定位类型: {locator_type}、元素定位值: {locator_value}、元素类型: {element_type}、元素值: {element_value}、预期结果: {expected_result}")
if element_type == "click":
safe_click((locator_type, locator_value), wd)
......@@ -87,11 +87,11 @@ class LicensePlateFilling:
notify_text = get_notify_text(wd, (locator_type, locator_value))
INFO(f"获取到的提示信息为:{notify_text}")
sleep(2)
CHECK_POINT(f"获取到的提示信息为:{notify_text}", expented_result in notify_text)
CHECK_POINT(f"获取到的提示信息为:{notify_text}", expected_result in notify_text)
SELENIUM_LOG_SCREEN(wd, "50")
elif element_type == "getText":
text = elment_get_text((locator_type, locator_value), wd)
INFO(f"获取到的文本信息为:{text}")
CHECK_POINT(f"获取到的文本信息为:{text}", expented_result in text)
CHECK_POINT(f"获取到的文本信息为:{text}", expected_result in text)
SELENIUM_LOG_SCREEN(wd, "50")
\ No newline at end of file
......@@ -53,7 +53,7 @@ class ChangAnMessageApproval:
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
expected_result = step.get('expected_result')
# 判断页面功能类型
if page_type == "ApprovalInitiate":
......@@ -70,7 +70,7 @@ class ChangAnMessageApproval:
notify_text = get_notify_text(wd, (locator_type, locator_value), "Message_Template",
"Template_Edit", "长安审批测试")
INFO(f"提示信息为:{notify_text}")
if CHECK_POINT("编辑测试判断是否正确", expented_result in notify_text):
if CHECK_POINT("编辑测试判断是否正确", expected_result in notify_text):
write_xlsx_data(xlsx_file_path, "会议审批", name,"失败", r"D:\GithubData\自动化\ubains-module-test\预定系统\reports\imgs\Exhibit_Inspect\Android\门口屏截屏.png")
else:
write_xlsx_data(xlsx_file_path, "会议审批", name,"通过", r"D:\GithubData\自动化\ubains-module-test\预定系统\reports\imgs\Exhibit_Inspect\Android\门口屏截屏.png")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论