adding configuration option to change seleniums environment and port settings
This commit is contained in:
parent
362df8abf0
commit
2c51d90830
|
@ -27,9 +27,17 @@ module Webrat
|
||||||
# Save and open pages with error status codes (500-599) in a browser? Defualts to true.
|
# Save and open pages with error status codes (500-599) in a browser? Defualts to true.
|
||||||
attr_writer :open_error_files
|
attr_writer :open_error_files
|
||||||
|
|
||||||
|
# Which environment should the selenium tests be run in? Defaults to selenium.
|
||||||
|
attr_accessor :selenium_environment
|
||||||
|
|
||||||
|
# Which port should the selenium tests be run on? Defaults to 3001.
|
||||||
|
attr_accessor :selenium_port
|
||||||
|
|
||||||
def initialize # :nodoc:
|
def initialize # :nodoc:
|
||||||
self.open_error_files = true
|
self.open_error_files = true
|
||||||
self.parse_with_nokogiri = !Webrat.on_java?
|
self.parse_with_nokogiri = !Webrat.on_java?
|
||||||
|
self.selenium_environment = :selenium
|
||||||
|
self.selenium_port = 3001
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse_with_nokogiri? #:nodoc:
|
def parse_with_nokogiri? #:nodoc:
|
||||||
|
|
|
@ -26,8 +26,8 @@ module Webrat
|
||||||
|
|
||||||
def self.start_app_server #:nodoc:
|
def self.start_app_server #:nodoc:
|
||||||
pid_file = File.expand_path(RAILS_ROOT + "/tmp/pids/mongrel_selenium.pid")
|
pid_file = File.expand_path(RAILS_ROOT + "/tmp/pids/mongrel_selenium.pid")
|
||||||
system("mongrel_rails start -d --chdir=#{RAILS_ROOT} --port=3001 --environment=selenium --pid #{pid_file} &")
|
system("mongrel_rails start -d --chdir=#{RAILS_ROOT} --port=#{Webrat.configuration.selenium_port.to_s} --environment=#{Webrat.configuration.selenium_environment.to_s} --pid #{pid_file} &")
|
||||||
TCPSocket.wait_for_service :host => "0.0.0.0", :port => 3001
|
TCPSocket.wait_for_service :host => "0.0.0.0", :port => Webrat.configuration.selenium_port.to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.stop_app_server #:nodoc:
|
def self.stop_app_server #:nodoc:
|
||||||
|
|
Loading…
Reference in New Issue