uitest/uitest/test.py | 8 ++++++++ 1 file changed, 8 insertions(+) New commits: commit ff641dc9e4d2aff1d1cbe4425cd9c03a2edc847e Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Jun 29 15:35:55 2021 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Jun 29 21:52:01 2021 +0200
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 <xiscofa...@libreoffice.org> 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)) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits