Added application_port_for_selenium to webrat configuration. The use case is when you want to test through a web server sitting in front of your application server.
This commit is contained in:
parent
0387d9eacc
commit
d9d9cc1fcc
@ -1,3 +1,7 @@
|
|||||||
|
* Minor enhancements
|
||||||
|
|
||||||
|
* Added application_port_for_selenium to webrat configuration. The use case is when you want to test through a web server sitting in front of your application server. (Luke Melia)
|
||||||
|
|
||||||
== 0.7.0 / 2010-01-17
|
== 0.7.0 / 2010-01-17
|
||||||
|
|
||||||
* Major enhancements
|
* Major enhancements
|
||||||
|
@ -40,6 +40,13 @@ module Webrat
|
|||||||
webrat_deprecate :selenium_port, :application_port
|
webrat_deprecate :selenium_port, :application_port
|
||||||
webrat_deprecate :selenium_port=, :application_port=
|
webrat_deprecate :selenium_port=, :application_port=
|
||||||
|
|
||||||
|
# Which port should selenium use to access the application. Defaults to application_port
|
||||||
|
attr_writer :application_port_for_selenium
|
||||||
|
|
||||||
|
def application_port_for_selenium
|
||||||
|
@application_port_for_selenium || self.application_port
|
||||||
|
end
|
||||||
|
|
||||||
# Which underlying app framework we're testing with selenium
|
# Which underlying app framework we're testing with selenium
|
||||||
attr_accessor :application_framework
|
attr_accessor :application_framework
|
||||||
|
|
||||||
@ -76,7 +83,7 @@ module Webrat
|
|||||||
tmp_dir = Pathname.new(Dir.pwd).join("tmp")
|
tmp_dir = Pathname.new(Dir.pwd).join("tmp")
|
||||||
self.saved_pages_dir = tmp_dir.exist? ? tmp_dir : Dir.pwd
|
self.saved_pages_dir = tmp_dir.exist? ? tmp_dir : Dir.pwd
|
||||||
end
|
end
|
||||||
|
|
||||||
def open_error_files? #:nodoc:
|
def open_error_files? #:nodoc:
|
||||||
@open_error_files ? true : false
|
@open_error_files ? true : false
|
||||||
end
|
end
|
||||||
|
@ -232,7 +232,7 @@ EOS
|
|||||||
|
|
||||||
def create_browser
|
def create_browser
|
||||||
$browser = ::Selenium::Client::Driver.new(Webrat.configuration.selenium_server_address || "localhost",
|
$browser = ::Selenium::Client::Driver.new(Webrat.configuration.selenium_server_address || "localhost",
|
||||||
Webrat.configuration.selenium_server_port, Webrat.configuration.selenium_browser_key, "http://#{Webrat.configuration.application_address}:#{Webrat.configuration.application_port}")
|
Webrat.configuration.selenium_server_port, Webrat.configuration.selenium_browser_key, "http://#{Webrat.configuration.application_address}:#{Webrat.configuration.application_port_for_selenium}")
|
||||||
$browser.set_speed(0) unless Webrat.configuration.selenium_server_address
|
$browser.set_speed(0) unless Webrat.configuration.selenium_server_address
|
||||||
|
|
||||||
at_exit do
|
at_exit do
|
||||||
|
Loading…
Reference in New Issue
Block a user