mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 01:19:52 +00:00
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>
This commit is contained in:
@@ -239,6 +239,13 @@ class SeleniumTestCaseBase(unittest.TestCase):
|
|||||||
Wait(self.driver, timeout=timeout).until(is_clickable, msg)
|
Wait(self.driver, timeout=timeout).until(is_clickable, msg)
|
||||||
return self.find(selector)
|
return self.find(selector)
|
||||||
|
|
||||||
|
def wait_until_element_clickable(self, finder, timeout=Wait._TIMEOUT):
|
||||||
|
""" Wait until element is clickable """
|
||||||
|
is_clickable = lambda driver: (finder(driver).is_displayed() and finder(driver).is_enabled())
|
||||||
|
msg = 'A matching element never became be clickable'
|
||||||
|
Wait(self.driver, timeout=timeout).until(is_clickable, msg)
|
||||||
|
return finder(self.driver)
|
||||||
|
|
||||||
def wait_until_focused(self, selector):
|
def wait_until_focused(self, selector):
|
||||||
""" Wait until element matching CSS selector has focus """
|
""" Wait until element matching CSS selector has focus """
|
||||||
is_focused = \
|
is_focused = \
|
||||||
|
|||||||
Reference in New Issue
Block a user