Sha256: 633562b98df3ee02ad7a108532ad54dff2e8aac117a22462c28da4eb2ec7fdf5

Contents?: true

Size: 844 Bytes

Versions: 9

Compression:

Stored size: 844 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 session_id
      @driver.send(:bridge).session_id
    end

    def stop
      @driver.quit
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sauce-0.17.6 lib/sauce/selenium.rb
sauce-0.17.5 lib/sauce/selenium.rb
sauce-0.17.4 lib/sauce/selenium.rb
sauce-0.17.3 lib/sauce/selenium.rb
sauce-0.17.3.alpha2 lib/sauce/selenium.rb
sauce-0.17.3.alpha1 lib/sauce/selenium.rb
sauce-0.17.2 lib/sauce/selenium.rb
sauce-0.17.1 lib/sauce/selenium.rb
sauce-0.17.0 lib/sauce/selenium.rb