From 6631aa3060ebbb3462391d784e406ac2a1060f8c Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Wed, 24 Feb 2021 10:25:09 +0100 Subject: uitest: no need to pass the parent as a parameter Change-Id: I750b5600d3e4ef8ba5a0666133b9066904b4cbec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111450 Tested-by: Xisco Fauli Reviewed-by: Xisco Fauli --- uitest/uitest/test.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'uitest') diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py index 675d8eea4e03..6c10d9821016 100644 --- a/uitest/uitest/test.py +++ b/uitest/uitest/test.py @@ -48,15 +48,21 @@ class UITest(object): if component is not None: return component - def wait_until_child_is_available(self, parent, childName): + def wait_until_child_is_available(self, childName): time_ = 0 + xChild = None + while time_ < MAX_WAIT: - if childName in parent.getChildren(): + xDialog = self._xUITest.getTopFocusWindow() + if childName in xDialog.getChildren(): + xChild = xDialog.getChild(childName) break else: time_ += DEFAULT_SLEEP time.sleep(DEFAULT_SLEEP) + return xChild + def wait_until_property_is_updated(self, element, propertyName, value): time_ = 0 while time_ < MAX_WAIT: -- cgit