diff --git a/case/test_dde_1892487.py b/case/test_dde_1892487.py new file mode 100644 index 0000000000000000000000000000000000000000..ee54b0a8f854b4c35d78f7175ded6729ac412142 --- /dev/null +++ b/case/test_dde_1892487.py @@ -0,0 +1,48 @@ + +from apps.dde_autotest_euler.case.base_case import BaseCase +from apps.dde_autotest_euler.method.dde_method import DdeMethod +from apps.dde_autotest_euler.method.vender.dde_dock_method import DdeDockMethod + +from src import CmdCtl as Cmd +from src import Src, sleep + + +class TestDdeCase(BaseCase): + + def setup(self): + self.notify_loc = DdeDockMethod().get_x_y_by_img("dock_notify_icon.png") + + def test_dde_1892487(self): + + DdeDockMethod.click(*self.notify_loc) + self.assert_ocr_exist("通知中心") + + DdeMethod().click_restore() + + # 悬浮显示提示 + Src.move_to(*self.notify_loc) + sleep(2) + self.assert_ocr_exist("暂无新消息") + + # 发送通知 + Cmd.run_cmd("notify-send hello world") + + # 悬浮显示已有通知 + DdeMethod().click_restore() + sleep(5) + Src.move_to(*self.notify_loc) + sleep(2) + self.assert_ocr_exist("1条通知") + + DdeDockMethod().click(self.notify_loc) + self.assert_ocr_exist("hello") + self.assert_ocr_exist("world") + DdeMethod().click_restore() + sleep(1) + + def teardown(self): + DdeDockMethod().click(*self.notify_loc) + sleep(1) + clean_loc = DdeDockMethod().get_x_y_by_img("notify_clean_btn.png") + DdeDockMethod().click(*clean_loc) + DdeMethod().click_restore() diff --git a/dde.csv b/dde.csv index 5348800e7970476ec4ca6e915da7d1a5b4c9a3cc..da288f1aa019c803a034ab4397aac1fdb125468a 100644 --- a/dde.csv +++ b/dde.csv @@ -79,3 +79,4 @@ 1893225,,, 1893223,,, 1893491,,, +1892487,,, diff --git a/method/image_res/dock_notify_icon.png b/method/image_res/dock_notify_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..7a7b31892c4b10dc60607a73cc2f30647ab95e1b Binary files /dev/null and b/method/image_res/dock_notify_icon.png differ diff --git a/method/image_res/notify_clean_btn.png b/method/image_res/notify_clean_btn.png new file mode 100644 index 0000000000000000000000000000000000000000..0975e424d78dd1f60d63186d9599f7d5ae5e48a7 Binary files /dev/null and b/method/image_res/notify_clean_btn.png differ