diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-05-01 11:44:02 +0300 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-18 17:02:06 +0200 |
commit | 5f21a01311aaf2608d0b5ad3ab887730463c1f39 (patch) | |
tree | 536cc51050c41951847fa6e5e40a86e0fa40525c /uitest | |
parent | 56f61df183da7a5061296fb5eaf1690a8ba8a3ef (diff) |
uitest: handle closing documents correctly
This now covers also changed documents correctly and just discards the
changes.
Change-Id: I75f36cf6874782eaf296bad42974f4a03f55eaa5
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/uitest_helper.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/uitest/uitest_helper.py b/uitest/uitest_helper.py index 3f46618e6aa6..630613c90193 100644 --- a/uitest/uitest_helper.py +++ b/uitest/uitest_helper.py @@ -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) |