Class: Capybara::Driver::Grope
- Inherits:
-
Base
- Object
- Base
- Capybara::Driver::Grope
- Defined in:
- lib/capybara/driver/grope_driver.rb
Defined Under Namespace
Classes: Node
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#grope ⇒ Object
readonly
Returns the value of attribute grope.
-
#rack_server ⇒ Object
readonly
Returns the value of attribute rack_server.
Instance Method Summary collapse
- #body ⇒ Object
- #current_url ⇒ Object
- #evaluate_script(script) ⇒ Object
- #find(selector) ⇒ Object
-
#initialize(app) ⇒ Grope
constructor
A new instance of Grope.
- #response_headers ⇒ Object
- #source ⇒ Object
- #visit(path) ⇒ Object
- #wait? ⇒ Boolean
Constructor Details
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
117 118 119 |
# File 'lib/capybara/driver/grope_driver.rb', line 117 def app @app end |
#grope ⇒ Object (readonly)
Returns the value of attribute grope.
117 118 119 |
# File 'lib/capybara/driver/grope_driver.rb', line 117 def grope @grope end |
#rack_server ⇒ Object (readonly)
Returns the value of attribute rack_server.
117 118 119 |
# File 'lib/capybara/driver/grope_driver.rb', line 117 def rack_server @rack_server end |
Instance Method Details
#body ⇒ Object
139 140 141 |
# File 'lib/capybara/driver/grope_driver.rb', line 139 def body @grope.document.body.outerHTML end |
#current_url ⇒ Object
131 132 133 |
# File 'lib/capybara/driver/grope_driver.rb', line 131 def current_url @grope.document.URL end |
#evaluate_script(script) ⇒ Object
153 154 155 |
# File 'lib/capybara/driver/grope_driver.rb', line 153 def evaluate_script(script) @grope.eval('return %s' % script) end |
#find(selector) ⇒ Object
147 148 149 |
# File 'lib/capybara/driver/grope_driver.rb', line 147 def find(selector) @grope.all(selector).map { |node| Node.new(self, node) } end |
#response_headers ⇒ Object
143 144 145 |
# File 'lib/capybara/driver/grope_driver.rb', line 143 def response_headers response.headers end |
#source ⇒ Object
135 136 137 |
# File 'lib/capybara/driver/grope_driver.rb', line 135 def source @grope.document.documentElement.outerHTML end |
#visit(path) ⇒ Object
126 127 128 129 |
# File 'lib/capybara/driver/grope_driver.rb', line 126 def visit(path) @grope.load(url(path)) @grope.wait end |
#wait? ⇒ Boolean
151 |
# File 'lib/capybara/driver/grope_driver.rb', line 151 def wait?; true; end |