Class: Capybara::Driver::Celerity
- Defined in:
- lib/capybara/driver/celerity_driver.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Node
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#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
- #find(selector) ⇒ Object
-
#initialize(app) ⇒ Celerity
constructor
A new instance of Celerity.
- #response_headers ⇒ Object
- #source ⇒ Object
- #visit(path) ⇒ Object
- #wait? ⇒ Boolean
Methods inherited from Base
Constructor Details
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
82 83 84 |
# File 'lib/capybara/driver/celerity_driver.rb', line 82 def app @app end |
#rack_server ⇒ Object (readonly)
Returns the value of attribute rack_server.
82 83 84 |
# File 'lib/capybara/driver/celerity_driver.rb', line 82 def rack_server @rack_server end |
Instance Method Details
#body ⇒ Object
102 103 104 |
# File 'lib/capybara/driver/celerity_driver.rb', line 102 def body browser.document.as_xml end |
#browser ⇒ Object
120 121 122 123 124 125 126 127 |
# File 'lib/capybara/driver/celerity_driver.rb', line 120 def browser unless @_browser require 'celerity' @_browser = ::Celerity::Browser.new(:browser => :firefox, :log_level => :off) end @_browser end |
#current_url ⇒ Object
94 95 96 |
# File 'lib/capybara/driver/celerity_driver.rb', line 94 def current_url browser.url end |
#evaluate_script(script) ⇒ Object
116 117 118 |
# File 'lib/capybara/driver/celerity_driver.rb', line 116 def evaluate_script(script) browser.execute_script "#{script}" end |
#find(selector) ⇒ Object
110 111 112 |
# File 'lib/capybara/driver/celerity_driver.rb', line 110 def find(selector) browser.elements_by_xpath(selector).map { |node| Node.new(self, node) } end |
#response_headers ⇒ Object
106 107 108 |
# File 'lib/capybara/driver/celerity_driver.rb', line 106 def response_headers browser.response_headers end |
#source ⇒ Object
98 99 100 |
# File 'lib/capybara/driver/celerity_driver.rb', line 98 def source browser.html end |
#visit(path) ⇒ Object
90 91 92 |
# File 'lib/capybara/driver/celerity_driver.rb', line 90 def visit(path) browser.goto(url(path)) end |
#wait? ⇒ Boolean
114 |
# File 'lib/capybara/driver/celerity_driver.rb', line 114 def wait?; true; end |