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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user