Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow optional timeout setting for selenium HTTP driver for long running test suites #142

Closed
wants to merge 1 commit into from

2 participants

@tgaff

set ENV['JASMINE_HTTP_TIMEOUT'] to use


Our test suite is fairly large and hits the internal selenium http timeout on two of our CI services. This allows setting a new timeout. Defaults to 120.

@tgaff tgaff Allow optional timeout setting for selenium HTTP driver for those of …
…us with long running test suites

set ENV['JASMINE_HTTP_TIMEOUT'] to use
d280c7e
@tgaff

now fixed for ruby 1.8

@jboyens jboyens was assigned
@jboyens
Owner

This one could probably be taking care of along with #127

@jboyens
Owner

You should now have a TON more control over the Selenium pieces by using:

Jasmine.configure do |config|
    config.webdriver = Selenium::Webdriver.for :remote, :url => …
end

You can see this in use (albeit messily at the moment) on Jasmine's own test suite here.

@jboyens jboyens closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 19, 2013
  1. @tgaff

    Allow optional timeout setting for selenium HTTP driver for those of …

    tgaff authored
    …us with long running test suites
    
    set ENV['JASMINE_HTTP_TIMEOUT'] to use
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/jasmine/selenium_driver.rb
View
5 lib/jasmine/selenium_driver.rb
@@ -3,6 +3,8 @@ module Jasmine
class SeleniumDriver
def initialize(browser, http_address)
require 'selenium-webdriver'
+ @http_driver = Selenium::WebDriver::Remote::Http::Default.new
+ @http_driver.timeout = ENV['JASMINE_HTTP_TIMEOUT'] ? ENV['JASMINE_HTTP_TIMEOUT'].to_i : 120
selenium_server = if ENV['SELENIUM_SERVER']
ENV['SELENIUM_SERVER']
elsif ENV['SELENIUM_SERVER_PORT']
@@ -14,8 +16,9 @@ def initialize(browser, http_address)
profile.enable_firebug
{:profile => profile}
end || {}
+ options[:http_client] = @http_driver
@driver = if selenium_server
- Selenium::WebDriver.for :remote, :url => selenium_server, :desired_capabilities => browser.to_sym
+ Selenium::WebDriver.for :remote, :url => selenium_server, :desired_capabilities => browser.to_sym, :http_client => @http_driver
else
Selenium::WebDriver.for browser.to_sym, options
end
Something went wrong with that request. Please try again.