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>
This commit is contained in:
Xisco Fauli
2021-06-29 21:52:01 +02:00
parent b58fe9414f
commit ff641dc9e4
+8
View File
@@ -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))