__init__.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:directory-tests 作者: uktrade 项目源码 文件源码
def wait_for_visibility(
        driver: webdriver, *, by_css: str = None,
        by_id: str = None, time_to_wait: int = 5):
    """Wait until element is visible.

    :param driver: Selenium driver
    :param by_css: CSS selector to locate the element to wait for
    :param by_id: ID of the element to wait for
    :param time_to_wait: maximum number of seconds to wait
    """
    assert by_id or by_css, "Provide ID or CSS selector"
    if by_css:
        by_locator = (By.CSS_SELECTOR, by_css)
    else:
        by_locator = (By.ID, by_id)
    WebDriverWait(driver, time_to_wait).until(
        expected_conditions.visibility_of_element_located(by_locator))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号