def __init__(self, selector='', context=None, web_element=None, timeout=_context_timeout): self._driver = get_driver() self._selector = selector self._timeout = timeout self._context = context if context is not None else get_driver() self._we = web_element or self._find_element_by_selector( selector, self._context)
def scroll_to_bottom(self): drv = get_driver() drv.execute_script("window.scrollTo(0,document.body.scrollHeight);")
def click(self): get_driver().implicitly_wait(3) self._we.click()
def get_current_url(self): return get_driver().current_url
def tearDownClass(cls): driver = get_driver() driver.close()
def navigate_to(self, name): print(f'------- Navigating to "{name}"') get_driver().get(name)