summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-07-16 17:35:29 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-07-16 18:27:14 +0200
commit1a20e663322d0c37e985df1b9cefdb4827ed74ef (patch)
treeec6ba7e0d7eb5dde2964ec3790023303148d2ee1 /uitest
parenta980b6c8aee6e3f6916dc0dc617f53e70191234c (diff)
uitest: provide a way to open a dialog through an action on an object
This allows for example to open a dialog through clicking on a button or through a chart command. Change-Id: Iaca6faa3a1b26f4f677a3a670e2c9891373524d3
Diffstat (limited to 'uitest')
-rw-r--r--uitest/uitest/test.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py
index 05e5c91422ba..4eb8c846c050 100644
--- a/uitest/uitest/test.py
+++ b/uitest/uitest/test.py
@@ -49,6 +49,21 @@ class UITest(object):
raise DialogNotExecutedException(command)
+ def execute_dialog_through_action(self, ui_object, action, parameters = None):
+ if parameters is None:
+ parameters = tuple()
+
+ with EventListener(self._xContext, "DialogExecute") as event:
+ ui_object.executeAction(action, parameters)
+ time_ = 0
+ while time_ < 30:
+ if event.executed:
+ time.sleep(DEFAULT_SLEEP)
+ return
+ time_ += DEFAULT_SLEEP
+ time.sleep(DEFAULT_SLEEP)
+ raise DialogNotExecutedException(command)
+
def create_doc_in_start_center(self, app):
xStartCenter = self._xUITest.getTopFocusWindow()
xBtn = xStartCenter.getChild(app + "_all")