This instance was upgraded to Heptapod 0.27.2 on 2021-12-08 at 22:00 UTC+1

Commit 3e5b81fa authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

selenium.wait_could_click_element(), new util

It saves a bit of boilerplate: caller doesn't have
to import `WebDriverWait`
parent 539ade5321f7
......@@ -5,6 +5,7 @@ from selenium.common.exceptions import (
ElementNotVisibleException,
ElementNotInteractableException,
)
from selenium.webdriver.support.ui import WebDriverWait
logger = logging.getLogger(__name__)
......@@ -49,3 +50,7 @@ def could_click_element(selector):
traceback.print_exc()
return False
return try_click_element
def wait_could_click_element(driver, selector, timeout=10):
WebDriverWait(driver, 10).until(could_click_element(selector))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment