diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-09-12 21:13:00 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-09-13 10:37:55 +0200 |
commit | 714278ce47692d57965b06e8b83de632e6e97d2d (patch) | |
tree | 0303b88c76abdba5c2d16bacc21aef94a22df831 /uitest/demo_ui/edit.py | |
parent | 1301d8461ec5112ad8bc672dd1ac141238a29cef (diff) |
uitest: guard the remaining execute_modeless_dialog_through_command
Change-Id: I239fe94cc8983e679c82aa43d74d8099b13e73b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122011
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'uitest/demo_ui/edit.py')
-rw-r--r-- | uitest/demo_ui/edit.py | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/uitest/demo_ui/edit.py b/uitest/demo_ui/edit.py index 75d20b6afc6f..94b86c639d0a 100644 --- a/uitest/demo_ui/edit.py +++ b/uitest/demo_ui/edit.py @@ -18,36 +18,30 @@ class EditTest(UITestCase): with self.ui_test.create_doc_in_start_center("calc"): - self.ui_test.execute_modeless_dialog_through_command(".uno:AddName") - xAddNameDlg = self.xUITest.getTopFocusWindow() + with self.ui_test.execute_modeless_dialog_through_command_guarded(".uno:AddName", close_button="cancel") as xAddNameDlg: - xEdit = xAddNameDlg.getChild("edit") + xEdit = xAddNameDlg.getChild("edit") - type_text(xEdit, "simpleRangeName") + type_text(xEdit, "simpleRangeName") - xAddBtn = xAddNameDlg.getChild("cancel") - self.ui_test.close_dialog_through_button(xAddBtn) def test_select_text(self): with self.ui_test.create_doc_in_start_center("calc"): - self.ui_test.execute_modeless_dialog_through_command(".uno:AddName") - xAddNameDlg = self.xUITest.getTopFocusWindow() + with self.ui_test.execute_modeless_dialog_through_command_guarded(".uno:AddName", close_button="cancel") as xAddNameDlg: - xEdit = xAddNameDlg.getChild("edit") + xEdit = xAddNameDlg.getChild("edit") - type_text(xEdit, "simpleRangeName") - xEdit.executeAction("SELECT", mkPropertyValues({"FROM": "2", "TO": "9"})) - type_text(xEdit, "otherChars") - self.assertEqual("siotherCharsgeName", get_state_as_dict(xEdit)["Text"]) + type_text(xEdit, "simpleRangeName") + xEdit.executeAction("SELECT", mkPropertyValues({"FROM": "2", "TO": "9"})) + type_text(xEdit, "otherChars") + self.assertEqual("siotherCharsgeName", get_state_as_dict(xEdit)["Text"]) - select_text(xEdit, from_pos="2", to="12") - self.assertEqual("otherChars", get_state_as_dict(xEdit)["SelectedText"]) + select_text(xEdit, from_pos="2", to="12") + self.assertEqual("otherChars", get_state_as_dict(xEdit)["SelectedText"]) - xAddBtn = xAddNameDlg.getChild("cancel") - self.ui_test.close_dialog_through_button(xAddBtn) # vim: set shiftwidth=4 softtabstop=4 expandtab: |