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

37 lines
693 B
Ruby
Raw Normal View History

2016-03-08 00:52:19 +00:00
# frozen_string_literal: true
2018-01-08 20:23:54 +00:00
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
include Capybara::Node::DocumentMatchers
def inspect
%(#<Capybara::Document>)
end
2011-02-10 16:15:28 +00:00
##
#
# @return [String] The text of the document
#
2018-01-09 22:05:50 +00:00
def text(type = nil)
2013-02-17 14:28:28 +00:00
find(:xpath, '/html').text(type)
2011-02-10 16:15:28 +00:00
end
2013-02-17 14:28:28 +00:00
##
#
# @return [String] The title of the document
#
def title
session.driver.title
end
end
end
end