Sha256: e94204b25b19c53b981af047d4d119cc2fe069708582d5251045ca6272da1ea4

Contents?: true

Size: 777 Bytes

Versions: 2

Compression:

Stored size: 777 Bytes

Contents

require "selenium/client"
require "selenium/webdriver"

module Sauce
  class Selenium < Selenium::Client::Driver
    def initialize(opts={})
      @config = Sauce::Config.new(opts)
      super(opts.merge({:host => @config.host, :port => @config.port,
           :browser => @config.to_browser_string, :url => @config.browser_url}))
    end
  end

  class Selenium2
    def initialize(opts={})
      @config = Sauce::Config.new(opts)
      @driver = ::Selenium::WebDriver.for(:remote, :url => "http://#{@config.username}:#{@config.access_key}@#{@config.host}:#{@config.port}/wd/hub", :desired_capabilities => @config.to_desired_capabilities)
    end

    def method_missing(meth, *args)
      @driver.send(meth, *args)
    end

    def stop
      @driver.quit
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sauce-0.16.2 lib/sauce/selenium.rb
sauce-0.16.1 lib/sauce/selenium.rb