diff --git a/case/test_dde_1892487.py b/case/test_dde_1892487.py new file mode 100644 index 0000000000000000000000000000000000000000..0e49b14f1bff29566fb598d532031e819ead6370 --- /dev/null +++ b/case/test_dde_1892487.py @@ -0,0 +1,51 @@ + +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 + +import time + + +class TestDdeCase(BaseCase): + + def setup(self): + self.notify_loc = DdeDockMethod().get_x_y_by_img("dock_notify_icon.png") + + def test_dde_1892487(self): + euler = DdeMethod() + + DdeDockMethod.click(*self.notify_loc) + self.assert_ocr_exist("通知中心") + + DdeMethod().click_restore() + + # 悬浮显示提示 + Src.move_to(*self.notify_loc) + time.sleep(2) + self.assert_ocr_exist("暂无新消息") + + # 发送通知 + Cmd.run_cmd("notify-send hello world") + + # 悬浮显示已有通知 + DdeMethod().click_restore() + time.sleep(5) + Src.move_to(*self.notify_loc) + time.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() + time.sleep(1) + + def teardown(self): + DdeDockMethod().click(*self.notify_loc) + time.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 dfd9c001f47fa6f03e583da239748e9e44d226f2..0553f7fe77f584a0e2afcdaa14b0db0ad0a2407e 100644 --- a/dde.csv +++ b/dde.csv @@ -78,3 +78,4 @@ 1893167,,, 1893225,,, 1893223,,, +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