[#242 state:resolved]

allowed changing the default timeout for browser startup in selenium
This commit is contained in:
mike.gaffney 2009-05-18 16:37:45 -05:00
parent c6fd28d37a
commit fd431f2ce8
4 changed files with 17 additions and 1 deletions

View File

@ -11,6 +11,7 @@
* Filled in tests on click link lh 195 (diabolo) * Filled in tests on click link lh 195 (diabolo)
* Added current_url to selenium session lh 215 (Luke Amdor) * Added current_url to selenium session lh 215 (Luke Amdor)
* Added silence spec to selenium lh 238 (Martin Gamsjaeger aka snusnu) * Added silence spec to selenium lh 238 (Martin Gamsjaeger aka snusnu)
* Added ability to configure the browser startup timeout for selenium lh 242 (Mike Gaffney)
== 0.4.4 / 2009-04-06 == 0.4.4 / 2009-04-06

View File

@ -54,6 +54,9 @@ module Webrat
# Set the key that Selenium uses to determine the browser running. Default *firefox # Set the key that Selenium uses to determine the browser running. Default *firefox
attr_accessor :selenium_browser_key attr_accessor :selenium_browser_key
# Set the timeout for waiting for the browser process to start
attr_accessor :selenium_browser_startup_timeout
# How many redirects to the same URL should be halted as an infinite redirect # How many redirects to the same URL should be halted as an infinite redirect
# loop? Defaults to 10 # loop? Defaults to 10
attr_accessor :infinite_redirect_limit attr_accessor :infinite_redirect_limit
@ -68,6 +71,7 @@ module Webrat
self.selenium_server_port = 4444 self.selenium_server_port = 4444
self.infinite_redirect_limit = 10 self.infinite_redirect_limit = 10
self.selenium_browser_key = '*firefox' self.selenium_browser_key = '*firefox'
self.selenium_browser_startup_timeout = 5
end end
def parse_with_nokogiri? #:nodoc: def parse_with_nokogiri? #:nodoc:

View File

@ -32,7 +32,9 @@ module Webrat
def remote_control def remote_control
return @remote_control if @remote_control return @remote_control if @remote_control
@remote_control = ::Selenium::RemoteControl::RemoteControl.new("0.0.0.0", Webrat.configuration.selenium_server_port, 5) @remote_control = ::Selenium::RemoteControl::RemoteControl.new("0.0.0.0",
Webrat.configuration.selenium_server_port,
Webrat.configuration.selenium_browser_startup_timeout)
@remote_control.jar_file = jar_path @remote_control.jar_file = jar_path
return @remote_control return @remote_control

View File

@ -92,6 +92,15 @@ describe Webrat::Configuration do
it 'should default selenium browser key to *firefox' do it 'should default selenium browser key to *firefox' do
@config.selenium_browser_key.should == '*firefox' @config.selenium_browser_key.should == '*firefox'
end end
it 'should default selenium browser startup timeout to 5 seconds' do
@config.selenium_browser_startup_timeout.should == 5
end
it 'should allow overriding of the browser startup timeout' do
@config.selenium_browser_startup_timeout = 10
@config.selenium_browser_startup_timeout.should == 10
end
end end
end end