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

refactor(项目定制): 删除兰州中石化项目相关测试用例- 删除了多个与兰州中石化项目相关的测试用例文件

- 更新了测试用例的标签,从 '合并测试' 改为 '兰州中石化项目'
上级 7c11b153
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("兰州中石化项目测试环境")
user_login("test@user2", "Ubains@1357")
sleep(2)
wd = GSTORE['wd']
sleep(1)
# 点击【议题申报】按钮进入模块
INFO("点击【代办事宜】按钮")
safe_click((By.XPATH, "//div[@id='TodoList']"), wd)
sleep(1)
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 *
# 构建XLSX文件的绝对路径
xlsx_file_path = os.path.join(预定系统_path, '测试数据', '兰州中石化项目测试用例.xlsx')
class AgencyMatters:
tags = ['兰州中石化项目代办事宜','兰州中石化项目']
"""
执行指令是:
1.cd 预定系统
2.hytest --report_title 兰州中石化项目代办事宜测试报告 --report_url_prefix http://nat.ubainsyun.com:31135 --tag 兰州中石化项目代办事宜
"""
ddt_cases = read_xlsx_data(xlsx_file_path, sheet_name='代办事宜',case_type="兰州中石化项目25-05-24")
# 测试开始前调用clear_columns_in_xlsx函数,将测试用例中的测试结果和日志截图置空
# clear_columns_in_xlsx(xlsx_file_path, sheet_name='会议创建', columns_to_clear=['测试结果', '测试频次', '日志截图'])
def teststeps(self):
"""
执行测试步骤函数,主要用于执行读取的测试用例并进行信息统计模块功能测试操作
"""
# 从全局存储中获取webdriver对象
wd = GSTORE['wd']
name = self.name
# 刷新页面
wd.refresh()
wd.refresh()
for step in self.para:
# 赋值页面类型page
page_type = step.get('page')
# 赋值元素定位类型,并将字符串转为Enum类型
locator_type = get_by_enum(step.get('locator_type'))
# 赋值元素值
locator_value = step.get('locator_value')
# 赋值元素类型,例如:click点击、input输入框等
element_type = step.get('element_type')
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
# 赋值等待时间
# sleep_time = step.get('sleep_time')
INFO(f"页面: {page_type}、元素定位类型: {locator_type}、元素定位值: {locator_value}、元素类型: {element_type}、元素值: {element_value}、预期结果: {expented_result}")
if element_type == "click":
safe_click((locator_type, locator_value), wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "input":
safe_send_keys((locator_type, locator_value), element_value, wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "login":
safe_click((By.XPATH, "//div[contains(@class,'quit')]"), wd)
sleep(2)
user_login(element_value[0],element_value[1])
sleep(2)
elif element_type == "getTips":
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)
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)
SELENIUM_LOG_SCREEN(wd, "75")
\ 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("兰州中石化项目测试环境")
user_login("admin", "Ubains@4321")
sleep(2)
wd = GSTORE['wd']
sleep(1)
# 点击【议题申报】按钮进入模块
INFO("点击【会议信息】按钮")
safe_click((By.XPATH, "//div[@id='MeetingInfo']"), wd)
sleep(1)
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 *
# 构建XLSX文件的绝对路径
xlsx_file_path = os.path.join(预定系统_path, '测试数据', '兰州中石化项目测试用例.xlsx')
class TopicInformation:
tags = ['兰州中石化项目会议信息','兰州中石化项目']
"""
执行指令是:
1.cd 预定系统
2.hytest --report_title 兰州中石化项目会议信息测试报告 --report_url_prefix http://nat.ubainsyun.com:31135 --tag 兰州中石化项目会议信息
"""
ddt_cases = read_xlsx_data(xlsx_file_path, sheet_name='会议信息',case_type="兰州中石化项目25-05-24")
# 测试开始前调用clear_columns_in_xlsx函数,将测试用例中的测试结果和日志截图置空
# clear_columns_in_xlsx(xlsx_file_path, sheet_name='会议创建', columns_to_clear=['测试结果', '测试频次', '日志截图'])
def teststeps(self):
"""
执行测试步骤函数,主要用于执行读取的测试用例并进行信息统计模块功能测试操作
"""
# 从全局存储中获取webdriver对象
wd = GSTORE['wd']
name = self.name
# 刷新页面
wd.refresh()
wd.refresh()
for step in self.para:
# 赋值页面类型page
page_type = step.get('page')
# 赋值元素定位类型,并将字符串转为Enum类型
locator_type = get_by_enum(step.get('locator_type'))
# 赋值元素值
locator_value = step.get('locator_value')
# 赋值元素类型,例如:click点击、input输入框等
element_type = step.get('element_type')
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
# 赋值等待时间
# sleep_time = step.get('sleep_time')
INFO(f"页面: {page_type}、元素定位类型: {locator_type}、元素定位值: {locator_value}、元素类型: {element_type}、元素值: {element_value}、预期结果: {expented_result}")
if element_type == "click":
safe_click((locator_type, locator_value), wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "input":
safe_send_keys((locator_type, locator_value), element_value, wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "login":
safe_click((By.XPATH, "//div[contains(@class,'quit')]"), wd)
sleep(2)
user_login(element_value[0],element_value[1])
sleep(2)
elif element_type == "getTips":
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)
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)
SELENIUM_LOG_SCREEN(wd, "75")
\ 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("兰州中石化项目测试环境")
user_login("admin", "Ubains@4321")
sleep(2)
wd = GSTORE['wd']
sleep(1)
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 *
# 构建XLSX文件的绝对路径
xlsx_file_path = os.path.join(预定系统_path, '测试数据', '兰州中石化项目测试用例.xlsx')
class ConferenceDeclaration:
tags = ['兰州中石化项目会议申报','兰州中石化项目']
"""
执行指令是:
1.cd 预定系统
2.hytest --report_title 兰州中石化项目会议申报测试报告 --report_url_prefix http://nat.ubainsyun.com:31135 --tag 兰州中石化项目会议申报
"""
ddt_cases = read_xlsx_data(xlsx_file_path, sheet_name='会议申报',case_type="兰州中石化项目25-05-24")
# 测试开始前调用clear_columns_in_xlsx函数,将测试用例中的测试结果和日志截图置空
# clear_columns_in_xlsx(xlsx_file_path, sheet_name='会议创建', columns_to_clear=['测试结果', '测试频次', '日志截图'])
def teststeps(self):
"""
执行测试步骤函数,主要用于执行读取的测试用例并进行信息统计模块功能测试操作
"""
# 从全局存储中获取webdriver对象
wd = GSTORE['wd']
name = self.name
for step in self.para:
# 赋值页面类型page
page_type = step.get('page')
# 赋值元素定位类型,并将字符串转为Enum类型
locator_type = get_by_enum(step.get('locator_type'))
# 赋值元素值
locator_value = step.get('locator_value')
# 赋值元素类型,例如:click点击、input输入框等
element_type = step.get('element_type')
# 赋值元素值,例如输入框的输入值
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}")
if element_type == "click":
safe_click((locator_type, locator_value), wd)
sleep(2)
elif element_type == "input":
safe_send_keys((locator_type, locator_value), element_value, wd)
sleep(2)
elif element_type == "getTips":
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)
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)
SELENIUM_LOG_SCREEN(wd, "50")
# 执行完一个用例就刷新一下页面重置
wd.refresh()
wd.refresh()
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("兰州中石化项目测试环境")
user_login("admin", "Ubains@4321")
sleep(2)
wd = GSTORE['wd']
sleep(1)
# 点击【议题申报】按钮进入模块
INFO("点击【会议管理】按钮")
safe_click((By.XPATH, "//div[@id='MeetingManage']"), wd)
sleep(1)
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 *
# 构建XLSX文件的绝对路径
xlsx_file_path = os.path.join(预定系统_path, '测试数据', '兰州中石化项目测试用例.xlsx')
class ManagementOfMeetings:
tags = ['兰州中石化项目会议管理','兰州中石化项目']
"""
执行指令是:
1.cd 预定系统
2.hytest --report_title 兰州中石化项目会议管理测试报告 --report_url_prefix http://nat.ubainsyun.com:31135 --tag 兰州中石化项目会议管理
"""
ddt_cases = read_xlsx_data(xlsx_file_path, sheet_name='会议管理',case_type="兰州中石化项目25-05-24")
# 测试开始前调用clear_columns_in_xlsx函数,将测试用例中的测试结果和日志截图置空
# clear_columns_in_xlsx(xlsx_file_path, sheet_name='会议创建', columns_to_clear=['测试结果', '测试频次', '日志截图'])
def teststeps(self):
"""
执行测试步骤函数,主要用于执行读取的测试用例并进行信息统计模块功能测试操作
"""
# 从全局存储中获取webdriver对象
wd = GSTORE['wd']
name = self.name
# 刷新页面
wd.refresh()
wd.refresh()
for step in self.para:
# 赋值页面类型page
page_type = step.get('page')
# 赋值元素定位类型,并将字符串转为Enum类型
locator_type = get_by_enum(step.get('locator_type'))
# 赋值元素值
locator_value = step.get('locator_value')
# 赋值元素类型,例如:click点击、input输入框等
element_type = step.get('element_type')
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
# 赋值等待时间
# sleep_time = step.get('sleep_time')
INFO(f"页面: {page_type}、元素定位类型: {locator_type}、元素定位值: {locator_value}、元素类型: {element_type}、元素值: {element_value}、预期结果: {expented_result}")
if element_type == "click":
safe_click((locator_type, locator_value), wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "input":
safe_send_keys((locator_type, locator_value), element_value, wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "login":
safe_click((By.XPATH, "//div[contains(@class,'quit')]"), wd)
sleep(2)
user_login(element_value[0],element_value[1])
sleep(2)
elif element_type == "getTips":
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)
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)
SELENIUM_LOG_SCREEN(wd, "75")
\ No newline at end of file
......@@ -14,11 +14,11 @@ from 预定系统.Base.base import *
xlsx_file_path = os.path.join(预定系统_path, '测试数据', '兰州中石化项目测试用例.xlsx')
class LanzhouSinopecProject:
tags = ['合并测试']
tags = ['兰州中石化项目']
"""
执行指令是:
1.cd 预定系统
2.hytest --report_title 兰州中石化项目测试报告 --report_url_prefix http://nat.ubainsyun.com:31135 --tag 合并测试
2.hytest --report_title 兰州中石化项目测试报告 --report_url_prefix http://nat.ubainsyun.com:31135 --tag 兰州中石化项目
"""
ddt_cases = read_xlsx_data(xlsx_file_path, case_type="兰州中石化项目25-05-24")
# 测试开始前调用clear_columns_in_xlsx函数,将测试用例中的测试结果和日志截图置空
......
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("兰州中石化项目测试环境")
user_login("admin", "Ubains@4321")
sleep(2)
wd = GSTORE['wd']
sleep(1)
# 点击【议题申报】按钮进入模块
INFO("点击【决策会议】按钮")
safe_click((By.XPATH, "//div[@id='DecisionMeeting']"), wd)
sleep(1)
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 *
# 构建XLSX文件的绝对路径
xlsx_file_path = os.path.join(预定系统_path, '测试数据', '兰州中石化项目测试用例.xlsx')
class DecisionMakingMeetings:
tags = ['兰州中石化项目决策会议','兰州中石化项目']
"""
执行指令是:
1.cd 预定系统
2.hytest --report_title 兰州中石化项目决策会议测试报告 --report_url_prefix http://nat.ubainsyun.com:31135 --tag 兰州中石化项目决策会议
"""
ddt_cases = read_xlsx_data(xlsx_file_path, sheet_name='决策会议',case_type="兰州中石化项目25-05-24")
# 测试开始前调用clear_columns_in_xlsx函数,将测试用例中的测试结果和日志截图置空
# clear_columns_in_xlsx(xlsx_file_path, sheet_name='会议创建', columns_to_clear=['测试结果', '测试频次', '日志截图'])
def teststeps(self):
"""
执行测试步骤函数,主要用于执行读取的测试用例并进行信息统计模块功能测试操作
"""
# 从全局存储中获取webdriver对象
wd = GSTORE['wd']
name = self.name
# 刷新页面
wd.refresh()
wd.refresh()
for step in self.para:
# 赋值页面类型page
page_type = step.get('page')
# 赋值元素定位类型,并将字符串转为Enum类型
locator_type = get_by_enum(step.get('locator_type'))
# 赋值元素值
locator_value = step.get('locator_value')
# 赋值元素类型,例如:click点击、input输入框等
element_type = step.get('element_type')
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
# 赋值等待时间
# sleep_time = step.get('sleep_time')
INFO(f"页面: {page_type}、元素定位类型: {locator_type}、元素定位值: {locator_value}、元素类型: {element_type}、元素值: {element_value}、预期结果: {expented_result}")
if element_type == "click":
safe_click((locator_type, locator_value), wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "input":
safe_send_keys((locator_type, locator_value), element_value, wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "login":
safe_click((By.XPATH, "//div[contains(@class,'quit')]"), wd)
sleep(2)
user_login(element_value[0],element_value[1])
sleep(2)
elif element_type == "getTips":
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)
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)
SELENIUM_LOG_SCREEN(wd, "75")
\ 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("兰州中石化项目测试环境")
user_login("superAdminLz", "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 *
# 构建XLSX文件的绝对路径
xlsx_file_path = os.path.join(预定系统_path, '测试数据', '兰州中石化项目测试用例.xlsx')
class PaperlessTablet:
tags = ['兰州中石化项目平板无纸化','兰州中石化项目']
"""
执行指令是:
1.cd 预定系统
2.hytest --report_title 兰州中石化项目平板无纸化测试报告 --report_url_prefix http://nat.ubainsyun.com:31135 --tag 兰州中石化项目平板无纸化
"""
ddt_cases = read_xlsx_data(xlsx_file_path, sheet_name='平板无纸化',case_type="兰州中石化项目25-05-24")
# 测试开始前调用clear_columns_in_xlsx函数,将测试用例中的测试结果和日志截图置空
# clear_columns_in_xlsx(xlsx_file_path, sheet_name='会议创建', columns_to_clear=['测试结果', '测试频次', '日志截图'])
def teststeps(self):
"""
执行测试步骤函数,主要用于执行读取的测试用例并进行信息统计模块功能测试操作
"""
# 从全局存储中获取webdriver对象
wd = GSTORE['wd']
name = self.name
# 刷新页面
wd.refresh()
wd.refresh()
for step in self.para:
# 赋值页面类型page
page_type = step.get('page')
# 赋值元素定位类型,并将字符串转为Enum类型
locator_type = get_by_enum(step.get('locator_type'))
# 赋值元素值
locator_value = step.get('locator_value')
# 赋值元素类型,例如:click点击、input输入框等
element_type = step.get('element_type')
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
# 赋值等待时间
# sleep_time = step.get('sleep_time')
INFO(f"页面: {page_type}、元素定位类型: {locator_type}、元素定位值: {locator_value}、元素类型: {element_type}、元素值: {element_value}、预期结果: {expented_result}")
if element_type == "click":
safe_click((locator_type, locator_value), wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "input":
safe_send_keys((locator_type, locator_value), element_value, wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "login":
safe_click((By.XPATH, "//div[contains(@class,'quit')]"), wd)
sleep(2)
user_login(element_value[0],element_value[1])
sleep(2)
elif element_type == "getTips":
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)
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)
SELENIUM_LOG_SCREEN(wd, "75")
\ 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("兰州中石化项目测试环境")
user_login("admin", "Ubains@4321")
sleep(2)
wd = GSTORE['wd']
# 点击【系统管理】展开下拉框
INFO("点击【系统管理】展开下拉框")
safe_click((By.ID, "manage-collapse"), wd)
sleep(1)
# 点击【角色权限管理】按钮进入模块
INFO("点击【角色权限管理】按钮进入模块")
safe_click((By.XPATH, "//div[@id='PermissionManage']"), wd)
sleep(1)
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 *
# 构建XLSX文件的绝对路径
xlsx_file_path = os.path.join(预定系统_path, '测试数据', '兰州中石化项目测试用例.xlsx')
class RolePermissionManagement:
tags = ['兰州中石化项目角色权限管理','兰州中石化项目']
"""
执行指令是:
1.cd 预定系统
2.hytest --report_title 兰州中石化项目角色权限管理测试报告 --report_url_prefix http://nat.ubainsyun.com:31135 --tag 兰州中石化项目角色权限管理
"""
ddt_cases = read_xlsx_data(xlsx_file_path, sheet_name='角色权限管理',case_type="兰州中石化项目25-05-24")
# 测试开始前调用clear_columns_in_xlsx函数,将测试用例中的测试结果和日志截图置空
# clear_columns_in_xlsx(xlsx_file_path, sheet_name='会议创建', columns_to_clear=['测试结果', '测试频次', '日志截图'])
def teststeps(self):
"""
执行测试步骤函数,主要用于执行读取的测试用例并进行信息统计模块功能测试操作
"""
# 从全局存储中获取webdriver对象
wd = GSTORE['wd']
name = self.name
# 执行完一个用例就刷新一下页面重置
wd.refresh()
sleep(4)
for step in self.para:
# 赋值页面类型page
page_type = step.get('page')
# 赋值元素定位类型,并将字符串转为Enum类型
locator_type = get_by_enum(step.get('locator_type'))
# 赋值元素值
locator_value = step.get('locator_value')
# 赋值元素类型,例如:click点击、input输入框等
element_type = step.get('element_type')
# 赋值元素值,例如输入框的输入值
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}")
if element_type == "click":
safe_click((locator_type, locator_value), wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "input":
safe_send_keys((locator_type, locator_value), element_value, wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "getTips":
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)
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)
SELENIUM_LOG_SCREEN(wd, "75")
\ 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("兰州中石化项目测试环境")
user_login("admin", "Ubains@4321")
sleep(2)
wd = GSTORE['wd']
sleep(1)
# 点击【议题申报】按钮进入模块
INFO("点击【议题信息】按钮")
safe_click((By.XPATH, "/div[@id='TopicList']"), wd)
sleep(1)
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 *
# 构建XLSX文件的绝对路径
xlsx_file_path = os.path.join(预定系统_path, '测试数据', '兰州中石化项目测试用例.xlsx')
class TopicInformation:
tags = ['兰州中石化项目议题信息','兰州中石化项目']
"""
执行指令是:
1.cd 预定系统
2.hytest --report_title 兰州中石化项目议题信息测试报告 --report_url_prefix http://nat.ubainsyun.com:31135 --tag 兰州中石化项目议题信息
"""
ddt_cases = read_xlsx_data(xlsx_file_path, sheet_name='议题信息',case_type="兰州中石化项目25-05-24")
# 测试开始前调用clear_columns_in_xlsx函数,将测试用例中的测试结果和日志截图置空
# clear_columns_in_xlsx(xlsx_file_path, sheet_name='会议创建', columns_to_clear=['测试结果', '测试频次', '日志截图'])
def teststeps(self):
"""
执行测试步骤函数,主要用于执行读取的测试用例并进行信息统计模块功能测试操作
"""
# 从全局存储中获取webdriver对象
wd = GSTORE['wd']
name = self.name
# 刷新页面
wd.refresh()
wd.refresh()
for step in self.para:
# 赋值页面类型page
page_type = step.get('page')
# 赋值元素定位类型,并将字符串转为Enum类型
locator_type = get_by_enum(step.get('locator_type'))
# 赋值元素值
locator_value = step.get('locator_value')
# 赋值元素类型,例如:click点击、input输入框等
element_type = step.get('element_type')
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
# 赋值等待时间
# sleep_time = step.get('sleep_time')
INFO(f"页面: {page_type}、元素定位类型: {locator_type}、元素定位值: {locator_value}、元素类型: {element_type}、元素值: {element_value}、预期结果: {expented_result}")
if element_type == "click":
safe_click((locator_type, locator_value), wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "input":
safe_send_keys((locator_type, locator_value), element_value, wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "login":
safe_click((By.XPATH, "//div[contains(@class,'quit')]"), wd)
sleep(2)
user_login(element_value[0],element_value[1])
sleep(2)
elif element_type == "getTips":
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)
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)
SELENIUM_LOG_SCREEN(wd, "75")
\ 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("兰州中石化项目测试环境")
user_login("admin", "Ubains@4321")
sleep(2)
wd = GSTORE['wd']
sleep(1)
# 点击【议题申报】按钮进入模块
INFO("点击【议题列表】按钮")
safe_click((By.XPATH, "//div[@id='TopicList']"), wd)
sleep(1)
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 *
# 构建XLSX文件的绝对路径
xlsx_file_path = os.path.join(预定系统_path, '测试数据', '兰州中石化项目测试用例.xlsx')
class ListOfTopics:
tags = ['兰州中石化项目议题列表','兰州中石化项目']
"""
执行指令是:
1.cd 预定系统
2.hytest --report_title 兰州中石化项目议题列表测试报告 --report_url_prefix http://nat.ubainsyun.com:31135 --tag 兰州中石化项目议题列表
"""
ddt_cases = read_xlsx_data(xlsx_file_path, sheet_name='议题列表',case_type="兰州中石化项目25-05-24")
# 测试开始前调用clear_columns_in_xlsx函数,将测试用例中的测试结果和日志截图置空
# clear_columns_in_xlsx(xlsx_file_path, sheet_name='会议创建', columns_to_clear=['测试结果', '测试频次', '日志截图'])
def teststeps(self):
"""
执行测试步骤函数,主要用于执行读取的测试用例并进行信息统计模块功能测试操作
"""
# 从全局存储中获取webdriver对象
wd = GSTORE['wd']
name = self.name
# 刷新页面
wd.refresh()
wd.refresh()
for step in self.para:
# 赋值页面类型page
page_type = step.get('page')
# 赋值元素定位类型,并将字符串转为Enum类型
locator_type = get_by_enum(step.get('locator_type'))
# 赋值元素值
locator_value = step.get('locator_value')
# 赋值元素类型,例如:click点击、input输入框等
element_type = step.get('element_type')
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
# 赋值等待时间
# sleep_time = step.get('sleep_time')
INFO(f"页面: {page_type}、元素定位类型: {locator_type}、元素定位值: {locator_value}、元素类型: {element_type}、元素值: {element_value}、预期结果: {expented_result}")
if element_type == "click":
safe_click((locator_type, locator_value), wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "input":
safe_send_keys((locator_type, locator_value), element_value, wd)
sleep(2)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "login":
safe_click((By.XPATH, "//div[contains(@class,'quit')]"), wd)
sleep(2)
user_login(element_value[0],element_value[1])
sleep(2)
elif element_type == "getTips":
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)
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)
SELENIUM_LOG_SCREEN(wd, "75")
\ 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("兰州中石化项目测试环境")
user_login("admin", "Ubains@4321")
sleep(2)
wd = GSTORE['wd']
sleep(1)
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 *
# 构建XLSX文件的绝对路径
xlsx_file_path = os.path.join(预定系统_path, '测试数据', '兰州中石化项目测试用例.xlsx')
class TopicDeclaration:
tags = ['兰州中石化项目议题申报','兰州中石化项目']
"""
执行指令是:
1.cd 预定系统
2.hytest --report_title 兰州中石化项目议题申报测试报告 --report_url_prefix http://nat.ubainsyun.com:31135 --tag 兰州中石化项目议题申报
"""
ddt_cases = read_xlsx_data(xlsx_file_path, sheet_name='议题申报',case_type="兰州中石化项目25-05-24")
# 测试开始前调用clear_columns_in_xlsx函数,将测试用例中的测试结果和日志截图置空
# clear_columns_in_xlsx(xlsx_file_path, sheet_name='会议创建', columns_to_clear=['测试结果', '测试频次', '日志截图'])
def teststeps(self):
"""
执行测试步骤函数,主要用于执行读取的测试用例并进行信息统计模块功能测试操作
"""
# 从全局存储中获取webdriver对象
wd = GSTORE['wd']
name = self.name
# 执行完一个用例就刷新一下页面重置
wd.refresh()
wd.refresh()
wd.refresh()
sleep(10)
# 点击【议题申报】按钮进入模块
INFO("点击【议题申报】按钮")
safe_click((By.XPATH, "//div[@id='CreateTopic']"), wd)
sleep(1)
for step in self.para:
# 赋值页面类型page
page_type = step.get('page')
# 赋值元素定位类型,并将字符串转为Enum类型
locator_type = get_by_enum(step.get('locator_type'))
# 赋值元素值
locator_value = step.get('locator_value')
# 赋值元素类型,例如:click点击、input输入框等
element_type = step.get('element_type')
# 赋值元素值,例如输入框的输入值
element_value = step.get('element_value')
# 赋值预期结果
expented_result = step.get('expented_result')
# 赋值等待时间
# sleep_time = step.get('sleep_time')
INFO(f"页面: {page_type}、元素定位类型: {locator_type}、元素定位值: {locator_value}、元素类型: {element_type}、元素值: {element_value}、预期结果: {expented_result}")
if element_type == "click":
safe_click((locator_type, locator_value), wd)
SELENIUM_LOG_SCREEN(wd, "75")
elif element_type == "input":
safe_send_keys((locator_type, locator_value), element_value, wd)
SELENIUM_LOG_SCREEN(wd, "75")
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)
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)
SELENIUM_LOG_SCREEN(wd, "75")
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4389,12 +4389,12 @@ CSV文件已读取
尝试打开文件路径: E:\GithubData\自动化\ubains-module-test\预定系统\测试数据\兰州中石化项目测试用例.xlsx
XLSX文件成功打开
正在处理工作表: 会议统计
正在处理工作表: 账号管理
表头列名: ['序列号', '功能模块', '功能类别', '用例编号', '功能描述', '用例等级', '功能编号', '用例名称', '预置条件', '操作步骤', 'JSON', '预期结果', '测试结果', '测试频次', '日志截图', '备注']
行 4 原始JSON数据: {
"name": "会议统计-000",
"name": "账号管理-000",
"para": [{
"page": "ConferenceStatistics",
"page": "AccountManagement",
"locator_type": "XPATH",
"locator_value": "//div[@class='quit']",
"element_type": "click",
......@@ -4402,7 +4402,7 @@ XLSX文件成功打开
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"page": "AccountManagement",
"locator_type": "XPATH",
"locator_value": "",
"element_type": "login",
......@@ -4410,140 +4410,84 @@ XLSX文件成功打开
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"page": "AccountManagement",
"locator_type": "XPATH",
"locator_value": "(//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]",
"locator_value": "(//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[2]",
"element_type": "click",
"element_value": "",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"page": "AccountManagement",
"locator_type": "XPATH",
"locator_value": "//div[@id='VotingStatistics']",
"locator_value": "//div[@id='AccountManagement']",
"element_type": "click",
"element_value": "",
"expented_result": ""
}
]
}
行 4 JSON解析成功: {'name': '会议统计-000', 'para': [{'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//div[@class='quit']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': '', 'element_type': 'login', 'element_value': ['admin', 'Ubains@4321'], 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "(//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//div[@id='VotingStatistics']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}]}
行 4 JSON解析成功: {'name': '账号管理-000', 'para': [{'page': 'AccountManagement', 'locator_type': 'XPATH', 'locator_value': "//div[@class='quit']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'AccountManagement', 'locator_type': 'XPATH', 'locator_value': '', 'element_type': 'login', 'element_value': ['admin', 'Ubains@4321'], 'expented_result': ''}, {'page': 'AccountManagement', 'locator_type': 'XPATH', 'locator_value': "(//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[2]", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'AccountManagement', 'locator_type': 'XPATH', 'locator_value': "//div[@id='AccountManagement']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}]}
行 5 原始JSON数据: {
"name": "会议统计-001",
"para": [{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//input[@placeholder='请输入投票标题名称']",
"element_type": "input",
"element_value": "toupiao",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//button[@class='el-button el-button--primary el-button--small']",
"element_type": "click",
"element_value": "",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"locator_type": "CSS_SELECTOR",
"locator_value": "body > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(3) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > div:nth-child(1)",
"element_type": "getText",
"element_value": "",
"expented_result": "toupiao"
}
]
}
行 5 JSON解析成功: {'name': '会议统计-001', 'para': [{'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//input[@placeholder='请输入投票标题名称']", 'element_type': 'input', 'element_value': 'toupiao', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//button[@class='el-button el-button--primary el-button--small']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'CSS_SELECTOR', 'locator_value': 'body > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(3) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > div:nth-child(1)', 'element_type': 'getText', 'element_value': '', 'expented_result': 'toupiao'}]}
行 6 原始JSON数据: {
"name": "会议统计-002",
"name": "账号管理-001",
"para": [{
"page": "ConferenceStatistics",
"page": "AccountManagement",
"locator_type": "XPATH",
"locator_value": "//input[@placeholder='请输入投票标题名称']",
"locator_value": "//input[@id='input-username']",
"element_type": "input",
"element_value": "toupiao",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//button[@class='el-button el-button--primary el-button--small']",
"element_type": "click",
"element_value": "",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"locator_type": "CSS_SELECTOR",
"locator_value": "body > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(3) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > div:nth-child(1)",
"element_type": "getText",
"element_value": "",
"expented_result": "toupiao"
}
]
}
行 6 JSON解析成功: {'name': '会议统计-002', 'para': [{'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//input[@placeholder='请输入投票标题名称']", 'element_type': 'input', 'element_value': 'toupiao', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//button[@class='el-button el-button--primary el-button--small']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'CSS_SELECTOR', 'locator_value': 'body > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(3) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > div:nth-child(1)', 'element_type': 'getText', 'element_value': '', 'expented_result': 'toupiao'}]}
行 7 原始JSON数据: {
"name": "会议统计-003",
"para": [{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//input[contains(@placeholder,'请输入会议名称')]",
"element_type": "input",
"element_value": "无纸化投票",
"element_value": "admin",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"page": "AccountManagement",
"locator_type": "XPATH",
"locator_value": "//button[@class='el-button el-button--primary el-button--small']",
"locator_value": "//button[@id='btn-search-user']",
"element_type": "click",
"element_value": "",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"page": "AccountManagement",
"locator_type": "XPATH",
"locator_value": "//tbody/tr[1]/td[3]/div[1]",
"locator_value": "//div[normalize-space()='admin@pgy']",
"element_type": "getText",
"element_value": "",
"expented_result": "无纸化投票"
"expented_result": "admin"
}
]
}
7 JSON解析成功: {'name': '会议统计-003', 'para': [{'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//input[contains(@placeholder,'请输入会议名称')]", 'element_type': 'input', 'element_value': '无纸化投票', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//button[@class='el-button el-button--primary el-button--small']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': '//tbody/tr[1]/td[3]/div[1]', 'element_type': 'getText', 'element_value': '', 'expented_result': '无纸化投票'}]}
8 原始JSON数据: {
"name": "会议统计-003",
5 JSON解析成功: {'name': '账号管理-001', 'para': [{'page': 'AccountManagement', 'locator_type': 'XPATH', 'locator_value': "//input[@id='input-username']", 'element_type': 'input', 'element_value': 'admin', 'expented_result': ''}, {'page': 'AccountManagement', 'locator_type': 'XPATH', 'locator_value': "//button[@id='btn-search-user']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'AccountManagement', 'locator_type': 'XPATH', 'locator_value': "//div[normalize-space()='admin@pgy']", 'element_type': 'getText', 'element_value': '', 'expented_result': 'admin'}]}
6 原始JSON数据: {
"name": "账号管理-002",
"para": [{
"page": "ConferenceStatistics",
"page": "AccountManagement",
"locator_type": "XPATH",
"locator_value": "//input[contains(@placeholder,'请输入会议名称')]",
"locator_value": "//input[@id='input-username']",
"element_type": "input",
"element_value": "无纸化投票",
"element_value": "admin@pgy",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"page": "AccountManagement",
"locator_type": "XPATH",
"locator_value": "//button[@class='el-button el-button--primary el-button--small']",
"locator_value": "//button[@id='btn-search-user']",
"element_type": "click",
"element_value": "",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"page": "AccountManagement",
"locator_type": "XPATH",
"locator_value": "//tbody/tr[1]/td[3]/div[1]",
"locator_value": "//div[normalize-space()='admin@pgy']",
"element_type": "getText",
"element_value": "",
"expented_result": "无纸化投票"
"expented_result": "admin@pgy"
}
]
}
行 8 JSON解析成功: {'name': '会议统计-003', 'para': [{'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//input[contains(@placeholder,'请输入会议名称')]", 'element_type': 'input', 'element_value': '无纸化投票', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//button[@class='el-button el-button--primary el-button--small']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': '//tbody/tr[1]/td[3]/div[1]', 'element_type': 'getText', 'element_value': '', 'expented_result': '无纸化投票'}]}
行 6 JSON解析成功: {'name': '账号管理-002', 'para': [{'page': 'AccountManagement', 'locator_type': 'XPATH', 'locator_value': "//input[@id='input-username']", 'element_type': 'input', 'element_value': 'admin@pgy', 'expented_result': ''}, {'page': 'AccountManagement', 'locator_type': 'XPATH', 'locator_value': "//button[@id='btn-search-user']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'AccountManagement', 'locator_type': 'XPATH', 'locator_value': "//div[normalize-space()='admin@pgy']", 'element_type': 'getText', 'element_value': '', 'expented_result': 'admin@pgy'}]}
行 7 的JSON数据为空,跳过
行 8 的JSON数据为空,跳过
行 9 的JSON数据为空,跳过
行 10 的JSON数据为空,跳过
行 11 的JSON数据为空,跳过
......@@ -4555,28 +4499,7 @@ XLSX文件成功打开
行 17 的JSON数据为空,跳过
行 18 的JSON数据为空,跳过
行 19 的JSON数据为空,跳过
行 20 原始JSON数据: {
"name": "会议统计-部门参会统计-000",
"para": [
{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "(//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]",
"element_type": "click",
"element_value": "",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//div[@id='DepartmentStatistics']",
"element_type": "click",
"element_value": "",
"expented_result": ""
}
]
}
行 20 JSON解析成功: {'name': '会议统计-部门参会统计-000', 'para': [{'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "(//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//div[@id='DepartmentStatistics']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}]}
行 20 的JSON数据为空,跳过
行 21 的JSON数据为空,跳过
行 22 的JSON数据为空,跳过
行 23 的JSON数据为空,跳过
......@@ -4588,28 +4511,7 @@ XLSX文件成功打开
行 29 的JSON数据为空,跳过
行 30 的JSON数据为空,跳过
行 31 的JSON数据为空,跳过
行 32 原始JSON数据: {
"name": "会议统计-会议室使用统计-000",
"para": [
{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "(//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]",
"element_type": "click",
"element_value": "",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//div[@id='MeetingRoomStatistics']",
"element_type": "click",
"element_value": "",
"expented_result": ""
}
]
}
行 32 JSON解析成功: {'name': '会议统计-会议室使用统计-000', 'para': [{'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "(//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//div[@id='MeetingRoomStatistics']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}]}
行 32 的JSON数据为空,跳过
行 33 的JSON数据为空,跳过
行 34 的JSON数据为空,跳过
行 35 的JSON数据为空,跳过
......@@ -4775,15 +4677,7 @@ XLSX文件成功打开
行 195 的JSON数据为空,跳过
行 196 的JSON数据为空,跳过
行 197 的JSON数据为空,跳过
行 198 的JSON数据为空,跳过
行 199 的JSON数据为空,跳过
行 200 的JSON数据为空,跳过
行 201 的JSON数据为空,跳过
行 202 的JSON数据为空,跳过
行 203 的JSON数据为空,跳过
行 204 的JSON数据为空,跳过
行 205 的JSON数据为空,跳过
XLSX文件处理完成,共找到 7 条用例
XLSX文件处理完成,共找到 3 条用例
== cases\项目定制\兰州中石化项目25-05-24\代办事宜\__st__.py
......@@ -21797,11 +21691,11 @@ XLSX文件处理完成,共找到 2 条用例
=== [ 执行测试用例 ] ===
预备执行用例数量 : 7
预备执行用例数量 : 3
========= 测试开始 : 20250618_181928 =========
========= 测试开始 : 20250618_182143 =========
......@@ -21824,99 +21718,51 @@ XLSX文件处理完成,共找到 2 条用例
>>> cases\项目定制\兰州中石化项目25-05-24\兰州中石化测试.py
* 会议统计-000 - 2025-06-18 18:19:40
* 账号管理-000 - 2025-06-18 18:21:52
[ case execution steps ]
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //div[@class='quit']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618181950976980.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: 、元素类型: login、元素值: ['admin', 'Ubains@4321']、预期结果:
页面: AccountManagement、元素定位类型: xpath、元素定位值: //div[@class='quit']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182155730016.png
页面: AccountManagement、元素定位类型: xpath、元素定位值: 、元素类型: login、元素值: ['admin', 'Ubains@4321']、预期结果:
开始登录,账号为:admin,密码为:Ubains@4321
输入用户名:admin
输入密码:Ubains@4321
输入验证码:csba
点击登录按钮
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: (//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]、元素类型: click、元素值: 、预期结果:
picture imgs/20250618181958124670.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //div[@id='VotingStatistics']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182000389526.png
页面: AccountManagement、元素定位类型: xpath、元素定位值: (//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[2]、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182203018898.png
页面: AccountManagement、元素定位类型: xpath、元素定位值: //div[@id='AccountManagement']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182205283952.png
PASS
* 会议统计-001 - 2025-06-18 18:20:00
* 账号管理-001 - 2025-06-18 18:22:05
[ case execution steps ]
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //input[@placeholder='请输入投票标题名称']、元素类型: input、元素值: toupiao、预期结果:
picture imgs/20250618182009003814.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //button[@class='el-button el-button--primary el-button--small']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182011255325.png
页面: ConferenceStatistics、元素定位类型: css selector、元素定位值: body > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(3) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > div:nth-child(1)、元素类型: getText、元素值: 、预期结果: toupiao
获取到的文本信息为:toupiao
页面: AccountManagement、元素定位类型: xpath、元素定位值: //input[@id='input-username']、元素类型: input、元素值: admin、预期结果:
picture imgs/20250618182216521407.png
页面: AccountManagement、元素定位类型: xpath、元素定位值: //button[@id='btn-search-user']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182218753908.png
页面: AccountManagement、元素定位类型: xpath、元素定位值: //div[normalize-space()='admin@pgy']、元素类型: getText、元素值: 、预期结果: admin
获取到的文本信息为:admin@pgy
** 检查点 ** 获取到的文本信息为:toupiao ----> 通过
** 检查点 ** 获取到的文本信息为:admin@pgy ----> 通过
picture imgs/20250618182011422096.png
picture imgs/20250618182218947845.png
PASS
* 会议统计-002 - 2025-06-18 18:20:11
* 账号管理-002 - 2025-06-18 18:22:19
[ case execution steps ]
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //input[@placeholder='请输入投票标题名称']、元素类型: input、元素值: toupiao、预期结果:
picture imgs/20250618182013994411.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //button[@class='el-button el-button--primary el-button--small']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182016239528.png
页面: ConferenceStatistics、元素定位类型: css selector、元素定位值: body > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(3) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > div:nth-child(1)、元素类型: getText、元素值: 、预期结果: toupiao
获取到的文本信息为:toupiao
页面: AccountManagement、元素定位类型: xpath、元素定位值: //input[@id='input-username']、元素类型: input、元素值: admin@pgy、预期结果:
picture imgs/20250618182227155198.png
页面: AccountManagement、元素定位类型: xpath、元素定位值: //button[@id='btn-search-user']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182229397711.png
页面: AccountManagement、元素定位类型: xpath、元素定位值: //div[normalize-space()='admin@pgy']、元素类型: getText、元素值: 、预期结果: admin@pgy
获取到的文本信息为:admin@pgy
** 检查点 ** 获取到的文本信息为:toupiao ----> 通过
** 检查点 ** 获取到的文本信息为:admin@pgy ----> 通过
picture imgs/20250618182016387507.png
PASS
* 会议统计-003 - 2025-06-18 18:20:16
[ case execution steps ]
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //input[contains(@placeholder,'请输入会议名称')]、元素类型: input、元素值: 无纸化投票、预期结果:
picture imgs/20250618182018859252.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //button[@class='el-button el-button--primary el-button--small']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182021074038.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //tbody/tr[1]/td[3]/div[1]、元素类型: getText、元素值: 、预期结果: 无纸化投票
获取到的文本信息为:无纸化投票测试
** 检查点 ** 获取到的文本信息为:无纸化投票测试 ----> 通过
picture imgs/20250618182021258678.png
PASS
* 会议统计-003 - 2025-06-18 18:20:21
[ case execution steps ]
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //input[contains(@placeholder,'请输入会议名称')]、元素类型: input、元素值: 无纸化投票、预期结果:
picture imgs/20250618182023919401.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //button[@class='el-button el-button--primary el-button--small']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182026244505.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //tbody/tr[1]/td[3]/div[1]、元素类型: getText、元素值: 、预期结果: 无纸化投票
获取到的文本信息为:无纸化投票测试
** 检查点 ** 获取到的文本信息为:无纸化投票测试 ----> 通过
picture imgs/20250618182026389255.png
PASS
* 会议统计-部门参会统计-000 - 2025-06-18 18:20:26
[ case execution steps ]
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: (//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182028812606.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //div[@id='DepartmentStatistics']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182031046662.png
PASS
* 会议统计-会议室使用统计-000 - 2025-06-18 18:20:31
[ case execution steps ]
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: (//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182033473421.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //div[@id='MeetingRoomStatistics']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182035691666.png
picture imgs/20250618182229542970.png
PASS
[ suite teardown ] cases\项目定制\兰州中石化项目25-05-24\
......@@ -21925,17 +21771,17 @@ picture imgs/20250618182035691666.png
清除浏览器
========= 测试结束 : 20250618_182054 =========
========= 测试结束 : 20250618_182247 =========
耗时 : 85.984
耗时 : 64.089
预备执行用例数量 : 7
预备执行用例数量 : 3
实际执行用例数量 : 7
实际执行用例数量 : 3
通过 : 7
通过 : 3
失败 : 0
......
......@@ -4389,20 +4389,20 @@ CSV文件已读取
尝试打开文件路径: E:\GithubData\自动化\ubains-module-test\预定系统\测试数据\兰州中石化项目测试用例.xlsx
XLSX文件成功打开
正在处理工作表: 决策会议资料
正在处理工作表: 会议统计
表头列名: ['序列号', '功能模块', '功能类别', '用例编号', '功能描述', '用例等级', '功能编号', '用例名称', '预置条件', '操作步骤', 'JSON', '预期结果', '测试结果', '测试频次', '日志截图', '备注']
行 4 原始JSON数据: {
"name": "决策会议资料-000",
"name": "会议统计-000",
"para": [{
"page": "DecisionMeetingData",
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//div[contains(@class,'quit')]",
"locator_value": "//div[@class='quit']",
"element_type": "click",
"element_value": "",
"expented_result": ""
},
{
"page": "DecisionMeetingData",
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "",
"element_type": "login",
......@@ -4410,76 +4410,140 @@ XLSX文件成功打开
"expented_result": ""
},
{
"page": "DecisionMeetingData",
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "(//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]",
"element_type": "click",
"element_value": "",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//div[@id='DecisionMeetingData']",
"locator_value": "//div[@id='VotingStatistics']",
"element_type": "click",
"element_value": "",
"expented_result": ""
}
]
}
行 4 JSON解析成功: {'name': '决策会议资料-000', 'para': [{'page': 'DecisionMeetingData', 'locator_type': 'XPATH', 'locator_value': "//div[contains(@class,'quit')]", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'DecisionMeetingData', 'locator_type': 'XPATH', 'locator_value': '', 'element_type': 'login', 'element_value': ['admin', 'Ubains@4321'], 'expented_result': ''}, {'page': 'DecisionMeetingData', 'locator_type': 'XPATH', 'locator_value': "//div[@id='DecisionMeetingData']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}]}
行 4 JSON解析成功: {'name': '会议统计-000', 'para': [{'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//div[@class='quit']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': '', 'element_type': 'login', 'element_value': ['admin', 'Ubains@4321'], 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "(//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//div[@id='VotingStatistics']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}]}
行 5 原始JSON数据: {
"name": "决策会议资料-001",
"name": "会议统计-001",
"para": [{
"page": "DecisionMeetingData",
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "(//input[@placeholder='请输入会议名称'])[1]",
"locator_value": "//input[@placeholder='请输入投票标题名称']",
"element_type": "input",
"element_value": "议题",
"element_value": "toupiao",
"expented_result": ""
},
{
"page": "DecisionMeetingData",
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//body[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]/button[1]",
"locator_value": "//button[@class='el-button el-button--primary el-button--small']",
"element_type": "click",
"element_value": "",
"expented_result": ""
},
{
"page": "DecisionMeetingData",
"locator_type": "XPATH",
"locator_value": "//body[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[3]/table[1]/tbody[1]/tr[1]/td[2]/div[1]",
"page": "ConferenceStatistics",
"locator_type": "CSS_SELECTOR",
"locator_value": "body > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(3) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > div:nth-child(1)",
"element_type": "getText",
"element_value": "",
"expented_result": "议题"
"expented_result": "toupiao"
}
]
}
行 5 JSON解析成功: {'name': '决策会议资料-001', 'para': [{'page': 'DecisionMeetingData', 'locator_type': 'XPATH', 'locator_value': "(//input[@placeholder='请输入会议名称'])[1]", 'element_type': 'input', 'element_value': '议题', 'expented_result': ''}, {'page': 'DecisionMeetingData', 'locator_type': 'XPATH', 'locator_value': '//body[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]/button[1]', 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'DecisionMeetingData', 'locator_type': 'XPATH', 'locator_value': '//body[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[3]/table[1]/tbody[1]/tr[1]/td[2]/div[1]', 'element_type': 'getText', 'element_value': '', 'expented_result': '议题'}]}
行 5 JSON解析成功: {'name': '会议统计-001', 'para': [{'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//input[@placeholder='请输入投票标题名称']", 'element_type': 'input', 'element_value': 'toupiao', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//button[@class='el-button el-button--primary el-button--small']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'CSS_SELECTOR', 'locator_value': 'body > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(3) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > div:nth-child(1)', 'element_type': 'getText', 'element_value': '', 'expented_result': 'toupiao'}]}
行 6 原始JSON数据: {
"name": "决策会议资料-002",
"name": "会议统计-002",
"para": [{
"page": "DecisionMeetingData",
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "(//input[@placeholder='请输入会议名称'])[1]",
"locator_value": "//input[@placeholder='请输入投票标题名称']",
"element_type": "input",
"element_value": "议题",
"element_value": "toupiao",
"expented_result": ""
},
{
"page": "DecisionMeetingData",
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//body[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]/button[1]",
"locator_value": "//button[@class='el-button el-button--primary el-button--small']",
"element_type": "click",
"element_value": "",
"expented_result": ""
},
{
"page": "DecisionMeetingData",
"page": "ConferenceStatistics",
"locator_type": "CSS_SELECTOR",
"locator_value": "body > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(3) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > div:nth-child(1)",
"element_type": "getText",
"element_value": "",
"expented_result": "toupiao"
}
]
}
行 6 JSON解析成功: {'name': '会议统计-002', 'para': [{'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//input[@placeholder='请输入投票标题名称']", 'element_type': 'input', 'element_value': 'toupiao', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//button[@class='el-button el-button--primary el-button--small']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'CSS_SELECTOR', 'locator_value': 'body > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(3) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > div:nth-child(1)', 'element_type': 'getText', 'element_value': '', 'expented_result': 'toupiao'}]}
行 7 原始JSON数据: {
"name": "会议统计-003",
"para": [{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//body[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[3]/table[1]/tbody[1]/tr[1]/td[2]/div[1]",
"locator_value": "//input[contains(@placeholder,'请输入会议名称')]",
"element_type": "input",
"element_value": "无纸化投票",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//button[@class='el-button el-button--primary el-button--small']",
"element_type": "click",
"element_value": "",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//tbody/tr[1]/td[3]/div[1]",
"element_type": "getText",
"element_value": "",
"expented_result": "议题"
"expented_result": "无纸化投票"
}
]
}
行 6 JSON解析成功: {'name': '决策会议资料-002', 'para': [{'page': 'DecisionMeetingData', 'locator_type': 'XPATH', 'locator_value': "(//input[@placeholder='请输入会议名称'])[1]", 'element_type': 'input', 'element_value': '议题', 'expented_result': ''}, {'page': 'DecisionMeetingData', 'locator_type': 'XPATH', 'locator_value': '//body[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]/button[1]', 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'DecisionMeetingData', 'locator_type': 'XPATH', 'locator_value': '//body[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[3]/table[1]/tbody[1]/tr[1]/td[2]/div[1]', 'element_type': 'getText', 'element_value': '', 'expented_result': '议题'}]}
行 7 的JSON数据为空,跳过
行 8 的JSON数据为空,跳过
行 7 JSON解析成功: {'name': '会议统计-003', 'para': [{'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//input[contains(@placeholder,'请输入会议名称')]", 'element_type': 'input', 'element_value': '无纸化投票', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//button[@class='el-button el-button--primary el-button--small']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': '//tbody/tr[1]/td[3]/div[1]', 'element_type': 'getText', 'element_value': '', 'expented_result': '无纸化投票'}]}
行 8 原始JSON数据: {
"name": "会议统计-003",
"para": [{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//input[contains(@placeholder,'请输入会议名称')]",
"element_type": "input",
"element_value": "无纸化投票",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//button[@class='el-button el-button--primary el-button--small']",
"element_type": "click",
"element_value": "",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//tbody/tr[1]/td[3]/div[1]",
"element_type": "getText",
"element_value": "",
"expented_result": "无纸化投票"
}
]
}
行 8 JSON解析成功: {'name': '会议统计-003', 'para': [{'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//input[contains(@placeholder,'请输入会议名称')]", 'element_type': 'input', 'element_value': '无纸化投票', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//button[@class='el-button el-button--primary el-button--small']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': '//tbody/tr[1]/td[3]/div[1]', 'element_type': 'getText', 'element_value': '', 'expented_result': '无纸化投票'}]}
行 9 的JSON数据为空,跳过
行 10 的JSON数据为空,跳过
行 11 的JSON数据为空,跳过
......@@ -4491,7 +4555,28 @@ XLSX文件成功打开
行 17 的JSON数据为空,跳过
行 18 的JSON数据为空,跳过
行 19 的JSON数据为空,跳过
行 20 的JSON数据为空,跳过
行 20 原始JSON数据: {
"name": "会议统计-部门参会统计-000",
"para": [
{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "(//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]",
"element_type": "click",
"element_value": "",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//div[@id='DepartmentStatistics']",
"element_type": "click",
"element_value": "",
"expented_result": ""
}
]
}
行 20 JSON解析成功: {'name': '会议统计-部门参会统计-000', 'para': [{'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "(//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//div[@id='DepartmentStatistics']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}]}
行 21 的JSON数据为空,跳过
行 22 的JSON数据为空,跳过
行 23 的JSON数据为空,跳过
......@@ -4503,7 +4588,28 @@ XLSX文件成功打开
行 29 的JSON数据为空,跳过
行 30 的JSON数据为空,跳过
行 31 的JSON数据为空,跳过
行 32 的JSON数据为空,跳过
行 32 原始JSON数据: {
"name": "会议统计-会议室使用统计-000",
"para": [
{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "(//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]",
"element_type": "click",
"element_value": "",
"expented_result": ""
},
{
"page": "ConferenceStatistics",
"locator_type": "XPATH",
"locator_value": "//div[@id='MeetingRoomStatistics']",
"element_type": "click",
"element_value": "",
"expented_result": ""
}
]
}
行 32 JSON解析成功: {'name': '会议统计-会议室使用统计-000', 'para': [{'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "(//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]", 'element_type': 'click', 'element_value': '', 'expented_result': ''}, {'page': 'ConferenceStatistics', 'locator_type': 'XPATH', 'locator_value': "//div[@id='MeetingRoomStatistics']", 'element_type': 'click', 'element_value': '', 'expented_result': ''}]}
行 33 的JSON数据为空,跳过
行 34 的JSON数据为空,跳过
行 35 的JSON数据为空,跳过
......@@ -4675,7 +4781,9 @@ XLSX文件成功打开
行 201 的JSON数据为空,跳过
行 202 的JSON数据为空,跳过
行 203 的JSON数据为空,跳过
XLSX文件处理完成,共找到 3 条用例
行 204 的JSON数据为空,跳过
行 205 的JSON数据为空,跳过
XLSX文件处理完成,共找到 7 条用例
== cases\项目定制\兰州中石化项目25-05-24\代办事宜\__st__.py
......@@ -21689,11 +21797,11 @@ XLSX文件处理完成,共找到 2 条用例
=== [ 执行测试用例 ] ===
预备执行用例数量 : 3
预备执行用例数量 : 7
========= 测试开始 : 20250618_181742 =========
========= 测试开始 : 20250618_181928 =========
......@@ -21716,49 +21824,99 @@ XLSX文件处理完成,共找到 2 条用例
>>> cases\项目定制\兰州中石化项目25-05-24\兰州中石化测试.py
* 决策会议资料-000 - 2025-06-18 18:17:56
* 会议统计-000 - 2025-06-18 18:19:40
[ case execution steps ]
页面: DecisionMeetingData、元素定位类型: xpath、元素定位值: //div[contains(@class,'quit')]、元素类型: click、元素值: 、预期结果:
picture imgs/20250618181804619049.png
页面: DecisionMeetingData、元素定位类型: xpath、元素定位值: 、元素类型: login、元素值: ['admin', 'Ubains@4321']、预期结果:
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //div[@class='quit']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618181950976980.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: 、元素类型: login、元素值: ['admin', 'Ubains@4321']、预期结果:
开始登录,账号为:admin,密码为:Ubains@4321
输入用户名:admin
输入密码:Ubains@4321
输入验证码:csba
点击登录按钮
页面: DecisionMeetingData、元素定位类型: xpath、元素定位值: //div[@id='DecisionMeetingData']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618181811856775.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: (//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]、元素类型: click、元素值: 、预期结果:
picture imgs/20250618181958124670.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //div[@id='VotingStatistics']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182000389526.png
PASS
* 会议统计-001 - 2025-06-18 18:20:00
[ case execution steps ]
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //input[@placeholder='请输入投票标题名称']、元素类型: input、元素值: toupiao、预期结果:
picture imgs/20250618182009003814.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //button[@class='el-button el-button--primary el-button--small']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182011255325.png
页面: ConferenceStatistics、元素定位类型: css selector、元素定位值: body > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(3) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > div:nth-child(1)、元素类型: getText、元素值: 、预期结果: toupiao
获取到的文本信息为:toupiao
** 检查点 ** 获取到的文本信息为:toupiao ----> 通过
picture imgs/20250618182011422096.png
PASS
* 会议统计-002 - 2025-06-18 18:20:11
[ case execution steps ]
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //input[@placeholder='请输入投票标题名称']、元素类型: input、元素值: toupiao、预期结果:
picture imgs/20250618182013994411.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //button[@class='el-button el-button--primary el-button--small']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182016239528.png
页面: ConferenceStatistics、元素定位类型: css selector、元素定位值: body > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(3) > table:nth-child(1) > tbody:nth-child(2) > tr:nth-child(1) > td:nth-child(2) > div:nth-child(1)、元素类型: getText、元素值: 、预期结果: toupiao
获取到的文本信息为:toupiao
** 检查点 ** 获取到的文本信息为:toupiao ----> 通过
picture imgs/20250618182016387507.png
PASS
* 决策会议资料-001 - 2025-06-18 18:18:12
* 会议统计-003 - 2025-06-18 18:20:16
[ case execution steps ]
页面: DecisionMeetingData、元素定位类型: xpath、元素定位值: (//input[@placeholder='请输入会议名称'])[1]、元素类型: input、元素值: 议题、预期结果:
picture imgs/20250618181822349085.png
页面: DecisionMeetingData、元素定位类型: xpath、元素定位值: //body[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]/button[1]、元素类型: click、元素值: 、预期结果:
picture imgs/20250618181824602892.png
页面: DecisionMeetingData、元素定位类型: xpath、元素定位值: //body[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[3]/table[1]/tbody[1]/tr[1]/td[2]/div[1]、元素类型: getText、元素值: 、预期结果: 议题
获取到的文本信息为:议题列表007
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //input[contains(@placeholder,'请输入会议名称')]、元素类型: input、元素值: 无纸化投票、预期结果:
picture imgs/20250618182018859252.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //button[@class='el-button el-button--primary el-button--small']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182021074038.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //tbody/tr[1]/td[3]/div[1]、元素类型: getText、元素值: 、预期结果: 无纸化投票
获取到的文本信息为:无纸化投票测试
** 检查点 ** 获取到的文本信息为:议题列表007 ----> 通过
** 检查点 ** 获取到的文本信息为:无纸化投票测试 ----> 通过
picture imgs/20250618181824802060.png
picture imgs/20250618182021258678.png
PASS
* 决策会议资料-002 - 2025-06-18 18:18:24
* 会议统计-003 - 2025-06-18 18:20:21
[ case execution steps ]
页面: DecisionMeetingData、元素定位类型: xpath、元素定位值: (//input[@placeholder='请输入会议名称'])[1]、元素类型: input、元素值: 议题、预期结果:
picture imgs/20250618181833462169.png
页面: DecisionMeetingData、元素定位类型: xpath、元素定位值: //body[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[2]/div[1]/button[1]、元素类型: click、元素值: 、预期结果:
picture imgs/20250618181835686832.png
页面: DecisionMeetingData、元素定位类型: xpath、元素定位值: //body[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[3]/table[1]/tbody[1]/tr[1]/td[2]/div[1]、元素类型: getText、元素值: 、预期结果: 议题
获取到的文本信息为:议题列表007
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //input[contains(@placeholder,'请输入会议名称')]、元素类型: input、元素值: 无纸化投票、预期结果:
picture imgs/20250618182023919401.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //button[@class='el-button el-button--primary el-button--small']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182026244505.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //tbody/tr[1]/td[3]/div[1]、元素类型: getText、元素值: 、预期结果: 无纸化投票
获取到的文本信息为:无纸化投票测试
** 检查点 ** 获取到的文本信息为:议题列表007 ----> 通过
** 检查点 ** 获取到的文本信息为:无纸化投票测试 ----> 通过
picture imgs/20250618181835872900.png
picture imgs/20250618182026389255.png
PASS
* 会议统计-部门参会统计-000 - 2025-06-18 18:20:26
[ case execution steps ]
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: (//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182028812606.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //div[@id='DepartmentStatistics']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182031046662.png
PASS
* 会议统计-会议室使用统计-000 - 2025-06-18 18:20:31
[ case execution steps ]
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: (//i[@class='el-collapse-item__arrow el-icon-arrow-right'])[1]、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182033473421.png
页面: ConferenceStatistics、元素定位类型: xpath、元素定位值: //div[@id='MeetingRoomStatistics']、元素类型: click、元素值: 、预期结果:
picture imgs/20250618182035691666.png
PASS
[ suite teardown ] cases\项目定制\兰州中石化项目25-05-24\
......@@ -21767,17 +21925,17 @@ picture imgs/20250618181835872900.png
清除浏览器
========= 测试结束 : 20250618_181854 =========
========= 测试结束 : 20250618_182054 =========
耗时 : 71.446
耗时 : 85.984
预备执行用例数量 : 3
预备执行用例数量 : 7
实际执行用例数量 : 3
实际执行用例数量 : 7
通过 : 3
通过 : 7
失败 : 0
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论