summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2018-09-27 09:59:33 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2018-09-27 11:28:31 +0200
commit18c2a6c5b41f442a57db74107c63b72ee0b8c042 (patch)
treed9cc7bc77978af0e551f14ca5152abd8012b94fc /uitest
parent9a89a75052c7327187cd5788dbaf8891a0a95cac (diff)
uitest: make it easier to log the received events for dialog creation
Change-Id: I1dc3041408c3f9fa9ce6023d7c668bc5baa65b4e Reviewed-on: https://gerrit.libreoffice.org/61025 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'uitest')
-rw-r--r--uitest/uitest/test.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py
index 0318dfa64d81..10d2258335df 100644
--- a/uitest/uitest/test.py
+++ b/uitest/uitest/test.py
@@ -68,8 +68,8 @@ class UITest(object):
time_ += DEFAULT_SLEEP
time.sleep(DEFAULT_SLEEP)
- def execute_dialog_through_command(self, command):
- with EventListener(self._xContext, "DialogExecute") as event:
+ def execute_dialog_through_command(self, command, printNames=False):
+ with EventListener(self._xContext, "DialogExecute", printNames=printNames) as event:
if not self._xUITest.executeDialog(command):
raise DialogNotExecutedException(command)
time_ = 0
@@ -82,8 +82,8 @@ class UITest(object):
raise DialogNotExecutedException(command)
- def execute_modeless_dialog_through_command(self, command):
- with EventListener(self._xContext, "ModelessDialogVisible") as event:
+ def execute_modeless_dialog_through_command(self, command, printNames=False):
+ with EventListener(self._xContext, "ModelessDialogVisible", printNames = printNames) as event:
if not self._xUITest.executeCommand(command):
raise DialogNotExecutedException(command)
time_ = 0
@@ -178,7 +178,7 @@ class UITest(object):
time.sleep(DEFAULT_SLEEP)
def execute_blocking_action(self, action, dialog_element=None,
- args=(), dialog_handler=None):
+ args=(), dialog_handler=None, printNames=False):
"""Executes an action which blocks while a dialog is shown.
Click a button or perform some other action on the dialog when it
@@ -192,10 +192,11 @@ class UITest(object):
args(tuple, optional): The arguments to be passed to `action`
dialog_handler(callable, optional): Will be called when the dialog
is shown, with the dialog object passed as a parameter.
+ printNames: print all received event names
"""
thread = threading.Thread(target=action, args=args)
- with EventListener(self._xContext, ["DialogExecute", "ModelessDialogExecute"]) as event:
+ with EventListener(self._xContext, ["DialogExecute", "ModelessDialogExecute"], printNames=printNames) as event:
thread.start()
time_ = 0
# we are not necessarily opening a dialog, so wait much longer