Skip to content

Commit ee4b910

Browse files
committed
[rb] can toggle deprecation notice based on Remote::Driver instead of passing in the class
1 parent 1e38079 commit ee4b910

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

rb/lib/selenium/webdriver/chrome/driver.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def process_options(options, capabilities)
5353
options = Options.new
5454
end
5555

56-
super(options, capabilities, Options)
56+
super(options, capabilities)
5757
end
5858
end # Driver
5959
end # Chrome

rb/lib/selenium/webdriver/common/driver.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -314,19 +314,19 @@ def create_bridge(caps:, url:, http_client: nil)
314314
end
315315
end
316316

317-
def process_options(options, capabilities, klass = nil)
317+
def process_options(options, capabilities)
318318
if options && capabilities
319319
msg = "Don't use both :options and :capabilities when initializing #{self.class}, prefer :options"
320320
raise ArgumentError, msg
321321
end
322322

323-
options ? options.as_json : deprecate_capabilities(capabilities, klass)
323+
options ? options.as_json : deprecate_capabilities(capabilities)
324324
end
325325

326-
def deprecate_capabilities(capabilities, klass)
327-
if klass
326+
def deprecate_capabilities(capabilities)
327+
unless is_a?(Remote::Driver)
328328
WebDriver.logger.deprecate("The :capabilities parameter for #{self.class}",
329-
":options argument with an instance of #{klass}",
329+
":options argument with an instance of #{self.class}",
330330
id: :capabilities)
331331
end
332332
generate_capabilities(capabilities)

rb/lib/selenium/webdriver/edge/driver.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def process_options(options, capabilities)
5353
options = Options.new
5454
end
5555

56-
super(options, capabilities, Options)
56+
super(options, capabilities)
5757
end
5858
end # Driver
5959
end # Edge

rb/lib/selenium/webdriver/firefox/driver.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def process_options(options, capabilities)
7272
options = Options.new
7373
end
7474

75-
super(options, capabilities, Options)
75+
super(options, capabilities)
7676
end
7777
end # Driver
7878
end # Firefox

rb/lib/selenium/webdriver/ie/driver.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def process_options(options, capabilities)
5050
options = Options.new
5151
end
5252

53-
super(options, capabilities, Options)
53+
super(options, capabilities)
5454
end
5555
end # Driver
5656
end # IE

rb/lib/selenium/webdriver/safari/driver.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def process_options(options, capabilities)
5151
options = Options.new
5252
end
5353

54-
super(options, capabilities, Options)
54+
super(options, capabilities)
5555
end
5656
end # Driver
5757
end # Safari

0 commit comments

Comments
 (0)