summaryrefslogtreecommitdiff
path: root/sc/qa/uitest/search_replace/tdf143759.py
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/uitest/search_replace/tdf143759.py')
-rw-r--r--sc/qa/uitest/search_replace/tdf143759.py49
1 files changed, 23 insertions, 26 deletions
diff --git a/sc/qa/uitest/search_replace/tdf143759.py b/sc/qa/uitest/search_replace/tdf143759.py
index 8fd0c79a1501..c64e06d8493b 100644
--- a/sc/qa/uitest/search_replace/tdf143759.py
+++ b/sc/qa/uitest/search_replace/tdf143759.py
@@ -22,31 +22,28 @@ class tdf143759(UITestCase):
gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:F6"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xSearchterm = xDialog.getChild("searchterm")
- xSearchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xSearchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xSearchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"^$"}))
-
- xRegexp = xDialog.getChild("regexp")
- if get_state_as_dict(xRegexp)['Selected'] == 'false':
- xRegexp.executeAction("CLICK", tuple())
- self.assertEqual("true", get_state_as_dict(xRegexp)['Selected'])
-
- xSelection = xDialog.getChild("selection")
- if get_state_as_dict(xSelection)['Selected'] == 'false':
- xSelection.executeAction("CLICK", tuple())
- self.assertEqual("true", get_state_as_dict(xSelection)['Selected'])
-
- xSearchall = xDialog.getChild("searchall")
- with self.ui_test.execute_dialog_through_action(
- xSearchall, "CLICK", event_name = "ModelessDialogVisible", close_button="close") as dialog:
- # Without the fix in place, this test would have failed with
- # AssertionError: 13 != 0
- self.assertEqual(13, len(dialog.getChild("results").getChildren()))
-
- 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:
+ xSearchterm = xDialog.getChild("searchterm")
+ xSearchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xSearchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xSearchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"^$"}))
+
+ xRegexp = xDialog.getChild("regexp")
+ if get_state_as_dict(xRegexp)['Selected'] == 'false':
+ xRegexp.executeAction("CLICK", tuple())
+ self.assertEqual("true", get_state_as_dict(xRegexp)['Selected'])
+
+ xSelection = xDialog.getChild("selection")
+ if get_state_as_dict(xSelection)['Selected'] == 'false':
+ xSelection.executeAction("CLICK", tuple())
+ self.assertEqual("true", get_state_as_dict(xSelection)['Selected'])
+
+ xSearchall = xDialog.getChild("searchall")
+ with self.ui_test.execute_dialog_through_action(
+ xSearchall, "CLICK", event_name = "ModelessDialogVisible", close_button="close") as dialog:
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 13 != 0
+ self.assertEqual(13, len(dialog.getChild("results").getChildren()))
+
# vim: set shiftwidth=4 softtabstop=4 expandtab: