summaryrefslogtreecommitdiff
path: root/sw/qa/uitest/findReplace/tdf44837.py
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-09-10 18:18:45 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-09-13 10:37:29 +0200
commit1301d8461ec5112ad8bc672dd1ac141238a29cef (patch)
tree850b5222f842d65914e7f1d463d8c2b29053f182 /sw/qa/uitest/findReplace/tdf44837.py
parent47847b879bf6b5bb6e0f6117e0f9683b3a932a08 (diff)
uitest: guard execute_modeless_dialog_through_command in sw
Change-Id: Ie3acd6eb716d6d3532bb50b5b9002f80044a2bc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121913 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/uitest/findReplace/tdf44837.py')
-rw-r--r--sw/qa/uitest/findReplace/tdf44837.py27
1 files changed, 12 insertions, 15 deletions
diff --git a/sw/qa/uitest/findReplace/tdf44837.py b/sw/qa/uitest/findReplace/tdf44837.py
index 66b3840fd9c9..ace6a8afcbd7 100644
--- a/sw/qa/uitest/findReplace/tdf44837.py
+++ b/sw/qa/uitest/findReplace/tdf44837.py
@@ -19,21 +19,18 @@ class tdf44837(UITestCase):
type_text(xWriterEdit, "asd asd")
self.xUITest.executeCommand(".uno:SelectAll")
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- searchterm = xDialog.getChild("searchterm")
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
- replaceterm = xDialog.getChild("replaceterm")
- replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"b"})) #replace textbox
-
- selectionOnly = xDialog.getChild("selection")
- selectionOnly.executeAction("CLICK", tuple())
- replaceall = xDialog.getChild("replaceall")
- replaceall.executeAction("CLICK", tuple())
- xcloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xcloseBtn)
+ with self.ui_test.execute_modeless_dialog_through_command_guarded(".uno:SearchDialog", close_button="close") as xDialog:
+ searchterm = xDialog.getChild("searchterm")
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
+ replaceterm = xDialog.getChild("replaceterm")
+ replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"b"})) #replace textbox
+
+ selectionOnly = xDialog.getChild("selection")
+ selectionOnly.executeAction("CLICK", tuple())
+ replaceall = xDialog.getChild("replaceall")
+ replaceall.executeAction("CLICK", tuple())
self.assertEqual(document.Text.String[0:8], "bsd bsd")
self.assertEqual(len(document.CurrentSelection[0].String) > 1, True)