Kaydet (Commit) 48c8675b authored tarafından Markus Mohrhard's avatar Markus Mohrhard

uitest: handle crash reporter dialog correctly during start-up

Change-Id: I1db54ad2ad38642ac84211fd6d6505e171fc4423
Reviewed-on: https://gerrit.libreoffice.org/34671Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst c9326537
......@@ -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
......
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