Commit 9a2ccf70 authored by 王超's avatar 王超

更新登录按钮用例

parent ea5a1ae4
...@@ -43,7 +43,7 @@ class ImageComparisonTool: ...@@ -43,7 +43,7 @@ class ImageComparisonTool:
# 在测试用例中调用 # 在测试用例中调用
if __name__ == '__main__': if __name__ == '__main__':
comparator = ImageComparisonTool() comparator = ImageComparisonTool()
result = comparator.compare_images('Rectangle_actual.png', 'Rectangle_expected2.png') result = comparator.compare_images('开关按钮_变量分离-读取变量_实际图.png', '开关按钮_变量分离-读取变量_预期图.png')
if result: if result:
print("测试通过:两张图片相似") print("测试通过:两张图片相似")
else: else:
......
# -*- coding:utf-8 -*- # -*- coding:utf-8 -*-
""" """
describe:配置文件 describe:配置文件
Author:wangchao
Time: 2023/12/5
""" """
import os import os
from Utils.Debug_talk import DubugTalk
class Config: class Config:
# 浏览器类型定义 # 浏览器类型定义
browser = "chromium" browser = "chromium"
...@@ -14,34 +11,7 @@ class Config: ...@@ -14,34 +11,7 @@ class Config:
# CMS token # CMS token
Authorization = "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiU3VwZXJBZG1pbiIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL25hbWVpZGVudGlmaWVyIjoiU3VwZXJBZG1pbiIsImlzcyI6IkNNU3YyIiwiYXVkIjoiQXBpIn0.AJUOE6YQ5MAxDqHOIz-yQbpCKPNq5tPoFBWUY381qns" Authorization = "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiU3VwZXJBZG1pbiIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL25hbWVpZGVudGlmaWVyIjoiU3VwZXJBZG1pbiIsImlzcyI6IkNNU3YyIiwiYXVkIjoiQXBpIn0.AJUOE6YQ5MAxDqHOIz-yQbpCKPNq5tPoFBWUY381qns"
# # """路径相关""" """项目目录定义"""
# # 工程管理url
# project_id = DubugTalk().read_extract_file("project_id")
# # 工程管理url
# project_management_url = url
# # 变量管理url
# variable_management_url = url + f"/#/editing/project/{project_id}/vars"
# # 历史管理url
# history_management_url = url + f"/#/editing/project/{project_id}/history"
# # 基础管理url
# basis_management_url = url + f"/#/editing/project/{project_id}/basis"
# # 数据管理url
# data_management_url = url + f"/#/editing/project/{project_id}/data"
# # 画面管理url
# # page_management_url = "http://127.0.0.1:18000/#/editing/project/12/page"
# page_management_url = url + f"/#/editing/project/{project_id}/page"
# # 报警管理url
# alarm_management_url = url + f"/#/editing/project/{project_id}/alarm"
# # 多语言管理url
# language_management_url = url + f"/#/editing/project/{project_id}/lang"
# # 外设管理url
# device_management_url = url + f"/#/editing/project/{project_id}/externalDevice"
# # 互联管理url
# connection_management_url = url + f"/#/editing/project/{project_id}/connection"
# # 自动化管理url
# automation_management_url = url + f"/#/editing/project/{project_id}/automation"
# """项目目录定义"""
root_dir = os.path.abspath(os.getcwd().split('Config.py')[0]) root_dir = os.path.abspath(os.getcwd().split('Config.py')[0])
# root_dir = os.path.split(os.path.split(__file__)[0])[0] # root_dir = os.path.split(os.path.split(__file__)[0])[0]
test_project_dir = root_dir + os.path.sep + "ProjectData" test_project_dir = root_dir + os.path.sep + "ProjectData"
...@@ -61,32 +31,32 @@ class Config: ...@@ -61,32 +31,32 @@ class Config:
screenshot_img_dir = root_dir + os.path.sep + "ImageRecognition" + os.path.sep + "screenshot_img" screenshot_img_dir = root_dir + os.path.sep + "ImageRecognition" + os.path.sep + "screenshot_img"
template_img_dir = root_dir + os.path.sep + "ImageRecognition" + os.path.sep + "template_img" + os.path.sep template_img_dir = root_dir + os.path.sep + "ImageRecognition" + os.path.sep + "template_img" + os.path.sep
# """账号密码""" """账号密码"""
user = "SuperAdmin" user = "SuperAdmin"
password = "SYC888888" password = "SYC888888"
# """日志相关配置""" """日志相关配置"""
log_name = "console_log_" log_name = "console_log_"
log_level = "info" log_level = "info"
log_format = '[%(asctime)s] %(filename)s->%(funcName)s line:%(lineno)d [%(levelname)s] %(message)s' log_format = '[%(asctime)s] %(filename)s->%(funcName)s line:%(lineno)d [%(levelname)s] %(message)s'
# """开发版 截图范围""" """开发版 截图范围"""
editor_x_coordinate = 340 # 左上角 x 坐标 editor_x_coordinate = 340 # 左上角 x 坐标
editor_y_coordinate = 230 # 左上角 y 坐标 editor_y_coordinate = 230 # 左上角 y 坐标
editor_width = 1100 # 区域宽度 editor_width = 1100 # 区域宽度
editor_height = 600 # 区域高度 editor_height = 600 # 区域高度
# """运行版 截图范围 (注意:由于是网页无法控制全屏,所以截取范围非1920*1080)""" """运行版 截图范围 (注意:由于是网页无法控制全屏,所以截取范围非1920*1080)"""
vision_x_coordinate = 0 # 左上角 x 坐标 vision_x_coordinate = 0 # 左上角 x 坐标
vision_y_coordinate = 124 # 左上角 y 坐标 vision_y_coordinate = 124 # 左上角 y 坐标
vision_width = 1900 # 区域宽度 vision_width = 1900 # 区域宽度
vision_height = 800 # 区域高度 vision_height = 800 # 区域高度
# """组件拖到画布指定区域的坐标""" """组件拖到画布指定区域的坐标"""
target_point_x = 820 # 目标点横坐标 target_point_x = 820 # 目标点横坐标
target_point_y = 450 # 目标点纵坐标 target_point_y = 450 # 目标点纵坐标
# """图片比对的相似性阈值""" """图片比对的相似性阈值"""
similarity_threshold = 10 similarity_threshold = 1
[2024-09-06 10:49:20,111] logger_util.py->write_log line:72 [INFO]
-------------测试用例开始-----------
[2024-09-06 10:49:31,058] logger_util.py->write_log line:72 [INFO] 进行图片比对...
[2024-09-06 10:49:31,058] logger_util.py->write_log line:72 [INFO] 实际图片:开关按钮_切换关状态_实际图.png, 预期图片:开关按钮_切换关状态_预期图.png
[2024-09-06 10:49:31,058] logger_util.py->write_log line:72 [INFO] 比对结果:True
[2024-09-06 10:49:31,284] logger_util.py->write_log line:72 [INFO]
-------------测试用例结束-----------
[2024-09-06 16:57:56,970] logger_util.py->write_log line:72 [INFO]
-------------测试用例开始-----------
[2024-09-06 16:58:20,076] logger_util.py->write_log line:72 [INFO] 进行图片比对...
[2024-09-06 16:58:20,076] logger_util.py->write_log line:72 [INFO] 实际图片:登录按钮_页面跳转_实际图.png, 预期图片:登录按钮_页面跳转_预期图.png
[2024-09-06 16:58:20,076] logger_util.py->write_log line:72 [INFO] 比对结果:True
[2024-09-06 16:58:25,288] logger_util.py->write_log line:72 [INFO]
-------------测试用例结束-----------
This diff is collapsed.
...@@ -73,7 +73,7 @@ class PageContainerPage(BasePage): ...@@ -73,7 +73,7 @@ class PageContainerPage(BasePage):
self.create_page_container() self.create_page_container()
pmp.appearance_attribute_set_gradient_color_background() pmp.appearance_attribute_set_gradient_color_background()
def set_stretch_type_image_background(self): def set_image_background_stretch_type(self):
""" """
拖出画面容器组件,设置图片背景,且为拉伸类型 拖出画面容器组件,设置图片背景,且为拉伸类型
:return: :return:
...@@ -85,7 +85,7 @@ class PageContainerPage(BasePage): ...@@ -85,7 +85,7 @@ class PageContainerPage(BasePage):
time.sleep(0.5) time.sleep(0.5)
pmp.appearance_attribute_set_image_background_stretch_type() # 设置为拉伸类型 pmp.appearance_attribute_set_image_background_stretch_type() # 设置为拉伸类型
def set_adapt_type_image_background(self): def set_image_background_adapt_type(self):
""" """
拖出画面容器组件,设置图片背景,且为自适应类型 拖出画面容器组件,设置图片背景,且为自适应类型
:return: :return:
...@@ -97,7 +97,7 @@ class PageContainerPage(BasePage): ...@@ -97,7 +97,7 @@ class PageContainerPage(BasePage):
time.sleep(0.5) time.sleep(0.5)
pmp.appearance_attribute_set_image_background_adapt_type() # 设置为自适应类型 pmp.appearance_attribute_set_image_background_adapt_type() # 设置为自适应类型
def set_cover_type_image_background(self): def set_image_background_cover_type(self):
""" """
拖出画面容器组件,设置图片背景,且为覆盖类型 拖出画面容器组件,设置图片背景,且为覆盖类型
:return: :return:
...@@ -108,7 +108,7 @@ class PageContainerPage(BasePage): ...@@ -108,7 +108,7 @@ class PageContainerPage(BasePage):
pmp.location_attribute_set_high(200) pmp.location_attribute_set_high(200)
pmp.appearance_attribute_set_image_background_cover_type() # 设置为覆盖类型 pmp.appearance_attribute_set_image_background_cover_type() # 设置为覆盖类型
def set_actual_type_image_background(self): def set_image_background_actual_type(self):
""" """
拖出画面容器组件,设置图片背景,且为实际大小类型 拖出画面容器组件,设置图片背景,且为实际大小类型
:return: :return:
......
...@@ -270,8 +270,8 @@ class PageManagementPage(BasePage): ...@@ -270,8 +270,8 @@ class PageManagementPage(BasePage):
self.solid_color_background_locator = page.get_by_label("外观").locator("div").filter(has_text=re.compile(r"^背景$")).locator("span").nth(1) self.solid_color_background_locator = page.get_by_label("外观").locator("div").filter(has_text=re.compile(r"^背景$")).locator("span").nth(1)
# 红色快捷按钮 # 红色快捷按钮
self.red_shortcut_button_locator = page.locator("div:nth-child(18) > div > .el-color-predefine > .el-color-predefine__colors > div:nth-child(4) > div") self.red_shortcut_button_locator = page.locator("div:nth-child(18) > div > .el-color-predefine > .el-color-predefine__colors > div:nth-child(4) > div")
# 渐变/图片按钮 # 背景色按钮
self.gradient_and_picture_button_locator = page.get_by_label("外观").locator("use") self.background_image_button_locator = page.get_by_label("外观").locator("use")
# 渐变色按钮 # 渐变色按钮
self.gradient_button_locator = page.get_by_label("外观").get_by_title("线性渐变") self.gradient_button_locator = page.get_by_label("外观").get_by_title("线性渐变")
# 添加图片按钮 # 添加图片按钮
...@@ -335,7 +335,7 @@ class PageManagementPage(BasePage): ...@@ -335,7 +335,7 @@ class PageManagementPage(BasePage):
# 36号字体 # 36号字体
self.font_size_36_locator = page.get_by_text("36", exact=True) self.font_size_36_locator = page.get_by_text("36", exact=True)
# 字体颜色按钮 # 字体颜色按钮
self.font_color_button_locator = page.locator("div:nth-child(2) > .el-color-picker > .el-color-picker__trigger > .el-color-picker__color > .el-color-picker__color-inner").first self.font_color_locator = page.locator("div:nth-child(2) > .el-color-picker > .el-color-picker__trigger > .el-color-picker__color > .el-color-picker__color-inner").first
# 字体颜色,红色 # 字体颜色,红色
self.red_color_font_locator = page.locator("div:nth-child(46) > div > .el-color-predefine > .el-color-predefine__colors > div:nth-child(4) > div") self.red_color_font_locator = page.locator("div:nth-child(46) > div > .el-color-predefine > .el-color-predefine__colors > div:nth-child(4) > div")
# 对齐方式下拉框按钮 # 对齐方式下拉框按钮
...@@ -430,7 +430,7 @@ class PageManagementPage(BasePage): ...@@ -430,7 +430,7 @@ class PageManagementPage(BasePage):
""" """
外观属性:设置渐变色背景 外观属性:设置渐变色背景
""" """
self._click(pw_locator=self.gradient_and_picture_button_locator) self._click(pw_locator=self.background_image_button_locator)
self._click(pw_locator=self.gradient_button_locator) # 点击渐变色按钮 self._click(pw_locator=self.gradient_button_locator) # 点击渐变色按钮
self._click(pw_locator=self.gradient_button_locator) # 再次点击,使其关闭弹窗 self._click(pw_locator=self.gradient_button_locator) # 再次点击,使其关闭弹窗
...@@ -438,7 +438,7 @@ class PageManagementPage(BasePage): ...@@ -438,7 +438,7 @@ class PageManagementPage(BasePage):
""" """
外观属性:设置图片背景,且为拉伸类型 外观属性:设置图片背景,且为拉伸类型
""" """
self._click(pw_locator=self.gradient_and_picture_button_locator) # 图片背景 self._click(pw_locator=self.background_image_button_locator) # 图片背景
self._click(pw_locator=self.add_image_locator) self._click(pw_locator=self.add_image_locator)
self._click(pw_locator=self.image_locator) self._click(pw_locator=self.image_locator)
self._click(pw_locator=self.image_select_button_locator) self._click(pw_locator=self.image_select_button_locator)
...@@ -448,7 +448,7 @@ class PageManagementPage(BasePage): ...@@ -448,7 +448,7 @@ class PageManagementPage(BasePage):
""" """
外观属性:设置图片背景,且为实际大小类型 外观属性:设置图片背景,且为实际大小类型
""" """
self._click(pw_locator=self.gradient_and_picture_button_locator) # 图片背景 self._click(pw_locator=self.background_image_button_locator) # 图片背景
self._click(pw_locator=self.add_image_locator) self._click(pw_locator=self.add_image_locator)
self._click(pw_locator=self.image_locator) self._click(pw_locator=self.image_locator)
self._click(pw_locator=self.image_select_button_locator) self._click(pw_locator=self.image_select_button_locator)
...@@ -458,7 +458,7 @@ class PageManagementPage(BasePage): ...@@ -458,7 +458,7 @@ class PageManagementPage(BasePage):
""" """
外观属性:设置图片背景,且为覆盖类型 外观属性:设置图片背景,且为覆盖类型
""" """
self._click(pw_locator=self.gradient_and_picture_button_locator) # 图片背景 self._click(pw_locator=self.background_image_button_locator) # 图片背景
self._click(pw_locator=self.add_image_locator) # 定位添加图片按钮 self._click(pw_locator=self.add_image_locator) # 定位添加图片按钮
self._click(pw_locator=self.image_locator) self._click(pw_locator=self.image_locator)
self._click(pw_locator=self.image_select_button_locator) self._click(pw_locator=self.image_select_button_locator)
...@@ -468,7 +468,7 @@ class PageManagementPage(BasePage): ...@@ -468,7 +468,7 @@ class PageManagementPage(BasePage):
""" """
外观属性:设置图片背景,且为自适应类型 外观属性:设置图片背景,且为自适应类型
""" """
self._click(pw_locator=self.gradient_and_picture_button_locator) self._click(pw_locator=self.background_image_button_locator)
self._click(pw_locator=self.add_image_locator) self._click(pw_locator=self.add_image_locator)
self._click(pw_locator=self.image_locator) self._click(pw_locator=self.image_locator)
self._click(pw_locator=self.image_select_button_locator) self._click(pw_locator=self.image_select_button_locator)
...@@ -576,7 +576,7 @@ class PageManagementPage(BasePage): ...@@ -576,7 +576,7 @@ class PageManagementPage(BasePage):
文本属性:设置字体颜色 文本属性:设置字体颜色
:return: :return:
""" """
self._click(pw_locator=self.font_color_button_locator) # 点击字体颜色按钮 self._click(pw_locator=self.font_color_locator) # 点击字体颜色按钮
self._click(pw_locator=self.red_color_font_locator) # 设置颜色,红色 self._click(pw_locator=self.red_color_font_locator) # 设置颜色,红色
self._click(pw_locator=self.color_selection_window_ok_button_locator) # 关闭弹窗 self._click(pw_locator=self.color_selection_window_ok_button_locator) # 关闭弹窗
...@@ -847,8 +847,8 @@ class PageManagementPage(BasePage): ...@@ -847,8 +847,8 @@ class PageManagementPage(BasePage):
# 工具栏展开 # 工具栏展开
def toolbar_expand(self): def toolbar_expand(self):
pass pass
"""工具栏用例""" """工具栏用例"""
def test_undo_operation(self): def test_undo_operation(self):
""" """
...@@ -1151,5 +1151,4 @@ class PageManagementPage(BasePage): ...@@ -1151,5 +1151,4 @@ class PageManagementPage(BasePage):
""" """
self.create_rectangle() self.create_rectangle()
self._click(pw_locator=self.display_button_locator) self._click(pw_locator=self.display_button_locator)
\ No newline at end of file
...@@ -88,7 +88,7 @@ class ReadWriteBoxPage(BasePage): ...@@ -88,7 +88,7 @@ class ReadWriteBoxPage(BasePage):
self.create_read_write_box() self.create_read_write_box()
pmp.appearance_attribute_set_gradient_color_background() pmp.appearance_attribute_set_gradient_color_background()
def set_stretch_type_image_background(self): def set_image_background_stretch_type(self):
""" """
拖出读写框组件,设置图片背景,且为拉伸类型 拖出读写框组件,设置图片背景,且为拉伸类型
:return: :return:
...@@ -100,7 +100,7 @@ class ReadWriteBoxPage(BasePage): ...@@ -100,7 +100,7 @@ class ReadWriteBoxPage(BasePage):
time.sleep(0.5) time.sleep(0.5)
pmp.appearance_attribute_set_image_background_stretch_type() # 设置为拉伸类型 pmp.appearance_attribute_set_image_background_stretch_type() # 设置为拉伸类型
def set_adapt_type_image_background(self): def set_image_background_adapt_type(self):
""" """
拖出读写框组件,设置图片背景,且为自适应类型 拖出读写框组件,设置图片背景,且为自适应类型
:return: :return:
...@@ -112,7 +112,7 @@ class ReadWriteBoxPage(BasePage): ...@@ -112,7 +112,7 @@ class ReadWriteBoxPage(BasePage):
time.sleep(0.5) time.sleep(0.5)
pmp.appearance_attribute_set_image_background_adapt_type() # 设置为自适应类型 pmp.appearance_attribute_set_image_background_adapt_type() # 设置为自适应类型
def set_cover_type_image_background(self): def set_image_background_cover_type(self):
""" """
拖出读写框组件,设置图片背景,且为覆盖类型 拖出读写框组件,设置图片背景,且为覆盖类型
:return: :return:
...@@ -123,7 +123,7 @@ class ReadWriteBoxPage(BasePage): ...@@ -123,7 +123,7 @@ class ReadWriteBoxPage(BasePage):
pmp.location_attribute_set_high(200) pmp.location_attribute_set_high(200)
pmp.appearance_attribute_set_image_background_cover_type() # 设置为覆盖类型 pmp.appearance_attribute_set_image_background_cover_type() # 设置为覆盖类型
def set_actual_type_image_background(self): def set_image_background_actual_type(self):
""" """
拖出读写框组件,设置图片背景,且为实际大小类型 拖出读写框组件,设置图片背景,且为实际大小类型
:return: :return:
......
...@@ -75,7 +75,7 @@ class StaticTextPage(BasePage): ...@@ -75,7 +75,7 @@ class StaticTextPage(BasePage):
self.create_static_text() self.create_static_text()
pmp.appearance_attribute_set_gradient_color_background() pmp.appearance_attribute_set_gradient_color_background()
def set_stretch_type_image_background(self): def set_image_background_stretch_type(self):
""" """
拖出静态文本组件,设置图片背景,且为拉伸类型 拖出静态文本组件,设置图片背景,且为拉伸类型
:return: :return:
...@@ -87,7 +87,7 @@ class StaticTextPage(BasePage): ...@@ -87,7 +87,7 @@ class StaticTextPage(BasePage):
time.sleep(0.5) time.sleep(0.5)
pmp.appearance_attribute_set_image_background_stretch_type() # 设置为拉伸类型 pmp.appearance_attribute_set_image_background_stretch_type() # 设置为拉伸类型
def set_adapt_type_image_background(self): def set_image_background_adapt_type(self):
""" """
拖出静态文本组件,设置图片背景,且为自适应类型 拖出静态文本组件,设置图片背景,且为自适应类型
:return: :return:
...@@ -99,7 +99,7 @@ class StaticTextPage(BasePage): ...@@ -99,7 +99,7 @@ class StaticTextPage(BasePage):
time.sleep(0.5) time.sleep(0.5)
pmp.appearance_attribute_set_image_background_adapt_type() # 设置为自适应类型 pmp.appearance_attribute_set_image_background_adapt_type() # 设置为自适应类型
def set_cover_type_image_background(self): def set_image_background_cover_type(self):
""" """
拖出静态文本组件,设置图片背景,且为覆盖类型 拖出静态文本组件,设置图片背景,且为覆盖类型
:return: :return:
...@@ -110,7 +110,7 @@ class StaticTextPage(BasePage): ...@@ -110,7 +110,7 @@ class StaticTextPage(BasePage):
pmp.location_attribute_set_high(200) pmp.location_attribute_set_high(200)
pmp.appearance_attribute_set_image_background_cover_type() # 设置为覆盖类型 pmp.appearance_attribute_set_image_background_cover_type() # 设置为覆盖类型
def set_actual_type_image_background(self): def set_image_background_actual_type(self):
""" """
拖出静态文本组件,设置图片背景,且为实际大小类型 拖出静态文本组件,设置图片背景,且为实际大小类型
:return: :return:
......
...@@ -31,9 +31,10 @@ class SwitchButtonPage(BasePage): ...@@ -31,9 +31,10 @@ class SwitchButtonPage(BasePage):
# 读取变量输入框 # 读取变量输入框
self.write_var_locator = page.locator("div").filter(has_text=re.compile(r"^读取变量$")).get_by_placeholder("请输入变量表达式") self.write_var_locator = page.locator("div").filter(has_text=re.compile(r"^读取变量$")).get_by_placeholder("请输入变量表达式")
# 写入变量输入框 # 写入变量输入框
self.read_var_locator = page.get_by_role("textbox", name="请输入变量表达式") self.read_var_locator = page.locator("div").filter(has_text=re.compile(r"^写入变量$")).get_by_placeholder("请输入变量表达式")
# 运行版-切换开状态 # 运行版-切换开状态
self.switch_open_state_locator = page.get_by_text("ON") self.switch_on_state_locator = page.get_by_text("ON")
self.switch_off_state_locator = page.get_by_text("OFF")
def create_switch_button(self): def create_switch_button(self):
""" """
...@@ -283,18 +284,59 @@ class SwitchButtonPage(BasePage): ...@@ -283,18 +284,59 @@ class SwitchButtonPage(BasePage):
time.sleep(1) time.sleep(1)
self.page.goto(url) # 预览 self.page.goto(url) # 预览
time.sleep(1) time.sleep(1)
self._click(pw_locator=self.switch_open_state_locator) self._click(pw_locator=self.switch_on_state_locator)
def test_var_split_switch_write_state(self): def test_var_split_switch_write_state(self):
DubugTalk().write_var("G2","true") # G2变量下发true
self.create_switch_button() # 拖出开关按钮组件 self.create_switch_button() # 拖出开关按钮组件
self._click(pw_locator=self.split_btn_locator) #分离 self._click(pw_locator=self.split_btn_locator) #分离
time.sleep(0.5)
self._fill("G1",pw_locator=self.write_var_locator) # 读取变量 self._fill("G1",pw_locator=self.write_var_locator) # 读取变量
self._fill("G2", pw_locator=self.read_var_locator) # 写入变量 self._fill("G2", pw_locator=self.read_var_locator) # 写入变量
time.sleep(1)
rwp = ReadWriteBoxPage(self.page) rwp = ReadWriteBoxPage(self.page)
rwp.create_read_write_box(920,450) rwp.create_read_write_box(920,450) # 添加读写框
rwp.related_var("G1") rwp.related_var("G1") # 关联G1变量
rwp.create_read_write_box(920, 550) self.page.reload() # 刷新页面
rwp.related_var("G2") time.sleep(1)
rwp.create_read_write_box(920, 550) # 添加第二个读写框
rwp.related_var("G2") # 关联变量
time.sleep(1)
# 预览
page_name = DubugTalk().read_extract_file("page_name") # 获取画面名称
page_id = DubugTalk().read_extract_file("page_id") # 获取画面id
project_id = DubugTalk().read_extract_file("project_id") # 获取工程id
url = Config.url + rf"/?screenMode=homeScreen&adaptiveMode=default&screens={page_name}#/running/project/{project_id}/page/{page_id}"
time.sleep(1)
self.page.goto(url) # 预览
time.sleep(1)
self._click(pw_locator=self.switch_on_state_locator)
def test_var_split_switch_read_state(self):
DubugTalk().write_var("G2", "true") # G2变量下发true
self.create_switch_button() # 拖出开关按钮组件
self._click(pw_locator=self.split_btn_locator) # 分离
time.sleep(0.5)
self._fill("G1", pw_locator=self.write_var_locator) # 读取变量
self._fill("G2", pw_locator=self.read_var_locator) # 写入变量
time.sleep(1)
rwp = ReadWriteBoxPage(self.page)
rwp.create_read_write_box(920, 450) # 添加读写框
rwp.related_var("G1") # 关联G1变量
self.page.reload() # 刷新页面
time.sleep(1)
rwp.create_read_write_box(920, 550) # 添加第二个读写框
rwp.related_var("G2") # 关联变量
time.sleep(1)
# 预览
page_name = DubugTalk().read_extract_file("page_name") # 获取画面名称
page_id = DubugTalk().read_extract_file("page_id") # 获取画面id
project_id = DubugTalk().read_extract_file("project_id") # 获取工程id
url = Config.url + rf"/?screenMode=homeScreen&adaptiveMode=default&screens={page_name}#/running/project/{project_id}/page/{page_id}"
time.sleep(1)
self.page.goto(url) # 预览
time.sleep(1)
DubugTalk().write_var("G1", "false") # G1变量下发false
......
...@@ -76,7 +76,7 @@ class VideoSurveillancePage(BasePage): ...@@ -76,7 +76,7 @@ class VideoSurveillancePage(BasePage):
self.create_video_surveillance() self.create_video_surveillance()
pmp.appearance_attribute_set_gradient_color_background() pmp.appearance_attribute_set_gradient_color_background()
def set_stretch_type_image_background(self): def set_image_background_stretch_type(self):
""" """
拖出视频监控组件,设置图片背景,且为拉伸类型 拖出视频监控组件,设置图片背景,且为拉伸类型
:return: :return:
...@@ -88,7 +88,7 @@ class VideoSurveillancePage(BasePage): ...@@ -88,7 +88,7 @@ class VideoSurveillancePage(BasePage):
time.sleep(0.5) time.sleep(0.5)
pmp.appearance_attribute_set_image_background_stretch_type() # 设置为拉伸类型 pmp.appearance_attribute_set_image_background_stretch_type() # 设置为拉伸类型
def set_adapt_type_image_background(self): def set_image_background_adapt_type(self):
""" """
拖出视频监控组件,设置图片背景,且为自适应类型 拖出视频监控组件,设置图片背景,且为自适应类型
:return: :return:
...@@ -100,7 +100,7 @@ class VideoSurveillancePage(BasePage): ...@@ -100,7 +100,7 @@ class VideoSurveillancePage(BasePage):
time.sleep(0.5) time.sleep(0.5)
pmp.appearance_attribute_set_image_background_adapt_type() # 设置为自适应类型 pmp.appearance_attribute_set_image_background_adapt_type() # 设置为自适应类型
def set_cover_type_image_background(self): def set_image_background_cover_type(self):
""" """
拖出视频监控组件,设置图片背景,且为覆盖类型 拖出视频监控组件,设置图片背景,且为覆盖类型
:return: :return:
...@@ -111,7 +111,7 @@ class VideoSurveillancePage(BasePage): ...@@ -111,7 +111,7 @@ class VideoSurveillancePage(BasePage):
pmp.location_attribute_set_high(200) pmp.location_attribute_set_high(200)
pmp.appearance_attribute_set_image_background_cover_type() # 设置为覆盖类型 pmp.appearance_attribute_set_image_background_cover_type() # 设置为覆盖类型
def set_actual_type_image_background(self): def set_image_background_actual_type(self):
""" """
拖出视频监控组件,设置图片背景,且为实际大小类型 拖出视频监控组件,设置图片背景,且为实际大小类型
:return: :return:
......
...@@ -86,11 +86,11 @@ class Test_HorizontalMenu: ...@@ -86,11 +86,11 @@ class Test_HorizontalMenu:
@allure.story("水平菜单-外观-设置图片背景,且为拉伸类型") @allure.story("水平菜单-外观-设置图片背景,且为拉伸类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("HorizontaMenu", "水平菜单_设置图片背景_拉伸类型_实际图", "水平菜单_设置图片背景_拉伸类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("HorizontaMenu", "水平菜单_设置图片背景_拉伸类型_实际图", "水平菜单_设置图片背景_拉伸类型_预期图")])
def test_HorizontaMenu_set_stretch_type_image_background(self, page, create_page, filename,actual_img_name, expect_img_name): def test_HorizontaMenu_set_image_background_stretch_type(self, page, create_page, filename,actual_img_name, expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
hmp = HorizontaMenuPage(page) hmp = HorizontaMenuPage(page)
hmp.set_stretch_type_image_background() hmp.set_image_background_stretch_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
...@@ -98,11 +98,11 @@ class Test_HorizontalMenu: ...@@ -98,11 +98,11 @@ class Test_HorizontalMenu:
@allure.story("水平菜单-外观-设置图片背景,且为自适应类型") @allure.story("水平菜单-外观-设置图片背景,且为自适应类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("HorizontaMenu", "水平菜单_设置图片背景_自适应类型_实际图","水平菜单_设置图片背景_自适应类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("HorizontaMenu", "水平菜单_设置图片背景_自适应类型_实际图","水平菜单_设置图片背景_自适应类型_预期图")])
def test_HorizontaMenu_set_adapt_type_image_background(self, page, create_page, filename,actual_img_name,expect_img_name): def test_HorizontaMenu_set_image_background_adapt_type(self, page, create_page, filename,actual_img_name,expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
hmp = HorizontaMenuPage(page) hmp = HorizontaMenuPage(page)
hmp.set_adapt_type_image_background() hmp.set_image_background_adapt_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
...@@ -110,11 +110,11 @@ class Test_HorizontalMenu: ...@@ -110,11 +110,11 @@ class Test_HorizontalMenu:
@allure.story("水平菜单-外观-设置图片背景,且为覆盖类型") @allure.story("水平菜单-外观-设置图片背景,且为覆盖类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("HorizontaMenu", "水平菜单_设置图片背景_覆盖类型_实际图", "水平菜单_设置图片背景_覆盖类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("HorizontaMenu", "水平菜单_设置图片背景_覆盖类型_实际图", "水平菜单_设置图片背景_覆盖类型_预期图")])
def test_HorizontaMenu_set_cover_type_image_background(self, page, create_page, filename,actual_img_name,expect_img_name): def test_HorizontaMenu_set_image_background_cover_type(self, page, create_page, filename,actual_img_name,expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
hmp = HorizontaMenuPage(page) hmp = HorizontaMenuPage(page)
hmp.set_cover_type_image_background() hmp.set_image_background_cover_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
...@@ -122,11 +122,11 @@ class Test_HorizontalMenu: ...@@ -122,11 +122,11 @@ class Test_HorizontalMenu:
@allure.story("水平菜单-外观-设置图片背景,且为实际大小类型") @allure.story("水平菜单-外观-设置图片背景,且为实际大小类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("HorizontaMenu", "水平菜单_设置图片背景_实际大小类型_实际图", "水平菜单_设置图片背景_实际大小类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("HorizontaMenu", "水平菜单_设置图片背景_实际大小类型_实际图", "水平菜单_设置图片背景_实际大小类型_预期图")])
def test_HorizontaMenu_set_actual_type_image_background(self, page, create_page, filename,actual_img_name,expect_img_name): def test_HorizontaMenu_set_image_background_actual_type(self, page, create_page, filename,actual_img_name,expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
hmp = HorizontaMenuPage(page) hmp = HorizontaMenuPage(page)
hmp.set_actual_type_image_background() hmp.set_image_background_actual_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
......
This diff is collapsed.
...@@ -87,11 +87,11 @@ class Test_PageContainer: ...@@ -87,11 +87,11 @@ class Test_PageContainer:
@allure.story("画面容器-外观-设置图片背景,且为拉伸类型") @allure.story("画面容器-外观-设置图片背景,且为拉伸类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("PageContainer", "画面容器_设置图片背景_拉伸类型_实际图", "画面容器_设置图片背景_拉伸类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("PageContainer", "画面容器_设置图片背景_拉伸类型_实际图", "画面容器_设置图片背景_拉伸类型_预期图")])
def test_PageContainer_set_stretch_type_image_background(self, page, create_page, filename,actual_img_name, expect_img_name): def test_PageContainer_set_image_background_stretch_type(self, page, create_page, filename,actual_img_name, expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
pcp =PageContainerPage(page) pcp =PageContainerPage(page)
pcp.set_stretch_type_image_background() pcp.set_image_background_stretch_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
...@@ -99,11 +99,11 @@ class Test_PageContainer: ...@@ -99,11 +99,11 @@ class Test_PageContainer:
@allure.story("画面容器-外观-设置图片背景,且为自适应类型") @allure.story("画面容器-外观-设置图片背景,且为自适应类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("PageContainer", "画面容器_设置图片背景_自适应类型_实际图","画面容器_设置图片背景_自适应类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("PageContainer", "画面容器_设置图片背景_自适应类型_实际图","画面容器_设置图片背景_自适应类型_预期图")])
def test_PageContainer_set_adapt_type_image_background(self, page, create_page, filename,actual_img_name,expect_img_name): def test_PageContainer_set_image_background_adapt_type(self, page, create_page, filename,actual_img_name,expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
pcp =PageContainerPage(page) pcp =PageContainerPage(page)
pcp.set_adapt_type_image_background() pcp.set_image_background_adapt_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
...@@ -111,11 +111,11 @@ class Test_PageContainer: ...@@ -111,11 +111,11 @@ class Test_PageContainer:
@allure.story("画面容器-外观-设置图片背景,且为覆盖类型") @allure.story("画面容器-外观-设置图片背景,且为覆盖类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("PageContainer", "画面容器_设置图片背景_覆盖类型_实际图", "画面容器_设置图片背景_覆盖类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("PageContainer", "画面容器_设置图片背景_覆盖类型_实际图", "画面容器_设置图片背景_覆盖类型_预期图")])
def test_PageContainer_set_cover_type_image_background(self, page, create_page, filename,actual_img_name,expect_img_name): def test_PageContainer_set_image_background_cover_type(self, page, create_page, filename,actual_img_name,expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
pcp =PageContainerPage(page) pcp =PageContainerPage(page)
pcp.set_cover_type_image_background() pcp.set_image_background_cover_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
...@@ -123,11 +123,11 @@ class Test_PageContainer: ...@@ -123,11 +123,11 @@ class Test_PageContainer:
@allure.story("画面容器-外观-设置图片背景,且为实际大小类型") @allure.story("画面容器-外观-设置图片背景,且为实际大小类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("PageContainer", "画面容器_设置图片背景_实际大小类型_实际图", "画面容器_设置图片背景_实际大小类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("PageContainer", "画面容器_设置图片背景_实际大小类型_实际图", "画面容器_设置图片背景_实际大小类型_预期图")])
def test_PageContainer_set_actual_type_image_background(self, page, create_page, filename,actual_img_name,expect_img_name): def test_PageContainer_set_image_background_actual_type(self, page, create_page, filename,actual_img_name,expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
pcp =PageContainerPage(page) pcp =PageContainerPage(page)
pcp.set_actual_type_image_background() pcp.set_image_background_actual_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
......
...@@ -86,11 +86,11 @@ class Test_ReadWriteBox: ...@@ -86,11 +86,11 @@ class Test_ReadWriteBox:
@allure.story("读写框-外观-设置图片背景,且为拉伸类型") @allure.story("读写框-外观-设置图片背景,且为拉伸类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("ReadWriteBox", "读写框_设置图片背景_拉伸类型_实际图", "读写框_设置图片背景_拉伸类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("ReadWriteBox", "读写框_设置图片背景_拉伸类型_实际图", "读写框_设置图片背景_拉伸类型_预期图")])
def test_ReadWriteBox_set_stretch_type_image_background(self, page, create_page, filename,actual_img_name, expect_img_name): def test_ReadWriteBox_set_image_background_stretch_type(self, page, create_page, filename,actual_img_name, expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
rwbp =ReadWriteBoxPage(page) rwbp =ReadWriteBoxPage(page)
rwbp.set_stretch_type_image_background() rwbp.set_image_background_stretch_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
...@@ -98,11 +98,11 @@ class Test_ReadWriteBox: ...@@ -98,11 +98,11 @@ class Test_ReadWriteBox:
@allure.story("读写框-外观-设置图片背景,且为自适应类型") @allure.story("读写框-外观-设置图片背景,且为自适应类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("ReadWriteBox", "读写框_设置图片背景_自适应类型_实际图","读写框_设置图片背景_自适应类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("ReadWriteBox", "读写框_设置图片背景_自适应类型_实际图","读写框_设置图片背景_自适应类型_预期图")])
def test_ReadWriteBox_set_adapt_type_image_background(self, page, create_page, filename,actual_img_name,expect_img_name): def test_ReadWriteBox_set_image_background_adapt_type(self, page, create_page, filename,actual_img_name,expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
rwbp =ReadWriteBoxPage(page) rwbp =ReadWriteBoxPage(page)
rwbp.set_adapt_type_image_background() rwbp.set_image_background_adapt_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
...@@ -110,11 +110,11 @@ class Test_ReadWriteBox: ...@@ -110,11 +110,11 @@ class Test_ReadWriteBox:
@allure.story("读写框-外观-设置图片背景,且为覆盖类型") @allure.story("读写框-外观-设置图片背景,且为覆盖类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("ReadWriteBox", "读写框_设置图片背景_覆盖类型_实际图", "读写框_设置图片背景_覆盖类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("ReadWriteBox", "读写框_设置图片背景_覆盖类型_实际图", "读写框_设置图片背景_覆盖类型_预期图")])
def test_ReadWriteBox_set_cover_type_image_background(self, page, create_page, filename,actual_img_name,expect_img_name): def test_ReadWriteBox_set_image_background_cover_type(self, page, create_page, filename,actual_img_name,expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
rwbp =ReadWriteBoxPage(page) rwbp =ReadWriteBoxPage(page)
rwbp.set_cover_type_image_background() rwbp.set_image_background_cover_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
...@@ -122,11 +122,11 @@ class Test_ReadWriteBox: ...@@ -122,11 +122,11 @@ class Test_ReadWriteBox:
@allure.story("读写框-外观-设置图片背景,且为实际大小类型") @allure.story("读写框-外观-设置图片背景,且为实际大小类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("ReadWriteBox", "读写框_设置图片背景_实际大小类型_实际图", "读写框_设置图片背景_实际大小类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("ReadWriteBox", "读写框_设置图片背景_实际大小类型_实际图", "读写框_设置图片背景_实际大小类型_预期图")])
def test_ReadWriteBox_set_actual_type_image_background(self, page, create_page, filename,actual_img_name,expect_img_name): def test_ReadWriteBox_set_image_background_actual_type(self, page, create_page, filename,actual_img_name,expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
rwbp =ReadWriteBoxPage(page) rwbp =ReadWriteBoxPage(page)
rwbp.set_actual_type_image_background() rwbp.set_image_background_actual_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
......
...@@ -86,11 +86,11 @@ class Test_StaticText: ...@@ -86,11 +86,11 @@ class Test_StaticText:
@allure.story("静态文本-外观-设置图片背景,且为拉伸类型") @allure.story("静态文本-外观-设置图片背景,且为拉伸类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("StaticText", "静态文本_设置图片背景_拉伸类型_实际图", "静态文本_设置图片背景_拉伸类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("StaticText", "静态文本_设置图片背景_拉伸类型_实际图", "静态文本_设置图片背景_拉伸类型_预期图")])
def test_StaticText_set_stretch_type_image_background(self, page, create_page, filename,actual_img_name, expect_img_name): def test_StaticText_set_image_background_stretch_type(self, page, create_page, filename,actual_img_name, expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
stp = StaticTextPage(page) stp = StaticTextPage(page)
stp.set_stretch_type_image_background() stp.set_image_background_stretch_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
...@@ -98,11 +98,11 @@ class Test_StaticText: ...@@ -98,11 +98,11 @@ class Test_StaticText:
@allure.story("静态文本-外观-设置图片背景,且为自适应类型") @allure.story("静态文本-外观-设置图片背景,且为自适应类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("StaticText", "静态文本_设置图片背景_自适应类型_实际图","静态文本_设置图片背景_自适应类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("StaticText", "静态文本_设置图片背景_自适应类型_实际图","静态文本_设置图片背景_自适应类型_预期图")])
def test_StaticText_set_adapt_type_image_background(self, page, create_page, filename, actual_img_name,expect_img_name): def test_StaticText_set_image_background_adapt_type(self, page, create_page, filename, actual_img_name,expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
stp = StaticTextPage(page) stp = StaticTextPage(page)
stp.set_adapt_type_image_background() stp.set_image_background_adapt_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
...@@ -110,11 +110,11 @@ class Test_StaticText: ...@@ -110,11 +110,11 @@ class Test_StaticText:
@allure.story("静态文本-外观-设置图片背景,且为覆盖类型") @allure.story("静态文本-外观-设置图片背景,且为覆盖类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("StaticText", "静态文本_设置图片背景_覆盖类型_实际图", "静态文本_设置图片背景_覆盖类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("StaticText", "静态文本_设置图片背景_覆盖类型_实际图", "静态文本_设置图片背景_覆盖类型_预期图")])
def test_StaticText_set_cover_type_image_background(self, page, create_page, filename, actual_img_name,expect_img_name): def test_StaticText_set_image_background_cover_type(self, page, create_page, filename, actual_img_name,expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
stp = StaticTextPage(page) stp = StaticTextPage(page)
stp.set_cover_type_image_background() stp.set_image_background_cover_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
...@@ -122,11 +122,11 @@ class Test_StaticText: ...@@ -122,11 +122,11 @@ class Test_StaticText:
@allure.story("静态文本-外观-设置图片背景,且为实际大小类型") @allure.story("静态文本-外观-设置图片背景,且为实际大小类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("StaticText", "静态文本_设置图片背景_实际大小类型_实际图", "静态文本_设置图片背景_实际大小类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("StaticText", "静态文本_设置图片背景_实际大小类型_实际图", "静态文本_设置图片背景_实际大小类型_预期图")])
def test_StaticText_set_actual_type_image_background(self, page, create_page, filename, actual_img_name,expect_img_name): def test_StaticText_set_image_background_actual_type(self, page, create_page, filename, actual_img_name,expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
stp = StaticTextPage(page) stp = StaticTextPage(page)
stp.set_actual_type_image_background() stp.set_image_background_actual_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
......
...@@ -86,11 +86,11 @@ class Test_VideoSurveillance: ...@@ -86,11 +86,11 @@ class Test_VideoSurveillance:
@allure.story("视频监控-外观-设置图片背景,且为拉伸类型") @allure.story("视频监控-外观-设置图片背景,且为拉伸类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("VideoSurveillance", "视频监控_设置图片背景_拉伸类型_实际图", "视频监控_设置图片背景_拉伸类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("VideoSurveillance", "视频监控_设置图片背景_拉伸类型_实际图", "视频监控_设置图片背景_拉伸类型_预期图")])
def test_VideoSurveillance_set_stretch_type_image_background(self, page, create_page, filename,actual_img_name, expect_img_name): def test_VideoSurveillance_set_image_background_stretch_type(self, page, create_page, filename,actual_img_name, expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
vsp = VideoSurveillancePage(page) vsp = VideoSurveillancePage(page)
vsp.set_stretch_type_image_background() vsp.set_image_background_stretch_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
...@@ -98,11 +98,11 @@ class Test_VideoSurveillance: ...@@ -98,11 +98,11 @@ class Test_VideoSurveillance:
@allure.story("视频监控-外观-设置图片背景,且为自适应类型") @allure.story("视频监控-外观-设置图片背景,且为自适应类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("VideoSurveillance", "视频监控_设置图片背景_自适应类型_实际图","视频监控_设置图片背景_自适应类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("VideoSurveillance", "视频监控_设置图片背景_自适应类型_实际图","视频监控_设置图片背景_自适应类型_预期图")])
def test_VideoSurveillance_set_adapt_type_image_background(self, page, create_page, filename, actual_img_name,expect_img_name): def test_VideoSurveillance_set_image_background_adapt_type(self, page, create_page, filename, actual_img_name,expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
vsp = VideoSurveillancePage(page) vsp = VideoSurveillancePage(page)
vsp.set_adapt_type_image_background() vsp.set_image_background_adapt_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
...@@ -110,11 +110,11 @@ class Test_VideoSurveillance: ...@@ -110,11 +110,11 @@ class Test_VideoSurveillance:
@allure.story("视频监控-外观-设置图片背景,且为覆盖类型") @allure.story("视频监控-外观-设置图片背景,且为覆盖类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("VideoSurveillance", "视频监控_设置图片背景_覆盖类型_实际图", "视频监控_设置图片背景_覆盖类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("VideoSurveillance", "视频监控_设置图片背景_覆盖类型_实际图", "视频监控_设置图片背景_覆盖类型_预期图")])
def test_VideoSurveillance_set_cover_type_image_background(self, page, create_page, filename, actual_img_name,expect_img_name): def test_VideoSurveillance_set_image_background_cover_type(self, page, create_page, filename, actual_img_name,expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
vsp = VideoSurveillancePage(page) vsp = VideoSurveillancePage(page)
vsp.set_cover_type_image_background() vsp.set_image_background_cover_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
...@@ -122,11 +122,11 @@ class Test_VideoSurveillance: ...@@ -122,11 +122,11 @@ class Test_VideoSurveillance:
@allure.story("视频监控-外观-设置图片背景,且为实际大小类型") @allure.story("视频监控-外观-设置图片背景,且为实际大小类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("VideoSurveillance", "视频监控_设置图片背景_实际大小类型_实际图", "视频监控_设置图片背景_实际大小类型_预期图")]) @pytest.mark.parametrize("filename,actual_img_name,expect_img_name", [("VideoSurveillance", "视频监控_设置图片背景_实际大小类型_实际图", "视频监控_设置图片背景_实际大小类型_预期图")])
def test_VideoSurveillance_set_actual_type_image_background(self, page, create_page, filename, actual_img_name,expect_img_name): def test_VideoSurveillance_set_image_background_actual_type(self, page, create_page, filename, actual_img_name,expect_img_name):
bp = BasePage(page) bp = BasePage(page)
bp._goto_url("画面") bp._goto_url("画面")
vsp = VideoSurveillancePage(page) vsp = VideoSurveillancePage(page)
vsp.set_actual_type_image_background() vsp.set_image_background_actual_type()
time.sleep(1) time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name) result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name) bp.allure_reports(filename, actual_img_name, expect_img_name)
......
...@@ -33,15 +33,83 @@ def compare_images(image_path1, image_path2, threshold=50): ...@@ -33,15 +33,83 @@ def compare_images(image_path1, image_path2, threshold=50):
def run(playwright): def run(playwright):
browser = playwright.chromium.launch(headless=False) # 启动无头模式或带有界面的浏览器 browser = playwright.chromium.launch(headless=False) # 启动无头模式或带有界面的浏览器
page = browser.new_page(viewport={'width': 1850, 'height': 1000 }) page = browser.new_page(viewport={'width': 1850, 'height': 1000 })
page.goto('http://127.0.0.1:18000/#/editing/project/15/page') # 导航到目标网页 page.goto('http://127.0.0.1:18000/#/editing/project/12/page/88') # 导航到目标网页
time.sleep(1) time.sleep(1)
page.locator("//*[@id=\"app\"]/div/div[1]/div[2]/div/main/div[2]/main/div[3]/ul/li[1]/i").click() page.locator("li > .icon-biaozhunkongjian").click()
page.locator("div").filter(has_text=re.compile(r"^登录控件$")).click() page.locator("div").filter(has_text=re.compile(r"^水平菜单$")).click()
page.mouse.down(button='left') page.mouse.down(button='left')
drop_x, drop_y = 910, 560 drop_x, drop_y = 910, 560
page.mouse.move(drop_x, drop_y) page.mouse.move(drop_x, drop_y)
page.mouse.up(button='left') page.mouse.up(button='left')
time.sleep(1)
# # 菜单项,纯色背景
# page.get_by_label("菜单项", exact=True).locator("div").filter(has_text=re.compile(r"^填充$")).locator("span").nth(2).click()
# page.locator("div:nth-child(58) > div > .el-color-predefine > .el-color-predefine__colors > div:nth-child(4) > div").click()
# page.get_by_role("button", name="OK").click()
# time.sleep(2)
# # 菜单项,渐变色背景
# page.get_by_label("菜单项", exact=True).locator("use").click()
# page.get_by_label("菜单项", exact=True).get_by_title("线性渐变").click()
# page.get_by_label("菜单项", exact=True).get_by_title("线性渐变").click() # 关闭弹窗
# time.sleep(2)
# # 菜单项,图片背景
# page.get_by_label("菜单项", exact=True).locator("use").click()
# page.get_by_role("paragraph").get_by_text("添加图片").click()
# page.get_by_role("tabpanel", name=" Default ").get_by_role("img").click()
# page.get_by_role("textbox", name="Select").click()
# # page.get_by_text("实际大小").click()
# # page.get_by_text("拉伸").click()
# # page.get_by_text("自适应").click()
# page.get_by_text("覆盖").click()
# time.sleep(2)
# # 字号
# page.get_by_label("菜单项", exact=True).get_by_placeholder("字号").click()
# page.get_by_role("list").get_by_text("36").click()
# # 字体颜色
# page.locator(".row > .TextSettings > div > .group > .input-color-picker > .el-color-picker > .el-color-picker__trigger > .el-color-picker__color > .el-color-picker__color-inner").first.click()
# page.locator("div:nth-child(70) > div > .el-color-predefine > .el-color-predefine__colors > div:nth-child(4) > div").click()
# page.get_by_role("button", name="OK").click()
# time.sleep(2)
# # 对齐方式
# page.get_by_label("菜单项", exact=True).get_by_placeholder("").click()
# page.get_by_role("tooltip", name="  ").locator("i").nth(3).click() # 右对齐
# # page.get_by_role("tooltip", name="  ").locator("i").nth(2).click()
# # page.get_by_role("tooltip", name="  ").locator("i").nth(1).click()
# time.sleep(2)
# # 加粗斜体下划线
# page.get_by_label("菜单项", exact=True).get_by_title("粗体 Ctrl+B").click()
# page.get_by_label("菜单项", exact=True).get_by_title("斜体 Ctrl+I").click()
# page.get_by_label("菜单项", exact=True).get_by_title("下划线 Ctrl+U").click()
# # page.get_by_label("菜单项", exact=True).get_by_role("checkbox", name="").first.click()
# # page.get_by_label("菜单项", exact=True).get_by_role("checkbox", name="").first.click()
# # page.get_by_label("菜单项", exact=True).get_by_role("checkbox", name="").first.click()
# time.sleep(2)
# page.pause()
# #手写体,字距
# page.get_by_label("菜单项", exact=True).get_by_placeholder("字体").click()
# page.get_by_role("list").get_by_text("手写体").click()
# page.get_by_label("菜单项", exact=True).locator("div").filter(has_text=re.compile(r"^字距$")).get_by_role("spinbutton").click()
# page.get_by_label("菜单项", exact=True).locator("div").filter(has_text=re.compile(r"^字距$")).get_by_role("spinbutton").fill("20")
# page.get_by_label("菜单项", exact=True).locator("div").filter(has_text=re.compile(r"^字距$")).get_by_role("spinbutton").press("Enter")
# time.sleep(2)
page.pause()
page.get_by_label("菜单项", exact=True).locator("div").filter(has_text=re.compile(r"^填充$")).locator("span").nth(2).click()
page.locator("div:nth-child(58) > div > .el-color-predefine > .el-color-predefine__colors > div:nth-child(4) > div").click()
page.get_by_role("button", name="OK").click()
page.locator(".input-group > .el-input-number > .el-input > .el-input__inner").first.fill("150") # 宽
page.locator("div:nth-child(2) > .input-group > .el-input-number > .el-input > .el-input__inner").first.fill("30") # 高
page.locator("div:nth-child(3) > .input-group > .el-input-number > .el-input > .el-input__inner").first.fill("20") #间隙
page.locator("div:nth-child(4) > .input-group > .el-input-number > .el-input > .el-input__inner").first.fill("20") #圆角
page.locator("div:nth-child(4) > .input-group > .el-input-number > .el-input > .el-input__inner").first.press("Enter")
time.sleep(2)
#纯色 #纯色
# page.get_by_label("输入框外观").locator("div").filter(has_text=re.compile(r"^背景$")).locator("span").nth(1).click() # page.get_by_label("输入框外观").locator("div").filter(has_text=re.compile(r"^背景$")).locator("span").nth(1).click()
...@@ -50,7 +118,7 @@ def run(playwright): ...@@ -50,7 +118,7 @@ def run(playwright):
#渐变 #渐变
# page.get_by_label("输入框外观").get_by_title("线性渐变").click() # page.get_by_label("输入框外观").get_by_title("线性渐变").click()
page.pause() # page.pause()
# #图片背景 # #图片背景
# # page.get_by_label("输入框外观").locator("use").click() # # page.get_by_label("输入框外观").locator("use").click()
# # page.get_by_role("paragraph").get_by_text("添加图片").click() # # page.get_by_role("paragraph").get_by_text("添加图片").click()
......
INFO log:logger_util.py:72 INFO log:logger_util.py:72
-------------测试用例开始----------- -------------测试用例开始-----------
INFO log:logger_util.py:72 进行图片比对... INFO log:logger_util.py:72 进行图片比对...
INFO log:logger_util.py:72 实际图片:开关按钮_切换关状态_实际图.png, 预期图片:开关按钮_切换关状态_预期图.png INFO log:logger_util.py:72 实际图片:登录按钮_页面跳转_实际图.png, 预期图片:登录按钮_页面跳转_预期图.png
INFO log:logger_util.py:72 比对结果:True INFO log:logger_util.py:72 比对结果:True
INFO log:logger_util.py:72 INFO log:logger_util.py:72
-------------测试用例结束----------- -------------测试用例结束-----------
\ No newline at end of file
"Epic","Feature","Story","FAILED","BROKEN","PASSED","SKIPPED","UNKNOWN" "Epic","Feature","Story","FAILED","BROKEN","PASSED","SKIPPED","UNKNOWN"
"CMS2.0UI自动化测试","开关组件","开关按钮-切换关状态","0","0","1","0","0" "CMS2.0UI自动化测试","登录按钮组件","登录按钮-验证页面跳转","0","0","1","0","0"
{"uid":"b1a8273437954620fa374b796ffaacdd","name":"behaviors","children":[{"name":"CMS2.0UI自动化测试","children":[{"name":"开关组件","children":[{"name":"开关按钮-切换关状态","children":[{"name":"test_SwitchButton_switch_state[SwitchButton-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u5b9e\\u9645\\u56fe-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u9884\\u671f\\u56fe]","uid":"1f17b18332185656","parentUid":"372029ac136480eeb4e7e4c042bbd1be","status":"passed","time":{"start":1725590960425,"stop":1725590971062,"duration":10637},"flaky":false,"newFailed":false,"newPassed":false,"newBroken":false,"retriesCount":0,"retriesStatusChange":false,"parameters":["'开关按钮_切换关状态_实际图'","'开关按钮_切换关状态_预期图'","'SwitchButton'"]}],"uid":"372029ac136480eeb4e7e4c042bbd1be"}],"uid":"785895474b7c807eca17d901b12429cd"}],"uid":"390d43add3d704eac84707ba62ecc607"}]} {"uid":"b1a8273437954620fa374b796ffaacdd","name":"behaviors","children":[{"name":"CMS2.0UI自动化测试","children":[{"name":"登录按钮组件","children":[{"name":"登录按钮-验证页面跳转","children":[{"name":"test_LoginButton_page_jump[LoginButton-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u5b9e\\u9645\\u56fe-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u9884\\u671f\\u56fe]","uid":"1de21b5956a5a4ce","parentUid":"fe4a9f58beb3edf30e59935f7979e5ac","status":"passed","time":{"start":1725613077291,"stop":1725613105071,"duration":27780},"flaky":false,"newFailed":false,"newPassed":false,"newBroken":false,"retriesCount":0,"retriesStatusChange":false,"parameters":["'登录按钮_页面跳转_实际图'","'登录按钮_页面跳转_预期图'","'LoginButton'"]}],"uid":"fe4a9f58beb3edf30e59935f7979e5ac"}],"uid":"77340a5f4742005889ac7c8d1db6d031"}],"uid":"390d43add3d704eac84707ba62ecc607"}]}
\ No newline at end of file \ No newline at end of file
{"uid":"83edc06c07f9ae9e47eb6dd1b683e4e2","name":"packages","children":[{"name":"TestCases.mode_SwitchButton","children":[{"name":"test_SwitchButton_switch_state[SwitchButton-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u5b9e\\u9645\\u56fe-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u9884\\u671f\\u56fe]","uid":"1f17b18332185656","parentUid":"eb66a73148415e3125a59f8521b4049d","status":"passed","time":{"start":1725590960425,"stop":1725590971062,"duration":10637},"flaky":false,"newFailed":false,"newPassed":false,"newBroken":false,"retriesCount":0,"retriesStatusChange":false,"parameters":["'开关按钮_切换关状态_实际图'","'开关按钮_切换关状态_预期图'","'SwitchButton'"]}],"uid":"TestCases.mode_SwitchButton"}]} {"uid":"83edc06c07f9ae9e47eb6dd1b683e4e2","name":"packages","children":[{"name":"TestCases.mode_LoginButton","children":[{"name":"test_LoginButton_page_jump[LoginButton-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u5b9e\\u9645\\u56fe-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u9884\\u671f\\u56fe]","uid":"1de21b5956a5a4ce","parentUid":"185d4fb1603d9ff8dddbd6e7d25a15f9","status":"passed","time":{"start":1725613077291,"stop":1725613105071,"duration":27780},"flaky":false,"newFailed":false,"newPassed":false,"newBroken":false,"retriesCount":0,"retriesStatusChange":false,"parameters":["'登录按钮_页面跳转_实际图'","'登录按钮_页面跳转_预期图'","'LoginButton'"]}],"uid":"TestCases.mode_LoginButton"}]}
\ No newline at end of file \ No newline at end of file
"Status","Start Time","Stop Time","Duration in ms","Parent Suite","Suite","Sub Suite","Test Class","Test Method","Name","Description" "Status","Start Time","Stop Time","Duration in ms","Parent Suite","Suite","Sub Suite","Test Class","Test Method","Name","Description"
"passed","Fri Sep 06 10:49:20 CST 2024","Fri Sep 06 10:49:31 CST 2024","10637","TestCases","mode_SwitchButton","Test_SwitchButton","","","test_SwitchButton_switch_state[SwitchButton-\u5f00\u5173\u6309\u94ae_\u5207\u6362\u5173\u72b6\u6001_\u5b9e\u9645\u56fe-\u5f00\u5173\u6309\u94ae_\u5207\u6362\u5173\u72b6\u6001_\u9884\u671f\u56fe]","" "passed","Fri Sep 06 16:57:57 CST 2024","Fri Sep 06 16:58:25 CST 2024","27780","TestCases","mode_LoginButton","Test_LoginButton","","","test_LoginButton_page_jump[LoginButton-\u767b\u5f55\u6309\u94ae_\u9875\u9762\u8df3\u8f6c_\u5b9e\u9645\u56fe-\u767b\u5f55\u6309\u94ae_\u9875\u9762\u8df3\u8f6c_\u9884\u671f\u56fe]",""
{"uid":"98d3104e051c652961429bf95fa0b5d6","name":"suites","children":[{"name":"TestCases","children":[{"name":"mode_SwitchButton","children":[{"name":"Test_SwitchButton","children":[{"name":"test_SwitchButton_switch_state[SwitchButton-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u5b9e\\u9645\\u56fe-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u9884\\u671f\\u56fe]","uid":"1f17b18332185656","parentUid":"611347de3bb3121fe2f24b24e0c57e4a","status":"passed","time":{"start":1725590960425,"stop":1725590971062,"duration":10637},"flaky":false,"newFailed":false,"newPassed":false,"newBroken":false,"retriesCount":0,"retriesStatusChange":false,"parameters":["'开关按钮_切换关状态_实际图'","'开关按钮_切换关状态_预期图'","'SwitchButton'"]}],"uid":"611347de3bb3121fe2f24b24e0c57e4a"}],"uid":"d3f81701749648e8633592c3f6793e43"}],"uid":"0408d924bc3d43de55080f45620fd22e"}]} {"uid":"98d3104e051c652961429bf95fa0b5d6","name":"suites","children":[{"name":"TestCases","children":[{"name":"mode_LoginButton","children":[{"name":"Test_LoginButton","children":[{"name":"test_LoginButton_page_jump[LoginButton-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u5b9e\\u9645\\u56fe-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u9884\\u671f\\u56fe]","uid":"1de21b5956a5a4ce","parentUid":"db297b8843133c2f3bfc04c63472d07f","status":"passed","time":{"start":1725613077291,"stop":1725613105071,"duration":27780},"flaky":false,"newFailed":false,"newPassed":false,"newBroken":false,"retriesCount":0,"retriesStatusChange":false,"parameters":["'登录按钮_页面跳转_实际图'","'登录按钮_页面跳转_预期图'","'LoginButton'"]}],"uid":"db297b8843133c2f3bfc04c63472d07f"}],"uid":"cdacb54e586a7b93eaa6068fa5271f67"}],"uid":"0408d924bc3d43de55080f45620fd22e"}]}
\ No newline at end of file \ No newline at end of file
{"uid":"1de21b5956a5a4ce","name":"test_LoginButton_page_jump[LoginButton-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u5b9e\\u9645\\u56fe-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u9884\\u671f\\u56fe]","fullName":"TestCases.mode_LoginButton.Test_LoginButton#test_LoginButton_page_jump","historyId":"b3948719ad968395b7b037bb1e8e4c23","time":{"start":1725613077291,"stop":1725613105071,"duration":27780},"status":"passed","flaky":false,"newFailed":false,"newBroken":false,"newPassed":false,"retriesCount":0,"retriesStatusChange":false,"beforeStages":[{"name":"_verify_url","time":{"start":1725613062564,"stop":1725613062564,"duration":0},"status":"passed","steps":[],"attachments":[],"parameters":[],"stepsCount":0,"hasContent":false,"shouldDisplayMessage":false,"attachmentsCount":0},{"name":"pytestconfig","time":{"start":1725613062564,"stop":1725613062565,"duration":1},"status":"passed","steps":[],"attachments":[],"parameters":[],"stepsCount":0,"hasContent":false,"shouldDisplayMessage":false,"attachmentsCount":0},{"name":"base_url","time":{"start":1725613062564,"stop":1725613062564,"duration":0},"status":"passed","steps":[],"attachments":[],"parameters":[],"stepsCount":0,"hasContent":false,"shouldDisplayMessage":false,"attachmentsCount":0},{"name":"delete_output_dir","time":{"start":1725613062565,"stop":1725613062565,"duration":0},"status":"passed","steps":[],"attachments":[],"parameters":[],"stepsCount":0,"hasContent":false,"shouldDisplayMessage":false,"attachmentsCount":0},{"name":"创建工程","time":{"start":1725613062565,"stop":1725613075680,"duration":13115},"status":"passed","steps":[],"attachments":[],"parameters":[],"stepsCount":0,"hasContent":false,"shouldDisplayMessage":false,"attachmentsCount":0},{"name":"upload_image","time":{"start":1725613075680,"stop":1725613075686,"duration":6},"status":"passed","steps":[],"attachments":[],"parameters":[],"stepsCount":0,"hasContent":false,"shouldDisplayMessage":false,"attachmentsCount":0},{"name":"import_var","time":{"start":1725613075686,"stop":1725613076056,"duration":370},"status":"passed","steps":[],"attachments":[],"parameters":[],"stepsCount":0,"hasContent":false,"shouldDisplayMessage":false,"attachmentsCount":0},{"name":"Generate pageobject and video of the operation","time":{"start":1725613076056,"stop":1725613076971,"duration":915},"status":"passed","steps":[],"attachments":[],"parameters":[],"stepsCount":0,"hasContent":false,"shouldDisplayMessage":false,"attachmentsCount":0},{"name":"create_page","time":{"start":1725613076971,"stop":1725613077290,"duration":319},"status":"passed","steps":[],"attachments":[],"parameters":[],"stepsCount":0,"hasContent":false,"shouldDisplayMessage":false,"attachmentsCount":0}],"testStage":{"status":"passed","steps":[{"name":"实际截图","time":{"start":1725613100077,"stop":1725613100078,"duration":1},"status":"passed","steps":[],"attachments":[{"uid":"79b9fbbe76f90056","name":"登录按钮_页面跳转_实际图","source":"79b9fbbe76f90056.png","type":"image/png","size":8910}],"parameters":[],"stepsCount":0,"hasContent":true,"shouldDisplayMessage":false,"attachmentsCount":1},{"name":"预期截图","time":{"start":1725613100078,"stop":1725613100078,"duration":0},"status":"passed","steps":[],"attachments":[{"uid":"7972a94b74cc1a67","name":"登录按钮_页面跳转_预期图","source":"7972a94b74cc1a67.png","type":"image/png","size":8910}],"parameters":[],"stepsCount":0,"hasContent":true,"shouldDisplayMessage":false,"attachmentsCount":1}],"attachments":[{"uid":"63756fe139ee4c71","name":"log","source":"63756fe139ee4c71.txt","type":"text/plain","size":396}],"parameters":[],"stepsCount":2,"hasContent":true,"shouldDisplayMessage":false,"attachmentsCount":3},"afterStages":[{"name":"create_page::0","time":{"start":1725613105075,"stop":1725613105288,"duration":213},"status":"passed","steps":[],"attachments":[],"parameters":[],"stepsCount":0,"hasContent":false,"shouldDisplayMessage":false,"attachmentsCount":0},{"name":"Generate pageobject and video of the operation::0","time":{"start":1725613105289,"stop":1725613106253,"duration":964},"status":"passed","steps":[],"attachments":[{"uid":"c5f115654ff42c6a","name":"CMS操作的屏幕录制","source":"c5f115654ff42c6a.webm","type":"video/webm","size":2176776}],"parameters":[],"stepsCount":0,"hasContent":true,"shouldDisplayMessage":false,"attachmentsCount":1}],"labels":[{"name":"story","value":"登录按钮-验证页面跳转"},{"name":"epic","value":"CMS2.0UI自动化测试"},{"name":"feature","value":"登录按钮组件"},{"name":"parentSuite","value":"TestCases"},{"name":"suite","value":"mode_LoginButton"},{"name":"subSuite","value":"Test_LoginButton"},{"name":"host","value":"DESKTOP-V6TD7H4"},{"name":"thread","value":"25536-MainThread"},{"name":"framework","value":"pytest"},{"name":"language","value":"cpython3"},{"name":"package","value":"TestCases.mode_LoginButton"},{"name":"resultFormat","value":"allure2"}],"parameters":[{"name":"actual_img_name","value":"'登录按钮_页面跳转_实际图'"},{"name":"expect_img_name","value":"'登录按钮_页面跳转_预期图'"},{"name":"filename","value":"'LoginButton'"}],"links":[],"hidden":false,"retry":false,"extra":{"severity":"normal","retries":[],"categories":[],"tags":[]},"source":"1de21b5956a5a4ce.json","parameterValues":["'登录按钮_页面跳转_实际图'","'登录按钮_页面跳转_预期图'","'LoginButton'"]}
\ No newline at end of file
{"uid":"1f17b18332185656","name":"test_SwitchButton_switch_state[SwitchButton-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u5b9e\\u9645\\u56fe-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u9884\\u671f\\u56fe]","fullName":"TestCases.mode_SwitchButton.Test_SwitchButton#test_SwitchButton_switch_state","historyId":"ef1eb89f3dd5766923b50723eee37332","time":{"start":1725590960425,"stop":1725590971062,"duration":10637},"status":"passed","flaky":false,"newFailed":false,"newBroken":false,"newPassed":false,"retriesCount":0,"retriesStatusChange":false,"beforeStages":[{"name":"base_url","time":{"start":1725590945204,"stop":1725590945204,"duration":0},"status":"passed","steps":[],"attachments":[],"parameters":[],"attachmentsCount":0,"shouldDisplayMessage":false,"hasContent":false,"stepsCount":0},{"name":"创建工程","time":{"start":1725590945205,"stop":1725590958895,"duration":13690},"status":"passed","steps":[],"attachments":[],"parameters":[],"attachmentsCount":0,"shouldDisplayMessage":false,"hasContent":false,"stepsCount":0},{"name":"delete_output_dir","time":{"start":1725590945205,"stop":1725590945205,"duration":0},"status":"passed","steps":[],"attachments":[],"parameters":[],"attachmentsCount":0,"shouldDisplayMessage":false,"hasContent":false,"stepsCount":0},{"name":"pytestconfig","time":{"start":1725590945205,"stop":1725590945205,"duration":0},"status":"passed","steps":[],"attachments":[],"parameters":[],"attachmentsCount":0,"shouldDisplayMessage":false,"hasContent":false,"stepsCount":0},{"name":"_verify_url","time":{"start":1725590945205,"stop":1725590945205,"duration":0},"status":"passed","steps":[],"attachments":[],"parameters":[],"attachmentsCount":0,"shouldDisplayMessage":false,"hasContent":false,"stepsCount":0},{"name":"import_var","time":{"start":1725590958895,"stop":1725590959295,"duration":400},"status":"passed","steps":[],"attachments":[],"parameters":[],"attachmentsCount":0,"shouldDisplayMessage":false,"hasContent":false,"stepsCount":0},{"name":"Generate pageobject and video of the operation","time":{"start":1725590959295,"stop":1725590960113,"duration":818},"status":"passed","steps":[],"attachments":[],"parameters":[],"attachmentsCount":0,"shouldDisplayMessage":false,"hasContent":false,"stepsCount":0},{"name":"create_page","time":{"start":1725590960113,"stop":1725590960415,"duration":302},"status":"passed","steps":[],"attachments":[],"parameters":[],"attachmentsCount":0,"shouldDisplayMessage":false,"hasContent":false,"stepsCount":0},{"name":"write_var","time":{"start":1725590960416,"stop":1725590960424,"duration":8},"status":"passed","steps":[],"attachments":[],"parameters":[],"attachmentsCount":0,"shouldDisplayMessage":false,"hasContent":false,"stepsCount":0}],"testStage":{"status":"passed","steps":[{"name":"实际截图","time":{"start":1725590971060,"stop":1725590971061,"duration":1},"status":"passed","steps":[],"attachments":[{"uid":"26d358097510c3a3","name":"开关按钮_切换关状态_实际图","source":"26d358097510c3a3.png","type":"image/png","size":5341}],"parameters":[],"attachmentsCount":1,"shouldDisplayMessage":false,"hasContent":true,"stepsCount":0},{"name":"预期截图","time":{"start":1725590971061,"stop":1725590971062,"duration":1},"status":"passed","steps":[],"attachments":[{"uid":"674b791f35756e87","name":"开关按钮_切换关状态_预期图","source":"674b791f35756e87.png","type":"image/png","size":5341}],"parameters":[],"attachmentsCount":1,"shouldDisplayMessage":false,"hasContent":true,"stepsCount":0}],"attachments":[{"uid":"be6d5b7f68f5cd46","name":"log","source":"be6d5b7f68f5cd46.txt","type":"text/plain","size":402}],"parameters":[],"attachmentsCount":3,"shouldDisplayMessage":false,"hasContent":true,"stepsCount":2},"afterStages":[{"name":"create_page::0","time":{"start":1725590971064,"stop":1725590971284,"duration":220},"status":"passed","steps":[],"attachments":[],"parameters":[],"attachmentsCount":0,"shouldDisplayMessage":false,"hasContent":false,"stepsCount":0},{"name":"Generate pageobject and video of the operation::0","time":{"start":1725590971285,"stop":1725590972500,"duration":1215},"status":"passed","steps":[],"attachments":[{"uid":"7cbcd28263f12a83","name":"CMS操作的屏幕录制","source":"7cbcd28263f12a83.webm","type":"video/webm","size":700968}],"parameters":[],"attachmentsCount":1,"shouldDisplayMessage":false,"hasContent":true,"stepsCount":0}],"labels":[{"name":"feature","value":"开关组件"},{"name":"epic","value":"CMS2.0UI自动化测试"},{"name":"story","value":"开关按钮-切换关状态"},{"name":"parentSuite","value":"TestCases"},{"name":"suite","value":"mode_SwitchButton"},{"name":"subSuite","value":"Test_SwitchButton"},{"name":"host","value":"DESKTOP-V6TD7H4"},{"name":"thread","value":"5952-MainThread"},{"name":"framework","value":"pytest"},{"name":"language","value":"cpython3"},{"name":"package","value":"TestCases.mode_SwitchButton"},{"name":"resultFormat","value":"allure2"}],"parameters":[{"name":"actual_img_name","value":"'开关按钮_切换关状态_实际图'"},{"name":"expect_img_name","value":"'开关按钮_切换关状态_预期图'"},{"name":"filename","value":"'SwitchButton'"}],"links":[],"hidden":false,"retry":false,"extra":{"severity":"normal","retries":[],"categories":[],"tags":[]},"source":"1f17b18332185656.json","parameterValues":["'开关按钮_切换关状态_实际图'","'开关按钮_切换关状态_预期图'","'SwitchButton'"]}
\ No newline at end of file
{"uid":"ab17fc5a4eb3bca4b216b548c7f9fcbc","name":"timeline","children":[{"name":"DESKTOP-V6TD7H4","children":[{"name":"5952-MainThread","children":[{"name":"test_SwitchButton_switch_state[SwitchButton-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u5b9e\\u9645\\u56fe-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u9884\\u671f\\u56fe]","uid":"1f17b18332185656","parentUid":"a6fb9878252a49d55c7e545983589fce","status":"passed","time":{"start":1725590960425,"stop":1725590971062,"duration":10637},"flaky":false,"newFailed":false,"newPassed":false,"newBroken":false,"retriesCount":0,"retriesStatusChange":false,"parameters":["'开关按钮_切换关状态_实际图'","'开关按钮_切换关状态_预期图'","'SwitchButton'"]}],"uid":"a6fb9878252a49d55c7e545983589fce"}],"uid":"aeb1e8552f5518f4437a45a499712f24"}]} {"uid":"ab17fc5a4eb3bca4b216b548c7f9fcbc","name":"timeline","children":[{"name":"DESKTOP-V6TD7H4","children":[{"name":"25536-MainThread","children":[{"name":"test_LoginButton_page_jump[LoginButton-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u5b9e\\u9645\\u56fe-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u9884\\u671f\\u56fe]","uid":"1de21b5956a5a4ce","parentUid":"f6689012dd729ce2c036db3cfb8a401f","status":"passed","time":{"start":1725613077291,"stop":1725613105071,"duration":27780},"flaky":false,"newFailed":false,"newPassed":false,"newBroken":false,"retriesCount":0,"retriesStatusChange":false,"parameters":["'登录按钮_页面跳转_实际图'","'登录按钮_页面跳转_预期图'","'LoginButton'"]}],"uid":"f6689012dd729ce2c036db3cfb8a401f"}],"uid":"aeb1e8552f5518f4437a45a499712f24"}]}
\ No newline at end of file \ No newline at end of file
launch_status failed=0 1725590975000000000 launch_status failed=0 1725613108000000000
launch_status broken=0 1725590975000000000 launch_status broken=0 1725613108000000000
launch_status passed=1 1725590975000000000 launch_status passed=1 1725613108000000000
launch_status skipped=0 1725590975000000000 launch_status skipped=0 1725613108000000000
launch_status unknown=0 1725590975000000000 launch_status unknown=0 1725613108000000000
launch_time duration=10637 1725590975000000000 launch_time duration=27780 1725613108000000000
launch_time min_duration=10637 1725590975000000000 launch_time min_duration=27780 1725613108000000000
launch_time max_duration=10637 1725590975000000000 launch_time max_duration=27780 1725613108000000000
launch_time sum_duration=10637 1725590975000000000 launch_time sum_duration=27780 1725613108000000000
launch_retries retries=0 1725590975000000000 launch_retries retries=0 1725613108000000000
launch_retries run=1 1725590975000000000 launch_retries run=1 1725613108000000000
...@@ -3,9 +3,9 @@ launch_status_broken 0 ...@@ -3,9 +3,9 @@ launch_status_broken 0
launch_status_passed 1 launch_status_passed 1
launch_status_skipped 0 launch_status_skipped 0
launch_status_unknown 0 launch_status_unknown 0
launch_time_duration 10637 launch_time_duration 27780
launch_time_min_duration 10637 launch_time_min_duration 27780
launch_time_max_duration 10637 launch_time_max_duration 27780
launch_time_sum_duration 10637 launch_time_sum_duration 27780
launch_retries_retries 0 launch_retries_retries 0
launch_retries_run 1 launch_retries_run 1
[{"data":{"duration":10637}}] [{"data":{"duration":27780}}]
\ No newline at end of file \ No newline at end of file
{"ef1eb89f3dd5766923b50723eee37332":{"statistic":{"failed":0,"broken":0,"skipped":0,"passed":1,"unknown":0,"total":1},"items":[{"uid":"1f17b18332185656","status":"passed","time":{"start":1725590960425,"stop":1725590971062,"duration":10637}}]}} {"b3948719ad968395b7b037bb1e8e4c23":{"statistic":{"failed":0,"broken":0,"skipped":0,"passed":1,"unknown":0,"total":1},"items":[{"uid":"1de21b5956a5a4ce","status":"passed","time":{"start":1725613077291,"stop":1725613105071,"duration":27780}}]}}
\ No newline at end of file \ No newline at end of file
[{"data":{"duration":10637}}] [{"data":{"duration":27780}}]
\ No newline at end of file \ No newline at end of file
[{"uid":"1f17b18332185656","name":"test_SwitchButton_switch_state[SwitchButton-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u5b9e\\u9645\\u56fe-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u9884\\u671f\\u56fe]","time":{"start":1725590960425,"stop":1725590971062,"duration":10637},"status":"passed","severity":"normal"}] [{"uid":"1de21b5956a5a4ce","name":"test_LoginButton_page_jump[LoginButton-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u5b9e\\u9645\\u56fe-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u9884\\u671f\\u56fe]","time":{"start":1725613077291,"stop":1725613105071,"duration":27780},"status":"passed","severity":"normal"}]
\ No newline at end of file \ No newline at end of file
[{"uid":"1f17b18332185656","name":"test_SwitchButton_switch_state[SwitchButton-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u5b9e\\u9645\\u56fe-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u9884\\u671f\\u56fe]","time":{"start":1725590960425,"stop":1725590971062,"duration":10637},"status":"passed","severity":"normal"}] [{"uid":"1de21b5956a5a4ce","name":"test_LoginButton_page_jump[LoginButton-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u5b9e\\u9645\\u56fe-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u9884\\u671f\\u56fe]","time":{"start":1725613077291,"stop":1725613105071,"duration":27780},"status":"passed","severity":"normal"}]
\ No newline at end of file \ No newline at end of file
[{"uid":"1f17b18332185656","name":"test_SwitchButton_switch_state[SwitchButton-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u5b9e\\u9645\\u56fe-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u9884\\u671f\\u56fe]","time":{"start":1725590960425,"stop":1725590971062,"duration":10637},"status":"passed","severity":"normal"}] [{"uid":"1de21b5956a5a4ce","name":"test_LoginButton_page_jump[LoginButton-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u5b9e\\u9645\\u56fe-\\u767b\\u5f55\\u6309\\u94ae_\\u9875\\u9762\\u8df3\\u8f6c_\\u9884\\u671f\\u56fe]","time":{"start":1725613077291,"stop":1725613105071,"duration":27780},"status":"passed","severity":"normal"}]
\ No newline at end of file \ No newline at end of file
{"reportName":"Allure Report","testRuns":[],"statistic":{"failed":0,"broken":0,"skipped":0,"passed":1,"unknown":0,"total":1},"time":{"start":1725590960425,"stop":1725590971062,"duration":10637,"minDuration":10637,"maxDuration":10637,"sumDuration":10637}} {"reportName":"Allure Report","testRuns":[],"statistic":{"failed":0,"broken":0,"skipped":0,"passed":1,"unknown":0,"total":1},"time":{"start":1725613077291,"stop":1725613105071,"duration":27780,"minDuration":27780,"maxDuration":27780,"sumDuration":27780}}
\ No newline at end of file \ No newline at end of file
{"uuid": "6ad21e83-f2dd-4851-8704-e7bcde22bb4f", "children": ["11b84bd1-caea-4fd0-aaaa-f9750e1c01c0"], "befores": [{"name": "import_var", "status": "passed", "start": 1725613075686, "stop": 1725613076056}], "start": 1725613075686, "stop": 1725613106254}
\ No newline at end of file
INFO log:logger_util.py:72
-------------测试用例开始-----------
INFO log:logger_util.py:72 进行图片比对...
INFO log:logger_util.py:72 实际图片:开关按钮_切换关状态_实际图.png, 预期图片:开关按钮_切换关状态_预期图.png
INFO log:logger_util.py:72 比对结果:True
INFO log:logger_util.py:72
-------------测试用例结束-----------
\ No newline at end of file
{"uuid": "ae9631ee-c32d-4ab2-9ed6-8707a0ea6441", "children": ["91e02529-2108-4265-b560-d9b33274a872"], "befores": [{"name": "创建工程", "status": "passed", "start": 1725590945205, "stop": 1725590958895}], "start": 1725590945205, "stop": 1725590972501}
\ No newline at end of file
{"uuid": "4ecc3f30-9fcf-4351-ba8a-ff959e43570b", "children": ["91e02529-2108-4265-b560-d9b33274a872"], "befores": [{"name": "create_page", "status": "passed", "start": 1725590960113, "stop": 1725590960415}], "afters": [{"name": "create_page::0", "status": "passed", "start": 1725590971064, "stop": 1725590971284}], "start": 1725590960113, "stop": 1725590971284}
\ No newline at end of file
{"uuid": "de557bca-7105-4f69-8b31-b63d526ee67e", "children": ["91e02529-2108-4265-b560-d9b33274a872"], "befores": [{"name": "Generate pageobject and video of the operation", "status": "passed", "start": 1725590959295, "stop": 1725590960113}], "afters": [{"name": "Generate pageobject and video of the operation::0", "status": "passed", "attachments": [{"name": "CMS操作的屏幕录制", "source": "1499f41e-bcdb-42c3-afcd-461b045bdf43-attachment.webm", "type": "video/webm"}], "start": 1725590971285, "stop": 1725590972500}], "start": 1725590959295, "stop": 1725590972500}
\ No newline at end of file
{"uuid": "14680797-eed1-4840-998d-a5bf66ec5aba", "children": ["91e02529-2108-4265-b560-d9b33274a872"], "befores": [{"name": "delete_output_dir", "status": "passed", "start": 1725590945205, "stop": 1725590945205}], "start": 1725590945205, "stop": 1725590972502}
\ No newline at end of file
{"uuid": "10d7d6cb-54dc-45d8-b183-c0733ea63d7d", "children": ["91e02529-2108-4265-b560-d9b33274a872"], "befores": [{"name": "pytestconfig", "status": "passed", "start": 1725590945205, "stop": 1725590945205}], "start": 1725590945205, "stop": 1725590972502}
\ No newline at end of file
{"uuid": "79be31b5-3eb8-40a6-a535-c19287591b47", "children": ["91e02529-2108-4265-b560-d9b33274a872"], "befores": [{"name": "import_var", "status": "passed", "start": 1725590958895, "stop": 1725590959295}], "start": 1725590958895, "stop": 1725590972501}
\ No newline at end of file
{"uuid": "3c71f4a6-2266-4052-8273-eeb5a5165814", "befores": [{"name": "filename", "status": "passed", "start": 1725590960425, "stop": 1725590960425}], "start": 1725590960425, "stop": 1725590971063}
\ No newline at end of file
{"name": "test_SwitchButton_switch_state[SwitchButton-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u5b9e\\u9645\\u56fe-\\u5f00\\u5173\\u6309\\u94ae_\\u5207\\u6362\\u5173\\u72b6\\u6001_\\u9884\\u671f\\u56fe]", "status": "passed", "steps": [{"name": "实际截图", "status": "passed", "attachments": [{"name": "开关按钮_切换关状态_实际图", "source": "dd8ffbe7-8a98-4d01-934f-346a59a734bc-attachment.png", "type": "image/png"}], "start": 1725590971060, "stop": 1725590971061}, {"name": "预期截图", "status": "passed", "attachments": [{"name": "开关按钮_切换关状态_预期图", "source": "dd49e9f4-3026-4479-9675-0ee0053126ad-attachment.png", "type": "image/png"}], "start": 1725590971061, "stop": 1725590971062}], "attachments": [{"name": "log", "source": "0d83e8ec-dd22-4018-b0d7-dc379f36fcdf-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "filename", "value": "'SwitchButton'"}, {"name": "actual_img_name", "value": "'开关按钮_切换关状态_实际图'"}, {"name": "expect_img_name", "value": "'开关按钮_切换关状态_预期图'"}], "start": 1725590960425, "stop": 1725590971062, "uuid": "91e02529-2108-4265-b560-d9b33274a872", "historyId": "ef1eb89f3dd5766923b50723eee37332", "testCaseId": "a45796e98d3bc8ac49499244bab05ca3", "fullName": "TestCases.mode_SwitchButton.Test_SwitchButton#test_SwitchButton_switch_state", "labels": [{"name": "feature", "value": "开关组件"}, {"name": "epic", "value": "CMS2.0UI自动化测试"}, {"name": "story", "value": "开关按钮-切换关状态"}, {"name": "parentSuite", "value": "TestCases"}, {"name": "suite", "value": "mode_SwitchButton"}, {"name": "subSuite", "value": "Test_SwitchButton"}, {"name": "host", "value": "DESKTOP-V6TD7H4"}, {"name": "thread", "value": "5952-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "TestCases.mode_SwitchButton"}]}
\ No newline at end of file
{"uuid": "a670cd6f-259a-4f80-b70c-55882556abe9", "children": ["91e02529-2108-4265-b560-d9b33274a872"], "befores": [{"name": "_verify_url", "status": "passed", "start": 1725590945205, "stop": 1725590945205}], "start": 1725590945205, "stop": 1725590972503}
\ No newline at end of file
{"uuid": "b4a69a01-d139-4088-a955-83cda817768c", "children": ["91e02529-2108-4265-b560-d9b33274a872"], "befores": [{"name": "write_var", "status": "passed", "start": 1725590960416, "stop": 1725590960424}], "start": 1725590960416, "stop": 1725590971064}
\ No newline at end of file
{"uuid": "f8a961aa-fe0e-4261-9f4e-2e071fcb7aff", "befores": [{"name": "expect_img_name", "status": "passed", "start": 1725590960425, "stop": 1725590960425}], "start": 1725590960425, "stop": 1725590971062}
\ No newline at end of file
{"uuid": "9d232a59-5846-4898-ac4d-42e4a2aa3a53", "befores": [{"name": "actual_img_name", "status": "passed", "start": 1725590960425, "stop": 1725590960425}], "start": 1725590960425, "stop": 1725590971063}
\ No newline at end of file
{"uuid": "f13fce11-fe22-4764-b522-db3009996a0b", "children": ["91e02529-2108-4265-b560-d9b33274a872"], "befores": [{"name": "base_url", "status": "passed", "start": 1725590945204, "stop": 1725590945204}], "start": 1725590945204, "stop": 1725590972503}
\ No newline at end of file
import requests import requests
import yaml import yaml
import os import os
# from Config import Config from Config import Config
from Utils.logger_util import write_log, error_log
class DubugTalk: class DubugTalk:
# 获取项目路径 # 获取项目路径
def get_object_path(self): def get_object_path(self):
...@@ -45,18 +46,18 @@ class DubugTalk: ...@@ -45,18 +46,18 @@ class DubugTalk:
# 打印错误(可能由于权限问题等) # 打印错误(可能由于权限问题等)
print(f"Failed to delete {file_path}. Reason: {e}") print(f"Failed to delete {file_path}. Reason: {e}")
# def write_var(self,var,value): def write_var(self,var,value):
# url = Config.url + r"/api/v1/variable/setvalues" url = Config.url + r"/api/v1/variable/setvalues"
# x_project = self.read_extract_file("x_project") x_project = self.read_extract_file("x_project")
# Authorization = Config.Authorization Authorization = Config.Authorization
# header = {'X-Project': x_project, 'Authorization': Authorization} header = {'X-Project': x_project, 'Authorization': Authorization}
# data = {f"{var}": f"{value}"} data = {f"{var}": f"{value}"}
# try: try:
# re = requests.post(url=url, headers=header, json=data) re = requests.post(url=url, headers=header, json=data)
# if re.status_code != 200: if re.status_code != 200:
# print("变量下发失败:", re.status_code) print("变量下发失败:", re.status_code)
# except Exception as e: except Exception as e:
# error_log(f"{var}变量下发失败:{e}") error_log(f"{var}变量下发失败:{e}")
# if __name__ == '__main__': # if __name__ == '__main__':
# print(read_config_file('base','base_url')) # print(read_config_file('base','base_url'))
......
...@@ -150,25 +150,25 @@ def project_init(): ...@@ -150,25 +150,25 @@ def project_init():
except Exception as e: except Exception as e:
error_log(f"获取工程信息失败:{e}") error_log(f"获取工程信息失败:{e}")
#
# @pytest.fixture(scope="session", autouse=True) @pytest.fixture(scope="session", autouse=True)
# def upload_image(): def upload_image():
# """ """
# 在图库中上传图片,图片名为“皮卡丘.jpg” 在图库中上传图片,图片名为“皮卡丘.jpg”
# :return: :return:
# """ """
# url = Config.url+r"/api/v1/view/image/gallery?group=我的\Default" url = Config.url+r"/api/v1/view/image/gallery?group=我的\Default"
# x_project = DubugTalk().read_extract_file("x_project") x_project = DubugTalk().read_extract_file("x_project")
# headers= {'X-Project': f"{x_project}"} headers= {'X-Project': f"{x_project}"}
# file_path = Config.test_project_dir + r"\Gallery\皮卡丘.jpg" file_path = Config.test_project_dir + r"\Gallery\皮卡丘.jpg"
# #文件数据 #文件数据
# files = {'formFiles': open(file_path,'rb')} files = {'formFiles': open(file_path,'rb')}
# try: try:
# re = requests.post(url=url, headers=headers, files=files) re = requests.post(url=url, headers=headers, files=files)
# if re.status_code != 200: if re.status_code != 200:
# error_log(f"上传图片失败,状态码为{re.status_code}") error_log(f"上传图片失败,状态码为{re.status_code}")
# except Exception as e: except Exception as e:
# error_log(f"上传图片失败:{e}") error_log(f"上传图片失败:{e}")
@pytest.fixture(scope="function", autouse=False) @pytest.fixture(scope="function", autouse=False)
......
project_id: '44' project_id: '53'
x_project: 3313179556144766b88066e021d4a44f x_project: bc2e1769d7a6486e82d1c93c5b51f29f
page_name: 画面1 page_name: 画面1
page_id: '1' page_id: '1'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment