Class: Capybara::UI::Document
- Inherits:
-
Object
- Object
- Capybara::UI::Document
- Includes:
- WidgetParts::Container
- Defined in:
- lib/capybara/ui/widgets/document.rb
Constant Summary
Constants included from Capybara::UI
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(widget_lookup_scope) ⇒ Document
constructor
A new instance of Document.
- #root ⇒ Object
Methods included from WidgetParts::Container
#has_widget?, #not_visible?, #visible?, #widget, #widgets
Methods included from Capybara::UI
Methods included from Constructors
Constructor Details
#initialize(widget_lookup_scope) ⇒ Document
Returns a new instance of Document.
6 7 8 |
# File 'lib/capybara/ui/widgets/document.rb', line 6 def initialize() self. = or raise 'No scope given' end |
Instance Method Details
#body ⇒ Object
14 15 16 17 18 |
# File 'lib/capybara/ui/widgets/document.rb', line 14 def body xml = Nokogiri::HTML(Capybara.page.body).to_xml Nokogiri::XML(xml, &:noblanks).to_xhtml end |