Class: Capybara::Driver::Celerity
- Inherits:
-
Base
- Object
- Base
- Capybara::Driver::Celerity
- Defined in:
- lib/capybara/driver/celerity.rb
Defined Under Namespace
Classes: Node
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#rack_server ⇒ Object
readonly
Returns the value of attribute rack_server.
Instance Method Summary collapse
- #body ⇒ Object
- #browser ⇒ Object
- #current_url ⇒ Object
- #evaluate_script(script) ⇒ Object
- #execute_script(script) ⇒ Object
- #find(selector) ⇒ Object
-
#initialize(app, options = {}) ⇒ Celerity
constructor
A new instance of Celerity.
- #reset! ⇒ Object
- #response_headers ⇒ Object
- #source ⇒ Object
- #status_code ⇒ Object
- #visit(path) ⇒ Object
- #wait? ⇒ Boolean
Constructor Details
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
97 98 99 |
# File 'lib/capybara/driver/celerity.rb', line 97 def app @app end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
97 98 99 |
# File 'lib/capybara/driver/celerity.rb', line 97 def @options end |
#rack_server ⇒ Object (readonly)
Returns the value of attribute rack_server.
97 98 99 |
# File 'lib/capybara/driver/celerity.rb', line 97 def rack_server @rack_server end |
Instance Method Details
#body ⇒ Object
118 119 120 |
# File 'lib/capybara/driver/celerity.rb', line 118 def body browser.document.as_xml end |
#browser ⇒ Object
145 146 147 148 149 150 151 152 |
# File 'lib/capybara/driver/celerity.rb', line 145 def browser unless @_browser require 'celerity' @_browser = ::Celerity::Browser.new() end @_browser end |
#current_url ⇒ Object
110 111 112 |
# File 'lib/capybara/driver/celerity.rb', line 110 def current_url browser.url end |
#evaluate_script(script) ⇒ Object
141 142 143 |
# File 'lib/capybara/driver/celerity.rb', line 141 def evaluate_script(script) browser.execute_script "#{script}" end |
#execute_script(script) ⇒ Object
136 137 138 139 |
# File 'lib/capybara/driver/celerity.rb', line 136 def execute_script(script) browser.execute_script script nil end |
#find(selector) ⇒ Object
130 131 132 |
# File 'lib/capybara/driver/celerity.rb', line 130 def find(selector) browser.elements_by_xpath(selector).map { |node| Node.new(self, node) } end |
#reset! ⇒ Object
154 155 156 |
# File 'lib/capybara/driver/celerity.rb', line 154 def reset! browser. end |
#response_headers ⇒ Object
122 123 124 |
# File 'lib/capybara/driver/celerity.rb', line 122 def response_headers browser.response_headers end |
#source ⇒ Object
114 115 116 |
# File 'lib/capybara/driver/celerity.rb', line 114 def source browser.html end |
#status_code ⇒ Object
126 127 128 |
# File 'lib/capybara/driver/celerity.rb', line 126 def status_code browser.status_code end |
#visit(path) ⇒ Object
106 107 108 |
# File 'lib/capybara/driver/celerity.rb', line 106 def visit(path) browser.goto(url(path)) end |
#wait? ⇒ Boolean
134 |
# File 'lib/capybara/driver/celerity.rb', line 134 def wait?; true; end |