mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00

It failed if the default selector was css, and failed with selenium with xpath. Calling find('.') or find('/') in selenium returns a element that causes errors. It now calls find(:xpath, '/html') which seems to work everywhere.
25 lines
462 B
Ruby
25 lines
462 B
Ruby
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
|
|
|
|
##
|
|
#
|
|
# @return [String] The text of the document
|
|
#
|
|
def text
|
|
find(:xpath, '/html').text
|
|
end
|
|
end
|
|
end
|
|
end
|