diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-06-17 17:01:23 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-06-21 10:29:40 +0200 |
commit | 8298aa62726312eee6f8fbb64a9fc9b12680447f (patch) | |
tree | d35191b8bc0a48e0e086b19c9c3c0503e217c71b /sw/qa/uitest/findReplace | |
parent | e837f50313a703b6b26abb78f224472c1e4734ea (diff) |
uitest: guard execute_blocking_action
so even if an assert fails, the dialog is closed afterwards
for motivation, see 89aaa17a0a4413f07da2bc5084b0164f15dc01ac
< UITest: introduce guarded context managers >
Change-Id: I9a3adb52546238d960eeaaaf03b6bdbbd5718cf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117392
Tested-by: Jenkins
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/uitest/findReplace')
-rw-r--r-- | sw/qa/uitest/findReplace/findReplace.py | 8 | ||||
-rw-r--r-- | sw/qa/uitest/findReplace/tdf106099.py | 6 | ||||
-rw-r--r-- | sw/qa/uitest/findReplace/tdf118208.py | 7 | ||||
-rw-r--r-- | sw/qa/uitest/findReplace/tdf119462.py | 7 |
4 files changed, 5 insertions, 23 deletions
diff --git a/sw/qa/uitest/findReplace/findReplace.py b/sw/qa/uitest/findReplace/findReplace.py index 46e00135553e..30e0c0e63006 100644 --- a/sw/qa/uitest/findReplace/findReplace.py +++ b/sw/qa/uitest/findReplace/findReplace.py @@ -71,18 +71,12 @@ class findReplace(UITestCase): searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) format = xDialog.getChild("format") - def handle_format_dlg(dialog): - #print(dialog.getChildren()) + with self.ui_test.execute_blocking_action(format.executeAction, args=('CLICK', ())) as dialog: xTabs = dialog.getChild("tabcontrol") select_pos(xTabs, "0") xSizeFont = dialog.getChild("westsizelb-cjk") xSizeFont.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) xSizeFont.executeAction("TYPE", mkPropertyValues({"TEXT":"16"})) #set font size 16 - xOkBtn = dialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOkBtn) - - self.ui_test.execute_blocking_action(format.executeAction, args=('CLICK', ()), - dialog_handler=handle_format_dlg) # Verify these didn't get set again through SvxSearchController::StateChanged, timer- # triggered from SfxBindings::NextJob while executing the Format dialog above: diff --git a/sw/qa/uitest/findReplace/tdf106099.py b/sw/qa/uitest/findReplace/tdf106099.py index 2e8011dab36a..d0c1ad76f251 100644 --- a/sw/qa/uitest/findReplace/tdf106099.py +++ b/sw/qa/uitest/findReplace/tdf106099.py @@ -21,17 +21,13 @@ class tdf106099(UITestCase): xDialog = self.xUITest.getTopFocusWindow() #2. Choose Format format = xDialog.getChild("format") - def handle_format_dlg(dialog): + with self.ui_test.execute_blocking_action(format.executeAction, args=('CLICK', ())) as dialog: #Font effects - Underline Single. OK. xTabs = dialog.getChild("tabcontrol") select_pos(xTabs, "1") #tab font effects underlinelb = dialog.getChild("underlinelb") select_by_text(underlinelb, "Single") - xOkBtn = dialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOkBtn) - self.ui_test.execute_blocking_action(format.executeAction, args=('CLICK', ()), - dialog_handler=handle_format_dlg) #verify label searchdesc searchdesc = xDialog.getChild("searchdesc") print(get_state_as_dict(searchdesc)) diff --git a/sw/qa/uitest/findReplace/tdf118208.py b/sw/qa/uitest/findReplace/tdf118208.py index c602158b17a4..17cd71fc9923 100644 --- a/sw/qa/uitest/findReplace/tdf118208.py +++ b/sw/qa/uitest/findReplace/tdf118208.py @@ -44,12 +44,9 @@ class tdf118208(UITestCase): xDialog = self.xUITest.getTopFocusWindow() format = xDialog.getChild("format") - def handle_format_dlg(dialog): - xOkBtn = dialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOkBtn) - self.ui_test.execute_blocking_action(format.executeAction, args=('CLICK', ()), - dialog_handler=handle_format_dlg) + with self.ui_test.execute_blocking_action(format.executeAction, args=('CLICK', ())): + pass #verify self.assertEqual(document.Text.String[0:14], "Aaaaaaaaaaaaaa") diff --git a/sw/qa/uitest/findReplace/tdf119462.py b/sw/qa/uitest/findReplace/tdf119462.py index 8623873cbd02..4402d1acaedd 100644 --- a/sw/qa/uitest/findReplace/tdf119462.py +++ b/sw/qa/uitest/findReplace/tdf119462.py @@ -21,18 +21,13 @@ class tdf119462(UITestCase): xDialog = self.xUITest.getTopFocusWindow() #2. Choose Format format = xDialog.getChild("format") - def handle_format_dlg(dialog): - + with self.ui_test.execute_blocking_action(format.executeAction, args=('CLICK', ())) as dialog: #3. Choose Bold xTabs = dialog.getChild("tabcontrol") select_pos(xTabs, "0") xweststylelbcjk = dialog.getChild("weststylelb-cjk") xweststylelbcjk.executeAction("TYPE", mkPropertyValues({"TEXT":"Bold"})) - xOkBtn = dialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOkBtn) - self.ui_test.execute_blocking_action(format.executeAction, args=('CLICK', ()), - dialog_handler=handle_format_dlg) #verify label searchdesc searchdesc = xDialog.getChild("searchdesc") self.assertEqual(get_state_as_dict(searchdesc)["Text"], "bold") |