Kaydet (Commit) ba4a3e65 authored tarafından Noel Grandin's avatar Noel Grandin

eliminate some noise from uitest failure

re-arrange the logic so that when create_doc_in_start_center fails, we
only get one backtrace instead of two.

Change-Id: I736b56da8cfb11e8ef17b8422a19eafd70e3cd6f
Reviewed-on: https://gerrit.libreoffice.org/66415
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 72f55906
...@@ -115,22 +115,23 @@ class UITest(object): ...@@ -115,22 +115,23 @@ class UITest(object):
xCrashReportDlg = self._xUITest.getTopFocusWindow() xCrashReportDlg = self._xUITest.getTopFocusWindow()
state = get_state_as_dict(xCrashReportDlg) state = get_state_as_dict(xCrashReportDlg)
print(state) print(state)
if state['ID'] == "CrashReportDialog": if state['ID'] != "CrashReportDialog":
print("found a crash reporter") return False
xCancelBtn = xCrashReportDlg.getChild("btn_cancel") print("found a crash reporter")
self.close_dialog_through_button(xCancelBtn) xCancelBtn = xCrashReportDlg.getChild("btn_cancel")
else: self.close_dialog_through_button(xCancelBtn)
raise RuntimeException("not a crashreporter") return True
def create_doc_in_start_center(self, app): def create_doc_in_start_center(self, app):
xStartCenter = self._xUITest.getTopFocusWindow() xStartCenter = self._xUITest.getTopFocusWindow()
try: try:
xBtn = xStartCenter.getChild(app + "_all") xBtn = xStartCenter.getChild(app + "_all")
except RuntimeException: except RuntimeException:
print("Handled crash reporter") if self._handle_crash_reporter():
self._handle_crash_reporter() xStartCenter = self._xUITest.getTopFocusWindow()
xStartCenter = self._xUITest.getTopFocusWindow() xBtn = xStartCenter.getChild(app + "_all")
xBtn = xStartCenter.getChild(app + "_all") else:
raise
with EventListener(self._xContext, "OnNew") as event: with EventListener(self._xContext, "OnNew") as event:
xBtn.executeAction("CLICK", tuple()) xBtn.executeAction("CLICK", tuple())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment