class Capybara::Node::Base

def catch_error?(error, errors = nil)

def catch_error?(error, errors = nil)
  errors ||= (driver.invalid_element_errors + [Capybara::ElementNotFound])
  errors.any? { |type| error.is_a?(type) }
end

def driver

def driver
  session.driver
end

def find_css(css)

Other tags:
    Api: - private
def find_css(css)
  base.find_css(css)
end

def find_xpath(xpath)

Other tags:
    Api: - private
def find_xpath(xpath)
  base.find_xpath(xpath)
end

def initialize(session, base)

def initialize(session, base)
  @session = session
  @base = base
end

def reload

overridden in subclasses, e.g. Capybara::Node::Element
def reload
  self
end

def session_options

Other tags:
    Api: - private
def session_options
  session.config
end

def synchronize(seconds = session_options.default_max_wait_time, errors: nil)

Raises:
  • (Capybara::FrozenInTime) - If the return value of `Time.now` appears stuck

Returns:
  • (Object) - The result of the given block

Parameters:
  • errors (Array) -- (driver.invalid_element_errors +
  • seconds (Integer) -- (current sessions default_max_wait_time) Maximum number of seconds to retry this block
def synchronize(seconds = session_options.default_max_wait_time, errors: nil)
  if session.synchronized
    yield
  else
    session.synchronized = true
    start_time = Capybara::Helpers.monotonic_time
    begin
      yield
    rescue => e
      session.raise_server_error!
      raise e unless driver.wait? && catch_error?(e, errors)
      raise e if (Capybara::Helpers.monotonic_time - start_time) >= seconds
      sleep(0.05)
      raise Capybara::FrozenInTime, "time appears to be frozen, Capybara does not work with libraries which freeze time, consider using time travelling instead" if Capybara::Helpers.monotonic_time == start_time
      reload if session_options.automatic_reload
      retry
    ensure
      session.synchronized = false
    end
  end
end

def to_capybara_node

def to_capybara_node
  self
end