diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-02-27 04:07:01 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-02-27 09:45:00 +0000 |
commit | 48c8675b030ec597f3f7430963841901dbececff (patch) | |
tree | 3ccf7a9efbd3a8f6ccc5b3037e6559a32346a09a /uitest | |
parent | c9326537872e1f6b90a418ee2d7c7ffcf27b9c43 (diff) |
uitest: handle crash reporter dialog correctly during start-up
Change-Id: I1db54ad2ad38642ac84211fd6d6505e171fc4423
Reviewed-on: https://gerrit.libreoffice.org/34671
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/uitest/test.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py index 2de8b317f795..e17149251c03 100644 --- a/uitest/uitest/test.py +++ b/uitest/uitest/test.py @@ -8,6 +8,9 @@ import time import threading from uitest.config import DEFAULT_SLEEP +from uitest.uihelper.common import get_state_as_dict + +from com.sun.star.uno import RuntimeException from libreoffice.uno.eventlistener import EventListener @@ -105,9 +108,27 @@ class UITest(object): time.sleep(DEFAULT_SLEEP) raise DialogNotExecutedException(action) + def _handle_crash_reporter(self): + 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") + def create_doc_in_start_center(self, app): xStartCenter = self._xUITest.getTopFocusWindow() - xBtn = xStartCenter.getChild(app + "_all") + 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") + with EventListener(self._xContext, "OnNew") as event: xBtn.executeAction("CLICK", tuple()) time_ = 0 |