Sha256: ffe5711046c8a9cd259f2473c5cefc3ebede41670f16e3a1e28dd12c05266058
Contents?: true
Size: 1.07 KB
Versions: 1
Compression:
Stored size: 1.07 KB
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) http_client = Selenium::WebDriver::Remote::Http::Default.new http_client.timeout = 300 # Browser launch can take a while @driver = ::Selenium::WebDriver.for(:remote, :url => "http://#{@config.username}:#{@config.access_key}@#{@config.host}:#{@config.port}/wd/hub", :desired_capabilities => @config.to_desired_capabilities, :http_client => http_client) http_client.timeout = 90 # Once the browser is up, commands should time out reasonably 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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sauce-0.17.7 | lib/sauce/selenium.rb |