diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-22 13:31:42 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-24 11:24:03 +0100 |
commit | ed7105cb3f11db3f36c1bc2af2f07704a38827dd (patch) | |
tree | 876515ecdd0d9449980d439aabd209fdf5f1d494 /bitbake/lib/toaster/tests/browser/selenium_helpers_base.py | |
parent | dd14fac826003eabd8e875a9877b840192f673e0 (diff) | |
download | poky-ed7105cb3f11db3f36c1bc2af2f07704a38827dd.tar.gz |
bitbake: toaster/tests/browser/helper: Add wait_until_element_clickable funciton
Add a variant of the clickable function that accepts an element parameter.
(Bitbake rev: a34b2451a0e3baaf3b2fd2eb351847ff6a5ee033)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/tests/browser/selenium_helpers_base.py')
-rw-r--r-- | bitbake/lib/toaster/tests/browser/selenium_helpers_base.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py index 82defea0f2..4eea2267cc 100644 --- a/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py +++ b/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py | |||
@@ -239,6 +239,13 @@ class SeleniumTestCaseBase(unittest.TestCase): | |||
239 | Wait(self.driver, timeout=timeout).until(is_clickable, msg) | 239 | Wait(self.driver, timeout=timeout).until(is_clickable, msg) |
240 | return self.find(selector) | 240 | return self.find(selector) |
241 | 241 | ||
242 | def wait_until_element_clickable(self, finder, timeout=Wait._TIMEOUT): | ||
243 | """ Wait until element is clickable """ | ||
244 | is_clickable = lambda driver: (finder(driver).is_displayed() and finder(driver).is_enabled()) | ||
245 | msg = 'A matching element never became be clickable' | ||
246 | Wait(self.driver, timeout=timeout).until(is_clickable, msg) | ||
247 | return finder(self.driver) | ||
248 | |||
242 | def wait_until_focused(self, selector): | 249 | def wait_until_focused(self, selector): |
243 | """ Wait until element matching CSS selector has focus """ | 250 | """ Wait until element matching CSS selector has focus """ |
244 | is_focused = \ | 251 | is_focused = \ |