Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CMS2.0_UI_AUTOMATION_TEST
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王超
CMS2.0_UI_AUTOMATION_TEST
Commits
e9022d47
Commit
e9022d47
authored
Sep 18, 2024
by
王超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
9.18日更新
parent
0f75d1d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
322 additions
and
322 deletions
+322
-322
Test_ColumnChart.py
TestCases/Test_ColumnChart.py
+322
-322
No files found.
TestCases/Test_ColumnChart.py
View file @
e9022d47
...
...
@@ -14,329 +14,329 @@ from Pages.PageManagementPage.PageManagementPage import PageManagementPage
@allure.epic
(
"CMS2.0UI自动化测试"
)
@allure.feature
(
"柱形图组件"
)
class
Test_ColumnChart
:
# @allure.story("柱形图-创建柱形图组件")
# @pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("ColumnChart", "柱形图_创建柱形图_实际图", "柱形图_创建柱形图_预期图")])
# def test_create_ColumnChart(self, page, create_page, filename, actual_img_name, expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccp = ColumnChartPage(page)
# ccp.create_column_chart()
# 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("柱形图-位置-x、y、w、h")
# @pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("ColumnChart", "柱形图_位置_xywh_实际图", "柱形图_位置_xywh_预期图")])
# def test_ColumnChart_set_xywh_axis(self, page, create_page, filename, actual_img_name,expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_xywh()
# 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",[("ColumnChart", "柱形图_位置_旋转_实际图", "柱形图_位置_旋转_预期图")])
# def test_ColumnChart_set_rotation_angle(self, page, create_page, filename, actual_img_name,expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_rotation_angle()
# 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",[("ColumnChart", "柱形图_位置_锁定_实际图", "柱形图_位置_锁定_预期图")])
# def test_ColumnChart_set_lock(self, page, create_page, filename, actual_img_name, expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_lock()
# 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",[("ColumnChart", "柱形图_外观_纯色背景_实际图", "柱形图_外观_纯色背景_预期图")])
# def test_ColumnChart_set_solid_color_background(self, page, create_page, filename, actual_img_name,expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_solid_color_background()
# 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",[("ColumnChart", "柱形图_外观_渐变色背景_实际图", "柱形图_外观_渐变色背景_预期图")])
# def test_ColumnChart_set_gradient_color_background(self, page, create_page, filename, actual_img_name,expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_gradient_color_background()
# 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", [("ColumnChart", "柱形图_外观_图片背景拉伸类型_实际图", "柱形图_外观_图片背景拉伸类型_预期图")])
# def test_ColumnChart_set_image_background_stretch_type(self, page, create_page, filename,actual_img_name, expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_image_background_stretch_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",[("ColumnChart", "柱形图_外观_置图片背景自适应类型_实际图","柱形图_外观_图片背景自适应类型_预期图")])
# def test_ColumnChart_set_image_background_adapt_type(self, page, create_page, filename,actual_img_name,expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_image_background_adapt_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", [("ColumnChart", "柱形图_外观_图片背景覆盖类型_实际图", "柱形图_外观_图片背景覆盖类型_预期图")])
# def test_ColumnChart_set_image_background_cover_type(self, page, create_page, filename,actual_img_name,expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_image_background_cover_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", [("ColumnChart", "柱形图_外观_图片背景实际大小类型_实际图", "柱形图_外观_图片背景实际大小类型_预期图")])
# def test_ColumnChart_set_image_background_actual_type(self, page, create_page, filename,actual_img_name,expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_image_background_actual_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",[("ColumnChart", "柱形图_外观_直线边框_实际图", "柱形图_外观_直线边框_预期图")])
# def test_ColumnChart_set_straight_line_frame(self, page, create_page, filename, actual_img_name,expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_straight_line_frame() # 直线
# 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",[("ColumnChart", "柱形图_外观_虚线边框_实际图", "柱形图_外观_虚线边框_预期图")])
# def test_ColumnChart_set_dashed_line_frame(self, page, create_page, filename, actual_img_name,expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_dashed_line_frame() # 虚线
# 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",[("ColumnChart", "柱形图_外观_圆点边框_实际图", "柱形图_外观_圆点边框_预期图")])
# def test_ColumnChart_set_scircular_dots_frame(self, page, create_page, filename, actual_img_name,expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_scircular_dots_frame() # 圆点
# 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",[("ColumnChart", "柱形图_外观_无边框_实际图", "柱形图_外观_无边框_预期图")])
# def test_ColumnChart_set_no_frame(self, page, create_page, filename, actual_img_name,expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_no_frame() # 无边框
# 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",[("ColumnChart", "柱形图_外观_内外阴影_实际图", "柱形图_外观_内外阴影_预期图")])
# def test_ColumnChart_set_shadow(self, page, create_page, filename, actual_img_name, expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_shadow() # 设置内外阴影
# 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",[("ColumnChart", "柱形图_外观_圆角_实际图", "柱形图_外观_圆角_预期图")])
# def test_ColumnChart_set_rounded_corners(self, page, create_page, filename, actual_img_name,expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_rounded_corners()
# 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",[("ColumnChart", "柱形图_外观_不透明度_实际图", "柱形图_外观_不透明度_预期图")])
# def test_ColumnChart_set_opacity(self, page, create_page, filename, actual_img_name, expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_opacity()
# 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",[("ColumnChart", "柱形图_文本_左对齐_实际图", "柱形图_文本_左对齐_预期图")])
# def test_ColumnChart_set_left_aligned(self, page, create_page, filename, actual_img_name, expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_left_aligned()
# 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",[("ColumnChart", "柱形图_文本_居中对齐_实际图", "柱形图_文本_居中对齐_预期图")])
# def test_ColumnChart_set_center_aligned(self, page, create_page, filename, actual_img_name, expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_center_aligned()
# 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",[("ColumnChart", "柱形图_文本_右对齐_实际图", "柱形图_文本_右对齐_预期图")])
# def test_ColumnChart_set_right_aligned(self, page, create_page, filename, actual_img_name, expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.set_right_aligned()
# 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", [("ColumnChart", "柱形图_文本_字号颜色加粗斜体下划线_实际图", "柱形图_文本_字号颜色加粗斜体下划线_预期图")])
# def test_ColumnChart_set_font_style(self, page, create_page, filename, actual_img_name, expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.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",[("ColumnChart", "柱形图_文本_字体类型_实际图", "柱形图_文本_字体类型_预期图")])
# def test_ColumnChart_set_font_type(self, page, create_page, filename, actual_img_name, expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.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",[("ColumnChart", "柱形图_文本_字距行高_实际图", "柱形图_文本_字距行高_预期图")])
# def test_ColumnChart_set_font_distance(self, page, create_page, filename, actual_img_name, expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.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"页面截图与预期截图不一致"
#
# @allure.story("柱形图-标题-修改标题")
# @pytest.mark.parametrize("filename,actual_img_name,expect_img_name",[("ColumnChart", "柱形图_标题_修改标题_实际图", "柱形图_标题_修改标题_预期图")])
# def test_ColumnChart_change_title(self, page, create_page, filename, actual_img_name, expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.test_change_title()
# 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",[("ColumnChart", "柱形图_标题_隐藏标题_实际图", "柱形图_标题_隐藏标题_预期图")])
# def test_ColumnChart_hide_title(self, page, create_page, filename, actual_img_name, expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.test_hide_title()
# 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",[("ColumnChart", "柱形图_图表设置_柱形宽度圆角_实际图", "柱形图_图表设置_柱形宽度圆角_预期图")])
# def test_ColumnChart_chart_setting_column_shaped_width_fillet(self, page, create_page, filename, actual_img_name, expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.test_chart_setting_column_shaped_width_fillet()
# 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"
,[(
"ColumnChart"
,
"柱形图_创建柱形图_实际图"
,
"柱形图_创建柱形图_预期图"
)])
def
test_create_ColumnChart
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccp
=
ColumnChartPage
(
page
)
ccp
.
create_column_chart
()
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
(
"柱形图-位置-x、y、w、h"
)
@pytest.mark.parametrize
(
"filename,actual_img_name,expect_img_name"
,[(
"ColumnChart"
,
"柱形图_位置_xywh_实际图"
,
"柱形图_位置_xywh_预期图"
)])
def
test_ColumnChart_set_xywh_axis
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_xywh
()
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"
,[(
"ColumnChart"
,
"柱形图_位置_旋转_实际图"
,
"柱形图_位置_旋转_预期图"
)])
def
test_ColumnChart_set_rotation_angle
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_rotation_angle
()
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"
,[(
"ColumnChart"
,
"柱形图_位置_锁定_实际图"
,
"柱形图_位置_锁定_预期图"
)])
def
test_ColumnChart_set_lock
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_lock
()
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"
,[(
"ColumnChart"
,
"柱形图_外观_纯色背景_实际图"
,
"柱形图_外观_纯色背景_预期图"
)])
def
test_ColumnChart_set_solid_color_background
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_solid_color_background
()
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"
,[(
"ColumnChart"
,
"柱形图_外观_渐变色背景_实际图"
,
"柱形图_外观_渐变色背景_预期图"
)])
def
test_ColumnChart_set_gradient_color_background
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_gradient_color_background
()
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"
,
[(
"ColumnChart"
,
"柱形图_外观_图片背景拉伸类型_实际图"
,
"柱形图_外观_图片背景拉伸类型_预期图"
)])
def
test_ColumnChart_set_image_background_stretch_type
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_image_background_stretch_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", [("ColumnChart", "柱形图_图表设置_维度和指标间距_实际图", "柱形图_图表设置_维度和指标间距_预期图")])
# def test_ColumnChart_chart_setting_dimension_index_spacing(self, page, create_page, filename, actual_img_name, expect_img_name):
# bp = BasePage(page)
# bp._goto_url("画面")
# ccpc = ColumnChartPage_Case(page)
# ccpc.test_chart_setting_dimension_index_spacing()
# 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"
,[(
"ColumnChart"
,
"柱形图_外观_置图片背景自适应类型_实际图"
,
"柱形图_外观_图片背景自适应类型_预期图"
)])
def
test_ColumnChart_set_image_background_adapt_type
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_image_background_adapt_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"
,
[(
"ColumnChart"
,
"柱形图_外观_图片背景覆盖类型_实际图"
,
"柱形图_外观_图片背景覆盖类型_预期图"
)])
def
test_ColumnChart_set_image_background_cover_type
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_image_background_cover_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"
,
[(
"ColumnChart"
,
"柱形图_外观_图片背景实际大小类型_实际图"
,
"柱形图_外观_图片背景实际大小类型_预期图"
)])
def
test_ColumnChart_set_image_background_actual_type
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_image_background_actual_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"
,[(
"ColumnChart"
,
"柱形图_外观_直线边框_实际图"
,
"柱形图_外观_直线边框_预期图"
)])
def
test_ColumnChart_set_straight_line_frame
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_straight_line_frame
()
# 直线
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"
,[(
"ColumnChart"
,
"柱形图_外观_虚线边框_实际图"
,
"柱形图_外观_虚线边框_预期图"
)])
def
test_ColumnChart_set_dashed_line_frame
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_dashed_line_frame
()
# 虚线
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"
,[(
"ColumnChart"
,
"柱形图_外观_圆点边框_实际图"
,
"柱形图_外观_圆点边框_预期图"
)])
def
test_ColumnChart_set_scircular_dots_frame
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_scircular_dots_frame
()
# 圆点
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"
,[(
"ColumnChart"
,
"柱形图_外观_无边框_实际图"
,
"柱形图_外观_无边框_预期图"
)])
def
test_ColumnChart_set_no_frame
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_no_frame
()
# 无边框
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"
,[(
"ColumnChart"
,
"柱形图_外观_内外阴影_实际图"
,
"柱形图_外观_内外阴影_预期图"
)])
def
test_ColumnChart_set_shadow
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_shadow
()
# 设置内外阴影
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"
,[(
"ColumnChart"
,
"柱形图_外观_圆角_实际图"
,
"柱形图_外观_圆角_预期图"
)])
def
test_ColumnChart_set_rounded_corners
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_rounded_corners
()
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"
,[(
"ColumnChart"
,
"柱形图_外观_不透明度_实际图"
,
"柱形图_外观_不透明度_预期图"
)])
def
test_ColumnChart_set_opacity
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_opacity
()
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"
,[(
"ColumnChart"
,
"柱形图_文本_左对齐_实际图"
,
"柱形图_文本_左对齐_预期图"
)])
def
test_ColumnChart_set_left_aligned
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_left_aligned
()
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"
,[(
"ColumnChart"
,
"柱形图_文本_居中对齐_实际图"
,
"柱形图_文本_居中对齐_预期图"
)])
def
test_ColumnChart_set_center_aligned
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_center_aligned
()
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"
,[(
"ColumnChart"
,
"柱形图_文本_右对齐_实际图"
,
"柱形图_文本_右对齐_预期图"
)])
def
test_ColumnChart_set_right_aligned
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
set_right_aligned
()
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"
,
[(
"ColumnChart"
,
"柱形图_文本_字号颜色加粗斜体下划线_实际图"
,
"柱形图_文本_字号颜色加粗斜体下划线_预期图"
)])
def
test_ColumnChart_set_font_style
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
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"
,[(
"ColumnChart"
,
"柱形图_文本_字体类型_实际图"
,
"柱形图_文本_字体类型_预期图"
)])
def
test_ColumnChart_set_font_type
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
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"
,[(
"ColumnChart"
,
"柱形图_文本_字距行高_实际图"
,
"柱形图_文本_字距行高_预期图"
)])
def
test_ColumnChart_set_font_distance
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
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
"页面截图与预期截图不一致"
@allure.story
(
"柱形图-标题-修改标题"
)
@pytest.mark.parametrize
(
"filename,actual_img_name,expect_img_name"
,[(
"ColumnChart"
,
"柱形图_标题_修改标题_实际图"
,
"柱形图_标题_修改标题_预期图"
)])
def
test_ColumnChart_change_title
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
test_change_title
()
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"
,[(
"ColumnChart"
,
"柱形图_标题_隐藏标题_实际图"
,
"柱形图_标题_隐藏标题_预期图"
)])
def
test_ColumnChart_hide_title
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
test_hide_title
()
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"
,[(
"ColumnChart"
,
"柱形图_图表设置_柱形宽度圆角_实际图"
,
"柱形图_图表设置_柱形宽度圆角_预期图"
)])
def
test_ColumnChart_chart_setting_column_shaped_width_fillet
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
test_chart_setting_column_shaped_width_fillet
()
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"
,
[(
"ColumnChart"
,
"柱形图_图表设置_维度和指标间距_实际图"
,
"柱形图_图表设置_维度和指标间距_预期图"
)])
def
test_ColumnChart_chart_setting_dimension_index_spacing
(
self
,
page
,
create_page
,
filename
,
actual_img_name
,
expect_img_name
):
bp
=
BasePage
(
page
)
bp
.
_goto_url
(
"画面"
)
ccpc
=
ColumnChartPage_Case
(
page
)
ccpc
.
test_chart_setting_dimension_index_spacing
()
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"
,
[(
"ColumnChart"
,
"柱形图_图表设置_显示柱形背景_实际图"
,
"柱形图_图表设置_显示柱形背景_预期图"
)])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment