Commit 2e10ca56 authored by 王超's avatar 王超

更新

parent 350883c9
......@@ -4,7 +4,7 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.9" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.9 (CMS2.0_UI_AUTOMATION_TEST)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
......@@ -3,5 +3,5 @@
<component name="Black">
<option name="sdkName" value="Python 3.10 (CMS2.0_UI_AUTO_TEST)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (CMS2.0_UI_AUTOMATION_TEST)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<changelist name="Uncommitted_changes_before_Update_at_2024_08_15_10_22_[Changes]1" date="1723688678095" recycled="true" deleted="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_2024_08_15_10_22_[Changes]1/shelved.patch" />
<option name="DESCRIPTION" value="Uncommitted changes before Update at 2024/08/15 10:22 [Changes]" />
</changelist>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
[2024-08-27 14:42:45,386] logger_util.py->write_log line:72 [INFO]
-------------测试用例开始-----------
[2024-08-27 14:42:53,262] logger_util.py->write_log line:72 [INFO] 进行图片比对...
[2024-08-27 14:42:53,262] logger_util.py->write_log line:72 [INFO] 实际图片:静态文本_设置右对齐_实际图.png, 预期图片:静态文本_设置右对齐_预期图.png
[2024-08-27 14:42:53,262] logger_util.py->write_log line:72 [INFO] 比对结果:True
[2024-08-27 14:42:53,521] logger_util.py->write_log line:72 [INFO]
-------------测试用例结束-----------
[2024-08-27 14:42:55,561] logger_util.py->write_log line:72 [INFO]
-------------测试用例开始-----------
[2024-08-27 14:43:04,831] logger_util.py->write_log line:72 [INFO] 进行图片比对...
[2024-08-27 14:43:04,831] logger_util.py->write_log line:72 [INFO] 实际图片:静态文本_设置字号颜色加粗斜体下划线_实际图.png, 预期图片:静态文本_设置字号颜色加粗斜体下划线_预期图.png
[2024-08-27 14:43:04,832] logger_util.py->write_log line:72 [INFO] 比对结果:True
[2024-08-27 14:43:05,103] logger_util.py->write_log line:72 [INFO]
-------------测试用例结束-----------
[2024-08-27 14:43:06,835] logger_util.py->write_log line:72 [INFO]
-------------测试用例开始-----------
[2024-08-27 14:43:14,721] logger_util.py->write_log line:72 [INFO] 进行图片比对...
[2024-08-27 14:43:14,722] logger_util.py->write_log line:72 [INFO] 实际图片:静态文本_设置字体类型_实际图.png, 预期图片:静态文本_设置字体类型_预期图.png
[2024-08-27 14:43:14,722] logger_util.py->write_log line:72 [INFO] 比对结果:True
[2024-08-27 14:43:14,995] logger_util.py->write_log line:72 [INFO]
-------------测试用例结束-----------
[2024-08-27 14:43:16,900] logger_util.py->write_log line:72 [INFO]
-------------测试用例开始-----------
[2024-08-27 14:43:24,787] logger_util.py->write_log line:72 [INFO] 进行图片比对...
[2024-08-27 14:43:24,787] logger_util.py->write_log line:72 [INFO] 实际图片:静态文本_设置字距行高_实际图.png, 预期图片:静态文本_设置字距行高_预期图.png
[2024-08-27 14:43:24,787] logger_util.py->write_log line:72 [INFO] 比对结果:True
[2024-08-27 14:43:25,053] logger_util.py->write_log line:72 [INFO]
-------------测试用例结束-----------
......@@ -20,11 +20,11 @@ class StaticTextPage(BasePage):
def create_static_text(self):
# 点击展开组件菜单
pmp = PageManagementPage(self.page)
self._click(pw_locator=pmp.cms_page_component_locator)
# 点击水平菜单组件
self._click(pw_locator=pmp.cms_page_component_static_text)
self._click(pw_locator=pmp.component_box_locator)
# 点击静态文本组件
self._click(pw_locator=pmp.static_text_component_locator)
# 拖拉组件到画布
self._drag_and_drop_to_user_position(pmp.cms_page_component_static_text, Config.target_point_x,
self._drag_and_drop_to_user_position(pmp.static_text_component_locator, Config.target_point_x,
Config.target_point_y)
time.sleep(0.5) # 等待0.5s加载属性栏
......@@ -256,20 +256,42 @@ class StaticTextPage(BasePage):
def set_font_style(self):
"""
拖出静态文本组件,设置左对齐
拖出静态文本组件,设置字号,字体颜色,加粗,斜体,下划线
:return:
"""
pmp = PageManagementPage(self.page)
self.create_static_text() # 拖出静态文本组件
pmp.text_attribute_set_font_size() # 字号
time.sleep(0.5)
pmp.text_attribute_set_font_color() # 字体颜色
time.sleep(0.5)
pmp.text_attribute_set_bold() #加粗
pmp.text_attribute_set_italic() #斜体
pmp.text_attribute_set_underline() #下划线
def set_font_type(self):
"""
拖出静态文本组件,设置字体类型,手写体
:return:
"""
pmp = PageManagementPage(self.page)
self.create_static_text() # 拖出静态文本组件
pmp.location_attribute_set_width(400)
pmp.location_attribute_set_high(200)
pmp.text_attribute_set_font_size()
time.sleep(0.5)
pmp.text_attribute_set_font_color()
pmp.text_attribute_set_font_type()
def set_font_distance(self):
"""
拖出静态文本组件,设置字距,行高
:return:
"""
pmp = PageManagementPage(self.page)
self.create_static_text() # 拖出静态文本组件
pmp.text_attribute_set_font_size()
time.sleep(0.5)
pmp.text_attribute_set_bold()
pmp.text_attribute_set_italic()
pmp.text_attribute_set_underline()
pmp.text_attribute_set_font_distance(40) #字距
pmp.text_attribute_set_font_row_heigh(80) # 行高
......@@ -270,6 +270,42 @@ class Test_StaticText:
bp.allure_reports(filename, actual_img_name, expect_img_name)
assert result, f"页面截图与预期截图不一致"
@allure.story("静态文本-设置字号颜色加粗斜体下划线")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("StaticText","静态文本_设置字号颜色加粗斜体下划线_实际图", "静态文本_设置字号颜色加粗斜体下划线_预期图")])
def test_StaticText_set_font_style(self, page, create_and_destroy_page, filename, actual_img_name, expect_img_name):
bp = BasePage(page)
bp._goto_url("画面")
stp = StaticTextPage(page)
stp.set_font_style()
time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name)
assert result, f"页面截图与预期截图不一致"
@allure.story("静态文本-设置字体类型")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("StaticText","静态文本_设置字体类型_实际图", "静态文本_设置字体类型_预期图")])
def test_StaticText_set_font_type(self, page, create_and_destroy_page, filename, actual_img_name, expect_img_name):
bp = BasePage(page)
bp._goto_url("画面")
stp = StaticTextPage(page)
stp.set_font_type()
time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name)
assert result, f"页面截图与预期截图不一致"
@allure.story("静态文本-设置字距行高")
@pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("StaticText","静态文本_设置字距行高_实际图", "静态文本_设置字距行高_预期图")])
def test_StaticText_set_font_distance(self, page, create_and_destroy_page, filename, actual_img_name, expect_img_name):
bp = BasePage(page)
bp._goto_url("画面")
stp = StaticTextPage(page)
stp.set_font_distance()
time.sleep(1)
result = bp.compare_images(filename, actual_img_name, expect_img_name)
bp.allure_reports(filename, actual_img_name, expect_img_name)
assert result, f"页面截图与预期截图不一致"
......
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
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
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
-------------测试用例结束-----------
\ 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
INFO log:logger_util.py:72
-------------测试用例开始-----------
INFO log:logger_util.py:72 进行图片比对...
INFO log:logger_util.py:72 实际图片:静态文本_修改xywh属性_实际图.png, 预期图片:静态文本_修改xywh属性_预期图.png
INFO log:logger_util.py:72 比对结果:True
INFO log:logger_util.py:72
-------------测试用例结束-----------
\ 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
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
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
-------------测试用例结束-----------
\ 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
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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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