uitest/uitest/test.py |   21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

New commits:
commit ba4a3e650531a4832795514cdbd7535281f408aa
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Jan 16 08:25:51 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Jan 16 09:12:19 2019 +0100

    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: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py
index 1a72c76fb37b..0855a9d4efc5 100644
--- a/uitest/uitest/test.py
+++ b/uitest/uitest/test.py
@@ -115,22 +115,23 @@ class UITest(object):
         xCrashReportDlg = self._xUITest.getTopFocusWindow()
         state = get_state_as_dict(xCrashReportDlg)
         print(state)
-        if state['ID'] == "CrashReportDialog":
-            print("found a crash reporter")
-            xCancelBtn = xCrashReportDlg.getChild("btn_cancel")
-            self.close_dialog_through_button(xCancelBtn)
-        else:
-            raise RuntimeException("not a crashreporter")
+        if state['ID'] != "CrashReportDialog":
+            return False
+        print("found a crash reporter")
+        xCancelBtn = xCrashReportDlg.getChild("btn_cancel")
+        self.close_dialog_through_button(xCancelBtn)
+        return True
 
     def create_doc_in_start_center(self, app):
         xStartCenter = self._xUITest.getTopFocusWindow()
         try:
             xBtn = xStartCenter.getChild(app + "_all")
         except RuntimeException:
-            print("Handled crash reporter")
-            self._handle_crash_reporter()
-            xStartCenter = self._xUITest.getTopFocusWindow()
-            xBtn = xStartCenter.getChild(app + "_all")
+            if self._handle_crash_reporter():
+                xStartCenter = self._xUITest.getTopFocusWindow()
+                xBtn = xStartCenter.getChild(app + "_all")
+            else:
+                raise
 
         with EventListener(self._xContext, "OnNew") as event:
             xBtn.executeAction("CLICK", tuple())
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to