summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-09-29 16:32:31 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-09-29 17:26:47 +0200
commit0a4eecd49a6744838a23a0a6804a851511aed246 (patch)
tree099ed31dc247016f022c95d44bbab21b615903ad /uitest
parent814266e801fbc28ea431ac8b13bb40d8a8243cc7 (diff)
make use of the new event for closed dialogs
Change-Id: I59102fda8390d9594999ceaa45105e38ecbc970e
Diffstat (limited to 'uitest')
-rw-r--r--uitest/uitest/test.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py
index 2860c0283403..372095880ba7 100644
--- a/uitest/uitest/test.py
+++ b/uitest/uitest/test.py
@@ -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")