diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-06-29 15:35:55 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-06-29 21:52:01 +0200 |
commit | ff641dc9e4d2aff1d1cbe4425cd9c03a2edc847e (patch) | |
tree | fa76a27b82bb251992fb793be6ba5f1638f370db /uitest | |
parent | b58fe9414f6303ed55f4c82bd697bd2ca35347d7 (diff) |
uitest: try harder to close the dialog when it fails...
... and close_button is None.
Change-Id: I01318fd3eff5c9d8775443529ad1a7b18d537968
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118117
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/uitest/test.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py index 1e3ddc85747f..8b7b5a4c98f8 100644 --- a/uitest/uitest/test.py +++ b/uitest/uitest/test.py @@ -119,6 +119,10 @@ class UITest(object): xDialog = self._xUITest.getTopFocusWindow() try: yield xDialog + except: + if not close_button: + if 'cancel' in xDialog.getChildren(): + self.close_dialog_through_button(xDialog.getChild("cancel")) finally: if close_button: self.close_dialog_through_button(xDialog.getChild(close_button)) @@ -248,6 +252,10 @@ class UITest(object): xDialog = self._xUITest.getTopFocusWindow() try: yield xDialog + except: + if not close_button: + if 'cancel' in xDialog.getChildren(): + self.close_dialog_through_button(xDialog.getChild("cancel")) finally: if close_button: self.close_dialog_through_button(xDialog.getChild(close_button)) |