Search element and wait until it is clickable

        :param timeout: max time to wait
        :returns: page element instance
6822
def wait_until_clickable(self, timeout=None):
        
        try:
            self.utils.wait_until_element_clickable(self, timeout)
        except TimeoutException as exception:
            parent_msg = " and parent locator '{}'".format(self.parent) if self.parent else ''
            msg = "Page element of type '%s' with locator %s%s not found or is not clickable after %s seconds"
            timeout = timeout if timeout else self.utils.get_explicitly_wait()
            self.logger.error(msg, type(self).__name__, self.locator, parent_msg, timeout)
            exception.msg += "\n  {}".format(msg % (type(self).__name__, self.locator, parent_msg, timeout))
            raise exception
        return self
1253561
def submit(self, selector, by=By.CSS_SELECTOR):
        
        if page_utils.is_xpath_selector(selector):
            by = By.XPATH
        element = self.wait_for_element_visible(
            selector, by=by, timeout=settings.SMALL_TIMEOUT)
        element.submit()
        self.__demo_mode_pause_if_active()
1232106
def wait_gone(self, timeout=None, raise_error=True):
        
        start_time = time.time()
        if timeout is None or timeout <= 0:
            timeout = self.timeout
        while start_time + timeout > time.time():
            if not self.exists:
                return True
        if not raise_error:
            return False
        raise WDAElementNotDisappearError("element not gone")
184919
def wait(self, timeout=None):
        
        self.__stopped.wait(timeout)
        return self.__stopped.is_set()
54807
def wait_until_loaded(self, timeout=None):
        
        for element in self._get_page_elements():
            if hasattr(element, 'wait') and element.wait:
                from toolium.pageelements.page_element import PageElement
                if isinstance(element, PageElement):
                    # Pageelement and Group
                    element.wait_until_visible(timeout)
                if isinstance(element, PageObject):
                    # PageObject and Group
                    element.wait_until_loaded(timeout)
        return self
1094075
def refresh_while_present(timeout = 30)
      message = "waiting for #{@selector.inspect} to disappear"
      Watir::WaitWithRefresh.refresh_while(browser, timeout, message) { present? }
    end
222394
def should_see_in_seconds(self, text, timeout):
    

    def check_element():
        """Check for an element with the given content."""

        assert contains_content(world.browser, text), \
            "Expected element with the given text."

    wait_for(check_element)(timeout=int(timeout))
389052
def pause_and_wait_for_user(self, timeout=None, prompt_text='Click to resume (WebDriver is paused)'):
        
        timeout = timeout if timeout is not None else self.user_wait_timeout
        # Set the browser state paused
        self.paused = True

        def check_user_ready(driver):
            """Polls for the user to be "ready" (meaning they checked the checkbox) and the driver to be unpaused.
            If the checkbox is not displayed (e.g. user navigates the page), it will re-insert it into the page

            @type driver: WebDriverWrapper
            @param driver: Driver to execute
            @return: True if user is ready, false if not
            """
            if driver.paused:
                if driver.is_user_ready():
                    # User indicated they are ready; free the browser lock
                    driver.paused = False
                    return True
                else:
                    if not driver.is_present(Locator('css', '#webdriver-resume-radio', 'radio to unpause webdriver')):
                        # Display the prompt
                        pause_html = staticreader.read_html_file('webdriverpaused.html')\
                            .replace('\n', '')\
                            .replace('PROMPT_TEXT', prompt_text)
                        webdriver_style = staticreader.read_css_file('webdriverstyle.css').replace('\n', '')


                        # Insert the webdriver style
                        driver.js_executor.execute_template_and_return_result(
                            'injectCssTemplate.js',
                            {'css': webdriver_style})

                        # Insert the paused html
                        driver.js_executor.execute_template_and_return_result(
                            'injectHtmlTemplate.js',
                            {'selector': 'body', 'html': pause_html})
            return False

        self.wait_until(
            lambda: check_user_ready(self),
            timeout=timeout,
            failure_message='Webdriver actions were paused but did not receive the command to continue. '
                            'You must click the on-screen message to resume.'
        )

        # Remove all injected elements
        self.js_executor.execute_template_and_return_result(
            'deleteElementsTemplate.js',
            {'selector': '.webdriver-injected'}
        )
633544
def wait(self, timeout):
        ''''''
        logger.debug('Waiting for %fs', timeout)
        return self._event.wait(timeout)
1263675
async def wait_with_timeout(self, timeout, *matchers):
        
        if timeout is None:
            ev, m = await M_(*matchers)
            return False, ev, m
        else:
            th = self.scheduler.setTimer(timeout)
            try:
                tm = TimerEvent.createMatcher(th)
                ev, m = await M_(*(tuple(matchers) + (tm,)))
                if m is tm:
                    return True, None, None
                else:
                    return False, ev, m
            finally:
                self.scheduler.cancelTimer(th)
1157286
def wait_on_event(event, timeout=None):
    
    if timeout is not None:
        event.wait(timeout)
        return

    if six.PY2:
        # Thanks to a bug in python 2's threading lib, we can't simply call
        # .wait() with no timeout since it would wind up ignoring signals.
        while not event.is_set():
            event.wait(sys.maxint)
    else:
        event.wait()
86725
def click(self):
        
        try:
            self.wait_until_clickable().web_element.click()
        except StaleElementReferenceException:
            # Retry if element has changed
            self.web_element.click()
        return self
922718
def wait(self, timeout=None):
        
        try:
            if timeout:
                gevent.sleep(timeout)
            else:
                while True:
                    gevent.sleep(1000)
        except (KeyboardInterrupt, SystemExit, Exception):
            pass
833728
def wait_until_not(self, condition):
        
        return WebDriverWait(self.driver, self.timeout).until_not(condition)
757902
def wait_until_page_ready(page_object, timeout=WTF_TIMEOUT_MANAGER.NORMAL):
        
        try:
            do_until(lambda: page_object.webdriver.execute_script("return document.readyState").lower()
                     == 'complete', timeout)
        except wait_utils.OperationTimeoutError:
            raise PageUtilOperationTimeoutError(
                "Timeout occurred while waiting for page to be ready.")
1352474
def wait(self, timeout=None, raise_error=True):
        
        return self.get(timeout=timeout, raise_error=raise_error)
1274298
def wait_for_text(self, text, selector="html", by=By.CSS_SELECTOR,
                      timeout=settings.LARGE_TIMEOUT):
        
        if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
            timeout = self.__get_new_timeout(timeout)
        return self.wait_for_text_visible(
            text, selector, by=by, timeout=timeout)