Module: Capybara::Selenium::Driver::FirefoxDriver

Defined in:
lib/capybara/selenium/driver_specializations/firefox_driver.rb

Class Method Summary collapse

Class Method Details

.extended(driver) ⇒ Object


6
7
8
9
10
# File 'lib/capybara/selenium/driver_specializations/firefox_driver.rb', line 6

def self.extended(driver)
  driver.extend Capybara::Selenium::Driver::W3CFirefoxDriver if w3c?(driver)
  bridge = driver.send(:bridge)
  bridge.extend Capybara::Selenium::IsDisplayed unless bridge.commands(:is_element_displayed)
end

.w3c?(driver) ⇒ Boolean

Returns:

  • (Boolean)

12
13
14
15
# File 'lib/capybara/selenium/driver_specializations/firefox_driver.rb', line 12

def self.w3c?(driver)
  (defined?(Selenium::WebDriver::VERSION) && (Selenium::WebDriver::VERSION.to_f >= 4)) ||
    driver.browser.capabilities.is_a?(::Selenium::WebDriver::Remote::W3C::Capabilities)
end