Class: Capybara::Node::Document

Inherits:
Base
  • Object
show all
Defined in:
lib/capybara/node/document.rb

Overview

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

See Also:

Instance Attribute Summary

Attributes inherited from Base

#base, #session

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Actions

#attach_file, #check, #choose, #click_button, #click_link, #click_link_or_button, #fill_in, #select, #uncheck, #unselect

Methods included from Finders

#all, #find, #find_button, #find_by_id, #find_field, #find_link, #first

Constructor Details

This class inherits a constructor from Capybara::Node::Base

Instance Method Details

#inspectObject



12
13
14
# File 'lib/capybara/node/document.rb', line 12

def inspect
  %(#<Capybara::Document>)
end

#textString

Returns The text of the document

Returns:

  • (String)

    The text of the document



20
21
22
# File 'lib/capybara/node/document.rb', line 20

def text
  find(:xpath, '/html').text
end