Module: Spreewald::DriverInfo
- Included in:
- FieldErrorFinder
- Defined in:
- lib/spreewald_support/driver_info.rb
Instance Method Summary collapse
- #browser ⇒ Object
- #javascript_capable? ⇒ Boolean
- #poltergeist_driver? ⇒ Boolean
- #require_selenium! ⇒ Object
- #selenium_driver? ⇒ Boolean
- #webkit_driver? ⇒ Boolean
Instance Method Details
#browser ⇒ Object
20 21 22 |
# File 'lib/spreewald_support/driver_info.rb', line 20 def browser page.driver.browser if page.driver.respond_to?(:browser) end |
#javascript_capable? ⇒ Boolean
4 5 6 |
# File 'lib/spreewald_support/driver_info.rb', line 4 def javascript_capable? selenium_driver? || poltergeist_driver? || webkit_driver? end |
#poltergeist_driver? ⇒ Boolean
12 13 14 |
# File 'lib/spreewald_support/driver_info.rb', line 12 def poltergeist_driver? Object.const_defined?('Capybara::Poltergeist') && .current_session.driver.is_a?(::Poltergeist::Driver) end |
#require_selenium! ⇒ Object
24 25 26 |
# File 'lib/spreewald_support/driver_info.rb', line 24 def require_selenium! raise 'This step only works with Selenium' unless selenium_driver? end |
#selenium_driver? ⇒ Boolean
8 9 10 |
# File 'lib/spreewald_support/driver_info.rb', line 8 def selenium_driver? Object.const_defined?('Capybara::Selenium') && .current_session.driver.is_a?(::Selenium::Driver) end |
#webkit_driver? ⇒ Boolean
16 17 18 |
# File 'lib/spreewald_support/driver_info.rb', line 16 def webkit_driver? Object.const_defined?('Capybara::Webkit') && .current_session.driver.is_a?(::Webkit::Driver) end |