Skip to content

Commit

Permalink
Remove deprecated :port Remote::Bridge initialization argument
Browse files Browse the repository at this point in the history
It has been deprecated since 3.3.0.
Use :url instead.
  • Loading branch information
p0deje committed Nov 30, 2017
1 parent 855e48d commit 2b2614f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions rb/lib/selenium/webdriver/remote/bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Bridge
include Atoms
include BridgeHelper

PORT = 4444
COMMANDS = {
new_session: [:post, 'session'.freeze]
}.freeze
Expand Down Expand Up @@ -65,20 +66,15 @@ def self.handshake(**opts)
# Initializes the bridge with the given server URL
# @param [Hash] opts options for the driver
# @option opts [String] :url url for the remote server
# @option opts [Integer] :port port number for the remote server
# @option opts [Object] :http_client an HTTP client instance that implements the same protocol as Http::Default
# @option opts [Capabilities] :desired_capabilities an instance of Remote::Capabilities describing the capabilities you want
# @api private
#

def initialize(opts = {})
opts = opts.dup

WebDriver.logger.deprecate ':port', 'full URL' if opts.key?(:port)
port = opts.delete(:port) || 4444

http_client = opts.delete(:http_client) { Http::Default.new }
url = opts.delete(:url) { "http://#{Platform.localhost}:#{port}/wd/hub" }
url = opts.delete(:url) { "http://#{Platform.localhost}:#{PORT}/wd/hub" }

unless opts.empty?
raise ArgumentError, "unknown option#{'s' if opts.size != 1}: #{opts.inspect}"
Expand Down

0 comments on commit 2b2614f

Please sign in to comment.