Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Hack gem to ignore host and configure port via Java system property

  • Loading branch information...
commit fdf2ede6ed3767e8413870d0ccd1d66c110dffbe 1 parent b34ad83
Martin Kleppmann authored
View
4 lib/selenium/client/base.rb
@@ -48,8 +48,8 @@ module Base
def initialize(*args)
if args[0].kind_of?(Hash)
options = args[0]
- @host = options[:host]
- @port = options[:port].to_i
+ @host = 'localhost' # options[:host]
+ @port = java.lang.System.getProperty('selenium.client.port').to_i # options[:port].to_i
@browser_string = options[:browser]
@browser_url = options[:url]
@default_timeout_in_seconds = (options[:timeout_in_seconds] || 300).to_i
View
24 test/unit/selenium/client/base_tests.rb
@@ -2,23 +2,23 @@
unit_tests do
- test "Hash initializer sets the host" do
+ test "Hash initializer ignores the host" do
client_class = Class.new { include Selenium::Client::Base }
client = client_class.new :host => "the.host.com"
- assert_equal "the.host.com", client.host
+ assert_equal "localhost", client.host
end
- test "Hash initializer sets the port" do
- client_class = Class.new { include Selenium::Client::Base }
- client = client_class.new :port => 4000
- assert_equal 4000, client.port
- end
+# test "Hash initializer sets the port" do
+# client_class = Class.new { include Selenium::Client::Base }
+# client = client_class.new :port => 4000
+# assert_equal 4000, client.port
+# end
- test "Hash initializer port can be specified as a string" do
- client_class = Class.new { include Selenium::Client::Base }
- client = client_class.new :port => "4000"
- assert_equal 4000, client.port
- end
+# test "Hash initializer port can be specified as a string" do
+# client_class = Class.new { include Selenium::Client::Base }
+# client = client_class.new :port => "4000"
+# assert_equal 4000, client.port
+# end
test "Hash initializer sets the browser string" do
client_class = Class.new { include Selenium::Client::Base }
Please sign in to comment.
Something went wrong with that request. Please try again.