uitest/uitest/test.py | 10 ++++++++++ 1 file changed, 10 insertions(+) New commits: commit 8e8236500ce862ce27acbbfc7bbeab545931798e Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Feb 24 18:34:27 2022 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Feb 24 19:47:47 2022 +0100
uitest: try harder to close the dialog when it fails ... ... and close_button is empty This was introduced in 2021-06-29 15:35:55 - ff641dc9e4d2aff1d1cbe4425cd9c03a2edc847e < uitest: try harder to close the dialog when it fails... > and later reverted in 2021-07-02 20:41:50 - 4f8748fc973acdb67790ff048a247717afa9b9c7 < Revert "uitest: try harder to close the dialog when it fails..." > Reintroduce it again and also fix the problem why it was reverted. Without this fix, it will hang when an assert is triggered inside a dialog when close_button is empty Change-Id: If643caea61139f69f72c9b429aaad5b9d7d78c72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130506 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py index 3beee0d274f2..11cb15dab9c8 100644 --- a/uitest/uitest/test.py +++ b/uitest/uitest/test.py @@ -133,6 +133,11 @@ 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")) + raise finally: if close_button: self.close_dialog_through_button(xDialog.getChild(close_button)) @@ -259,6 +264,11 @@ 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")) + raise finally: if close_button: self.close_dialog_through_button(xDialog.getChild(close_button))