diff options
-rw-r--r-- | uitest/uitest/test.py | 6 |
1 files changed, 5 insertions, 1 deletions
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() |