def _wait_until(self, condition, error, timeout=None, custom_error=None): timeout = self.get_timeout(timeout) if is_noney(custom_error): error = error.replace('<TIMEOUT>', secs_to_timestr(timeout)) else: error = custom_error self._wait_until_worker(condition, timeout, error)
def _wait_until(self, condition, error, timeout=None, custom_error=None): timeout = self.get_timeout(timeout) if is_noney(custom_error): error = error.replace('<TIMEOUT>', secs_to_timestr(timeout)) else: error = custom_error self._wait_until_worker(condition, timeout, error)
def get_selenium_implicit_wait(self): """Gets the implicit wait value used by Selenium. The value is returned as a human readable string like ``1 second``. See the `Implicit wait` section above for more information. """ return secs_to_timestr(self.ctx.implicit_wait)
def get_selenium_timeout(self): """Gets the timeout that is used by various keywords. The value is returned as a human readable string like ``1 second``. See the `Timeout` section above for more information. """ return secs_to_timestr(self.ctx.timeout)
def get_selenium_speed(self): """Gets the delay that is waited after each Selenium command. The value is returned as a human readable string like ``1 second``. See the `Selenium Speed` section above for more information. """ return secs_to_timestr(self.ctx.speed)
def _wait_alert(self, timeout=None): timeout = self.get_timeout(timeout) wait = WebDriverWait(self.browser, timeout) try: return wait.until(EC.alert_is_present()) except WebDriverException: raise AssertionError('Alert not found in %s.' % secs_to_timestr(timeout))
def get_selenium_speed(self): """Gets the delay that is waited after each Selenium command. The value is returned as a human-readable string like ``1 second``. See the `Selenium Speed` section above for more information. """ return secs_to_timestr(self.ctx.speed)
def _wait_alert(self, timeout=None): timeout = self.get_timeout(timeout) wait = WebDriverWait(self.browser, timeout) try: return wait.until(EC.alert_is_present()) except WebDriverException: raise AssertionError('Alert not found in %s.' % secs_to_timestr(timeout))
def get_selenium_implicit_wait(self): """Gets the implicit wait value used by Selenium. The value is returned as a human-readable string like ``1 second``. See the `Implicit wait` section above for more information. """ return secs_to_timestr(self.ctx.implicit_wait)
def get_selenium_timeout(self): """Gets the timeout that is used by various keywords. The value is returned as a human-readable string like ``1 second``. See the `Timeout` section above for more information. """ return secs_to_timestr(self.ctx.timeout)
def _wait_alert(self, timeout=None): timeout = self.get_timeout(timeout) wait = WebDriverWait(self.driver, timeout) try: return wait.until(EC.alert_is_present()) except TimeoutException: raise AssertionError("Alert not found in %s." % secs_to_timestr(timeout)) except WebDriverException as err: raise AssertionError("An exception occurred waiting for alert: %s" % err)
def _format_timeout(self, timeout): return secs_to_timestr(self.get_timeout(timeout))
def get_selenium_implicit_wait(self): """Gets the wait in seconds that is waited by Selenium. See `Set Selenium Implicit Wait` for an explanation. """ return secs_to_timestr(self.ctx.implicit_wait)
def get_selenium_timeout(self): """Gets the timeout in seconds that is used by various keywords. See `Set Selenium Timeout` for an explanation. """ return secs_to_timestr(self.ctx.timeout)
def get_selenium_speed(self): """Gets the delay in seconds that is waited after each Selenium command. See `Set Selenium Speed` for an explanation. """ return secs_to_timestr(self.ctx.speed)
def _format_timeout(self, timeout): return secs_to_timestr(self.get_timeout(timeout))
def _format_timeout(self, timeout): timeout = timestr_to_secs(timeout) if is_truthy( timeout) else self.ctx.timeout return secs_to_timestr(timeout)