[Libreoffice-commits] core.git: 2 commits - uitest/libreoffice uitest/uitest
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Sep 27 09:28:55 UTC 2018
uitest/libreoffice/uno/eventlistener.py | 3 +++
uitest/uitest/test.py | 13 +++++++------
2 files changed, 10 insertions(+), 6 deletions(-)
New commits:
commit 753dd7c178100ade0f14b2f127691b756d03572c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
AuthorDate: Thu Sep 27 10:15:25 2018 +0200
Commit: Markus Mohrhard <markus.mohrhard at googlemail.com>
CommitDate: Thu Sep 27 11:28:41 2018 +0200
uitest: add the ModelessDialogVisible event to the execute_blocked_action
Change-Id: I5496bf0bcce442c60d2ecd4207734d0e8b17935b
Reviewed-on: https://gerrit.libreoffice.org/61026
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/uitest/libreoffice/uno/eventlistener.py b/uitest/libreoffice/uno/eventlistener.py
index 2dbdd68f086e..ba7faec76ab6 100644
--- a/uitest/libreoffice/uno/eventlistener.py
+++ b/uitest/libreoffice/uno/eventlistener.py
@@ -44,6 +44,9 @@ class EventListener(XDocumentEventListener,unohelper.Base):
if event.EventName in self.eventNames:
self.executed = True
self.eventExecuted.append(event.EventName)
+ else:
+ print(self.eventNames)
+ print(event.EventName)
def hasExecuted(self, eventName):
return eventName in self.eventExecuted
diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py
index 10d2258335df..1a72c76fb37b 100644
--- a/uitest/uitest/test.py
+++ b/uitest/uitest/test.py
@@ -196,7 +196,7 @@ class UITest(object):
"""
thread = threading.Thread(target=action, args=args)
- with EventListener(self._xContext, ["DialogExecute", "ModelessDialogExecute"], printNames=printNames) as event:
+ with EventListener(self._xContext, ["DialogExecute", "ModelessDialogExecute", "ModelessDialogVisible"], printNames=printNames) as event:
thread.start()
time_ = 0
# we are not necessarily opening a dialog, so wait much longer
commit 18c2a6c5b41f442a57db74107c63b72ee0b8c042
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
AuthorDate: Thu Sep 27 09:59:33 2018 +0200
Commit: Markus Mohrhard <markus.mohrhard at googlemail.com>
CommitDate: Thu Sep 27 11:28:31 2018 +0200
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 at googlemail.com>
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
More information about the Libreoffice-commits
mailing list