uitest/uitest/test.py | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit 9071fa5f5f103808234102dc7552266ccda7bb22
Author: Noel Grandin <[email protected]>
AuthorDate: Wed Nov 1 12:41:05 2023 +0200
Commit: Noel Grandin <[email protected]>
CommitDate: Thu Nov 2 06:22:04 2023 +0100
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 <[email protected]>
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: