diff --git a/case/test_dde_1271035.py b/case/test_dde_1271035.py index fc53a066baa6def2b7dde0677f9272f63a0516c6..994f0ce66af72746080ec13301516f68b0c8fda2 100644 --- a/case/test_dde_1271035.py +++ b/case/test_dde_1271035.py @@ -8,7 +8,6 @@ class TestDdeCase(BaseCase): DdeMethod().dde_method_add_common_account_by_control_center() self.assert_image_exist_in_dde("test_dde_1271035_1.png") - def teardown_method(self): """删除新增账户并且关闭控制中心""" DdeMethod().dde_method_delete_test_account_by_control_center() diff --git a/case/test_dde_1271041.py b/case/test_dde_1271041.py new file mode 100644 index 0000000000000000000000000000000000000000..a1ec8ba9c6134b4f26f07f7739712d4a7d28afa6 --- /dev/null +++ b/case/test_dde_1271041.py @@ -0,0 +1,22 @@ +import pytest +from case.base_case import BaseCase +from method.dde_method import DdeMethod + + +class TestDdeCase(BaseCase): + def test_dde_1271041_1(self): + """在控制中心中新建标准账户""" + DdeMethod().dde_method_add_common_account_by_control_center() + self.assert_image_exist_in_dde("test_dde_1271035_1.png") + + def test_dde_1271041_2(self): + """在控制中心中新建管理员账户""" + DdeMethod().dde_method_add_root_account_by_control_center() + self.assert_image_exist_in_dde("test_dde_1271035_2.png") + + @pytest.fixture(autouse=True) + def delete_account_and_close_window(self): + """删除新增账户并且关闭控制中心""" + yield + DdeMethod().dde_method_delete_test_account_by_control_center() + DdeMethod().dde_method_close_window() diff --git a/case/test_dde_1271247.py b/case/test_dde_1271247.py index 8decff7cdf49d45c585dbe4147f686a45432fe27..3d6e786fa8de9f50a2b3366bc1e5b39f72a9b236 100644 --- a/case/test_dde_1271247.py +++ b/case/test_dde_1271247.py @@ -10,7 +10,8 @@ class TestDdeCase(BaseCase): app_name = "deepin-terminal" DdeMethod().base_method_kill_process_by_cmd(app_name) pylinuxauto.ctrl_alt_t() - DdeMethod().base_method_click_by_img("terminal_set_btn.png") + sleep(6) + DdeMethod().dde_terminal_method_click_option_by_attr() sleep(1) DdeMethod().base_method_click_by_ocr("远程管理") sleep(1) @@ -23,5 +24,4 @@ class TestDdeCase(BaseCase): self.assert_process_status(False, app_name) def teardown_method(self): - """""" pylinuxauto.alt_f4() diff --git a/dde.csv b/dde.csv index 548453ed1a43c1cb8b146c39252124b86af8625c..878dc764714f5981f2a90ac9b5074993ded692c6 100644 --- a/dde.csv +++ b/dde.csv @@ -1,13 +1,15 @@ 脚本ID,跳过原因,确认修复,废弃用例 1270985,,, 1270989,,, -1271005,,, +1271001,,, 1271009,,, 1271011,,, 1271027,,, +1271031,,, 1271033,,, 1271035,,, 1271037,,, +1271041,,, 1271073,,, 1271075,,, 1271077,,, @@ -16,7 +18,15 @@ 1271093,,, 1271123,,, 1271135,,, +1271153,,, +1271157,,, +1271159,,, +1271169,,, +1271199,,, +1271201,,, 1271213,,, +1271247,,, +1271293,,, 1271295,,, 1271297,,, 1271299,,, @@ -26,5 +36,7 @@ 1271313,,, 1271315,,, 1271317,,, +1271319,,, +1271321,,, 1271327,,, 1271331,,, \ No newline at end of file diff --git a/method/dde_method.py b/method/dde_method.py index 2d7495feded377fce0ae81a0c997c94f983a618f..5c74799ad44b9048bcc1ea9823f2f9a4502b196e 100644 --- a/method/dde_method.py +++ b/method/dde_method.py @@ -13,6 +13,7 @@ from method.base_method import BaseMethod from method.dde_browser_method import DdeBrowserMethod from method.dde_device_manager_method import DdeDeviceManagerMethod from method.dde_editor_method import DdeEditorMethod +from method.dde_terminal_method import DdeTerminalMethod from method.deepin_log_viewer_method import DeepinLogViewerMethod funnylog2_config.CLASS_NAME_ENDSWITH = ["Method"] @@ -35,6 +36,7 @@ class DdeMethod( DdeEditorMethod, DdeDeviceManagerMethod, DeepinLogViewerMethod, + DdeTerminalMethod, ): """应用方法主类""" @@ -47,6 +49,7 @@ class DdeMethod( def dde_method_close_window(self): """关闭窗口""" + def get_euler_version(): """获取 openEuler 版本信息,默认图片失败时使用版本图片定位""" with open("/etc/openEuler-release") as f: @@ -338,3 +341,4 @@ class DdeMethod( if __name__ == "__main__": sleep(3) + pylinuxauto.find_element_by_attr_path("/deepin-terminal/DTitlebarDWindowOptionButton").click() diff --git a/method/dde_terminal_method.py b/method/dde_terminal_method.py index 80088e1b2745fef53aaf083682cc04c2c01ba8f1..1bd05bc4c74d06a3a16902795ad734dde73a8211 100644 --- a/method/dde_terminal_method.py +++ b/method/dde_terminal_method.py @@ -10,4 +10,10 @@ class DdeTerminalMethod(BaseMethod): def dde_terminal_method__right_click_by_xy(self): """通过右键点击【在终端中打开】""" pylinuxauto.right_click(960, 540) - self.base_method_click_by_ocr("在终端中打开") \ No newline at end of file + self.base_method_click_by_ocr("在终端中打开") + + def dde_terminal_method_click_option_by_attr(self): + """在终端界面内点击右上角的【设置】按钮""" + pylinuxauto.find_element_by_attr_path( + "/deepin-terminal/DTitlebarDWindowOptionButton" + ).click()