public
Description: Webrat - Ruby Acceptance Testing for Web applications
Homepage: http://gitrdoc.com/brynary/webrat/tree/master/
Clone URL: git://github.com/brynary/webrat.git
adding configuration option to change seleniums environment and port settings
Kieran Pilkington (author)
Sat Dec 27 14:39:34 -0800 2008
commit  2c51d908301e23a8594eda49f0d64ce197b3e842
tree    96e77d36e280c4d356b6222e1c8a1330bf335723
parent  362df8abf0f0930ee95fa0b8a708191afa57578e
...
27
28
29
 
 
 
 
 
 
30
31
32
 
 
33
34
35
...
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
0
@@ -27,9 +27,17 @@ module Webrat
0
     # Save and open pages with error status codes (500-599) in a browser? Defualts to true.
0
     attr_writer :open_error_files
0
     
0
+    # Which environment should the selenium tests be run in? Defaults to selenium.
0
+    attr_accessor :selenium_environment
0
+
0
+    # Which port should the selenium tests be run on? Defaults to 3001.
0
+    attr_accessor :selenium_port
0
+
0
     def initialize # :nodoc:
0
       self.open_error_files = true
0
       self.parse_with_nokogiri = !Webrat.on_java?
0
+      self.selenium_environment = :selenium
0
+      self.selenium_port = 3001
0
     end
0
     
0
     def parse_with_nokogiri? #:nodoc:
...
26
27
28
29
30
 
 
31
32
33
...
26
27
28
 
 
29
30
31
32
33
0
@@ -26,8 +26,8 @@ module Webrat
0
   
0
   def self.start_app_server #:nodoc:
0
     pid_file = File.expand_path(RAILS_ROOT + "/tmp/pids/mongrel_selenium.pid")
0
-    system("mongrel_rails start -d --chdir=#{RAILS_ROOT} --port=3001 --environment=selenium --pid #{pid_file} &")
0
-    TCPSocket.wait_for_service :host => "0.0.0.0", :port => 3001
0
+    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} &")
0
+    TCPSocket.wait_for_service :host => "0.0.0.0", :port => Webrat.configuration.selenium_port.to_i
0
   end
0
   
0
   def self.stop_app_server #:nodoc:

Comments