teamcapybara--capybara/lib/capybara/node/document.rb

30 lines
534 B
Ruby
Raw Normal View History

module Capybara
module Node
##
#
# A {Capybara::Document} represents an HTML document. Any operation
# performed on it will be performed on the entire document.
#
# @see Capybara::Node
#
class Document < Base
def inspect
%(#<Capybara::Document>)
end
2011-02-10 16:15:28 +00:00
##
#
# @return [String] The text of the document
#
2013-02-17 14:28:28 +00:00
def text(type=nil)
find(:xpath, '/html').text(type)
2011-02-10 16:15:28 +00:00
end
2013-02-17 14:28:28 +00:00
def title
session.driver.title
end
end
end
end