From 9071fa5f5f103808234102dc7552266ccda7bb22 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 1 Nov 2023 12:41:05 +0200 Subject: uitest: check that dialog really did open to make it easier to debug cases where the event.executed flag is not sufficient to indicate that the dialog has finished opening Change-Id: Ibcbd089372e47908e3692d452f4064edbc7f788d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158751 Tested-by: Jenkins Reviewed-by: Noel Grandin --- uitest/uitest/test.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'uitest') diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py index 602b03c2a9f7..fcf9d3dee783 100644 --- a/uitest/uitest/test.py +++ b/uitest/uitest/test.py @@ -128,11 +128,14 @@ class UITest(object): @contextmanager def execute_dialog_through_command(self, command, printNames=False, close_button = "ok", eventName = "DialogExecute"): with EventListener(self._xContext, eventName, printNames=printNames) as event: + xDialogParent = self._xUITest.getTopFocusWindow() if not self._xUITest.executeDialog(command): raise Exception("Dialog not executed for: " + command) while True: if event.executed: xDialog = self._xUITest.getTopFocusWindow() + if xDialogParent == xDialog: + raise Exception("executing the action did not open the dialog") try: yield xDialog except: @@ -157,11 +160,14 @@ class UITest(object): if parameters is None: parameters = tuple() + xDialogParent = self._xUITest.getTopFocusWindow() with EventListener(self._xContext, event_name) as event: ui_object.executeAction(action, parameters) while True: if event.executed: xDialog = self._xUITest.getTopFocusWindow() + if xDialogParent == xDialog: + raise Exception("executing the action did not open the dialog") try: yield xDialog finally: -- cgit