class Selenium::WebDriver::Firefox::Bridge

@api private

Public Class Methods

new(opts = {}) click to toggle source
Calls superclass method
# File lib/selenium/webdriver/firefox/bridge.rb, line 8
def initialize(opts = {})
  port        = opts.delete(:port) || DEFAULT_PORT
  profile     = opts.delete(:profile)
  http_client = opts.delete(:http_client)
  proxy       = opts.delete(:proxy)

  caps = opts.delete(:desired_capabilities) do
    Remote::Capabilities.firefox(:native_events => DEFAULT_ENABLE_NATIVE_EVENTS)
  end

  @launcher = create_launcher(port, profile)

  unless opts.empty?
    raise ArgumentError, "unknown option#{'s' if opts.size != 1}: #{opts.inspect}"
  end

  @launcher.launch

  caps.proxy = proxy if proxy

  remote_opts = {
    :url                  => @launcher.url,
    :desired_capabilities => caps
  }

  remote_opts.merge!(:http_client => http_client) if http_client

  begin
    super(remote_opts)
  rescue
    @launcher.quit
    raise
  end
end

Public Instance Methods

browser() click to toggle source
# File lib/selenium/webdriver/firefox/bridge.rb, line 43
def browser
  :firefox
end
driver_extensions() click to toggle source
# File lib/selenium/webdriver/firefox/bridge.rb, line 47
def driver_extensions
  [
    DriverExtensions::TakesScreenshot,
    DriverExtensions::HasInputDevices
  ]
end
quit() click to toggle source
Calls superclass method
# File lib/selenium/webdriver/firefox/bridge.rb, line 54
def quit
  super
  nil
ensure
  @launcher.quit
end

Private Instance Methods

create_launcher(port, profile) click to toggle source
# File lib/selenium/webdriver/firefox/bridge.rb, line 63
def create_launcher(port, profile)
  Launcher.new Binary.new, port, profile
end