Kaydet (Commit) 5f21a013 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

uitest: handle closing documents correctly

This now covers also changed documents correctly and just discards the
changes.

Change-Id: I75f36cf6874782eaf296bad42974f4a03f55eaa5
üst 56f61df1
......@@ -61,15 +61,17 @@ class UITest(object):
def close_doc(self):
# also need to handle "OnViewClosed" event
with EventListener(self._xContext, "DialogExecute") as event:
self._xUITest.executeCommand(".uno.CloseDoc")
with EventListener(self._xContext, ["DialogExecute", "OnViewClosed"] ) as event:
self._xUITest.executeCommand(".uno:CloseDoc")
time_ = 0
while time_ < 30:
if event.executed:
if event.hasExecuted("DialogExecute"):
xCloseDlg = self._xUITest.getTopFocusWindow()
xNoBtn = xCloseDlg.getChild("discard")
xNoBtn.executeAction("CLICK", tuple())
return
elif event.hasExecuted("OnViewClosed"):
return
time_ += 1
time.sleep(1)
......
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