Kaydet (Commit) 0a4eecd4 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

make use of the new event for closed dialogs

Change-Id: I59102fda8390d9594999ceaa45105e38ecbc970e
üst 814266e8
......@@ -17,6 +17,11 @@ class DialogNotExecutedException(Exception):
def __str__(self):
return "Dialog not executed for: " + self.command
class DialogNotClosedException(Exception):
def __str__(self):
return "Dialog was not closed"
class UITest(object):
def __init__(self, xUITest, xContext):
......@@ -105,6 +110,18 @@ class UITest(object):
# report a failure here
def close_dialog_through_button(self, button):
with EventListener(self._xContext, "DialogClosed" ) as event:
button.executeAction("CLICK", tuple())
time_ = 0
while time_ < 30:
if event.executed:
time.sleep(DEFAULT_SLEEP)
return
time_ += DEFAULT_SLEEP
time.sleep(DEFAULT_SLEEP)
raise DialogNotClosedException()
def close_doc(self):
with EventListener(self._xContext, ["DialogExecute", "OnViewClosed"] ) as event:
self._xUITest.executeCommand(".uno:CloseDoc")
......
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