uitest/uitest/test.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit c2d4406206bfad59c238a0d55eab32d6763226e6 Author: Noel Grandin <[email protected]> AuthorDate: Thu Mar 28 10:14:16 2024 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Thu Mar 28 12:42:20 2024 +0100 add check to close_dialog_through_button to verify that the dialog did indeed close Change-Id: If591c9144b392a69bea0b380b4b6e4001a8382fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165445 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py index 7d867a14da68..fbe5d2a87c99 100644 --- a/uitest/uitest/test.py +++ b/uitest/uitest/test.py @@ -190,13 +190,17 @@ class UITest(object): time.sleep(DEFAULT_SLEEP) def close_dialog_through_button(self, button): + dialog = self._xUITest.getTopFocusWindow() with EventListener(self._xContext, "DialogClosed" ) as event: button.executeAction("CLICK", tuple()) while True: if event.executed: time.sleep(DEFAULT_SLEEP) - return + break time.sleep(DEFAULT_SLEEP) + parent = self._xUITest.getTopFocusWindow() + if parent == dialog: + raise Exception("executing the action did not close the dialog") def close_doc(self): desktop = self.get_desktop()
