uitest: add load properties parameters

Add the option to include the load properties
when invoked load_file function.

Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I27cb31e2470bc76bcc5b760661e50f00fc334d64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157102
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157567
Tested-by: Jenkins
This commit is contained in:
Henry Castro
2023-10-04 19:46:13 +02:00
parent a29841ccbd
commit 3d665f4ee6
+4 -4
View File
@@ -81,9 +81,9 @@ class UITest(object):
return
time.sleep(DEFAULT_SLEEP)
def load_component_from_url(self, url, eventName="OnLoad"):
def load_component_from_url(self, url, eventName="OnLoad", load_props=()):
with EventListener(self._xContext, eventName) as event:
component = self.get_desktop().loadComponentFromURL(url, "_default", 0, tuple())
component = self.get_desktop().loadComponentFromURL(url, "_default", 0, load_props)
while True:
if event.executed:
frames = self.get_frames()
@@ -94,9 +94,9 @@ class UITest(object):
# Calls UITest.close_doc at exit
@contextmanager
def load_file(self, url):
def load_file(self, url, load_props=()):
try:
yield self.load_component_from_url(url)
yield self.load_component_from_url(url, "OnLoad", load_props)
finally:
self.close_doc()