class Capybara::Node::Document

A {Capybara::Document} represents an HTML document. Any operation performed on it will be performed on the entire document.

@see Capybara::Node

Public Instance Methods

evaluate_script(*args) click to toggle source
# File lib/capybara/node/document.rb, line 39
def evaluate_script(*args)
  find(:xpath, '/html').evaluate_script(*args)
end
execute_script(*args) click to toggle source
# File lib/capybara/node/document.rb, line 35
def execute_script(*args)
  find(:xpath, '/html').execute_script(*args)
end
inspect() click to toggle source
# File lib/capybara/node/document.rb, line 15
def inspect
  %(#<Capybara::Document>)
end
scroll_to(*args, quirks: false, **options) click to toggle source
# File lib/capybara/node/document.rb, line 43
def scroll_to(*args, quirks: false, **options)
  find(:xpath, quirks ? '//body' : '/html').scroll_to(*args, **options)
end
text(type = nil, normalize_ws: false) click to toggle source

@return [String] The text of the document

# File lib/capybara/node/document.rb, line 23
def text(type = nil, normalize_ws: false)
  find(:xpath, '/html').text(type, normalize_ws: normalize_ws)
end
title() click to toggle source

@return [String] The title of the document

# File lib/capybara/node/document.rb, line 31
def title
  session.driver.title
end