diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-09-10 17:09:40 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-09-13 10:36:27 +0200 |
commit | a917d4abd8577cf7d6655f0484ff55dd86a0a8a1 (patch) | |
tree | 0b561255bb0e9b56fe306de4ae7a86e3311bbfb1 /uitest | |
parent | c10c32438025edda2f3c178b47d369e7979f25a8 (diff) |
uitest: guard execute_modeless_dialog_through_command in sd
Change-Id: I4d67318af30b00182253de5f6ccf9cafd7664ee1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121911
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/uitest/test.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py index fe06c1e65817..48ddf2833035 100644 --- a/uitest/uitest/test.py +++ b/uitest/uitest/test.py @@ -110,8 +110,8 @@ class UITest(object): # Calls UITest.close_dialog_through_button at exit @contextmanager - def execute_dialog_through_command(self, command, printNames=False, close_button = "ok"): - with EventListener(self._xContext, "DialogExecute", printNames=printNames) as event: + def execute_dialog_through_command(self, command, printNames=False, close_button = "ok", eventName = "DialogExecute"): + with EventListener(self._xContext, eventName, printNames=printNames) as event: if not self._xUITest.executeDialog(command): raise Exception("Dialog not executed for: " + command) while True: @@ -125,6 +125,11 @@ class UITest(object): return time.sleep(DEFAULT_SLEEP) + @contextmanager + def execute_modeless_dialog_through_command_guarded(self, command, printNames=False, close_button = "ok"): + with self.execute_dialog_through_command(command, printNames, close_button, "ModelessDialogVisible") as xDialog: + yield xDialog + def execute_modeless_dialog_through_command(self, command, printNames=False): with EventListener(self._xContext, "ModelessDialogVisible", printNames = printNames) as event: if not self._xUITest.executeCommand(command): |