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 /sd | |
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 'sd')
-rw-r--r-- | sd/qa/uitest/impress_tests/customSlideShow.py | 13 | ||||
-rw-r--r-- | sd/qa/uitest/impress_tests/tdf141297.py | 5 |
2 files changed, 5 insertions, 13 deletions
diff --git a/sd/qa/uitest/impress_tests/customSlideShow.py b/sd/qa/uitest/impress_tests/customSlideShow.py index 9f491d9a5141..a7aa67b25816 100644 --- a/sd/qa/uitest/impress_tests/customSlideShow.py +++ b/sd/qa/uitest/impress_tests/customSlideShow.py @@ -19,7 +19,7 @@ class customSlideShow(UITestCase): new = CustomSlideShows.getChild("new") ok = CustomSlideShows.getChild("ok") - def handle_new_dlg(DefineCustomSlideShow): + with self.ui_test.execute_blocking_action(new.executeAction, args=('CLICK', ())) as DefineCustomSlideShow: customname = DefineCustomSlideShow.getChild("customname") customname.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"})) customname.executeAction("TYPE", mkPropertyValues({"TEXT": "a"})) @@ -29,11 +29,7 @@ class customSlideShow(UITestCase): xEntry.executeAction("SELECT", tuple()) add = DefineCustomSlideShow.getChild("add") add.executeAction("CLICK",tuple()) - ok = DefineCustomSlideShow.getChild("ok") - self.ui_test.close_dialog_through_button(ok) - self.ui_test.execute_blocking_action(new.executeAction, args=('CLICK', ()), - dialog_handler=handle_new_dlg) self.ui_test.close_dialog_through_button(ok) #verify self.ui_test.execute_dialog_through_command(".uno:CustomShowDialog") @@ -43,7 +39,7 @@ class customSlideShow(UITestCase): self.assertEqual(get_state_as_dict(customshowlist)["SelectionCount"], "1") ok = CustomSlideShows.getChild("ok") - def handle_edit_dlg(DefineCustomSlideShow): + with self.ui_test.execute_blocking_action(edit.executeAction, args=('CLICK', ()), close_button="cancel") as DefineCustomSlideShow: customname = DefineCustomSlideShow.getChild("customname") self.assertEqual(get_state_as_dict(customname)["Text"], "aa") # print(DefineCustomSlideShow.getChildren()) @@ -58,11 +54,6 @@ class customSlideShow(UITestCase): # remove.executeAction("CLICK",tuple()) #tdf126951 self.assertEqual(get_state_as_dict(custompages)["Children"], "1") self.assertEqual(get_state_as_dict(pages)["Children"], "1") - cancel = DefineCustomSlideShow.getChild("cancel") - self.ui_test.close_dialog_through_button(cancel) - - self.ui_test.execute_blocking_action(edit.executeAction, args=('CLICK', ()), - dialog_handler=handle_edit_dlg) CustomSlideShows = self.xUITest.getTopFocusWindow() delete = CustomSlideShows.getChild("delete") diff --git a/sd/qa/uitest/impress_tests/tdf141297.py b/sd/qa/uitest/impress_tests/tdf141297.py index 4140f40aadb7..76aab4d4594f 100644 --- a/sd/qa/uitest/impress_tests/tdf141297.py +++ b/sd/qa/uitest/impress_tests/tdf141297.py @@ -56,8 +56,9 @@ class tdf141297(UITestCase): sBreakLink = "BREAK_LINK" xBreakLink = xDialog.getChild(sBreakLink) - self.ui_test.execute_blocking_action(xBreakLink.executeAction, - args=("CLICK", tuple()), dialog_element="yes") + with self.ui_test.execute_blocking_action(xBreakLink.executeAction, + args=("CLICK", tuple()), close_button="yes"): + pass xClose = xDialog.getChild("close") self.ui_test.close_dialog_through_button(xClose) |