File tree Expand file tree Collapse file tree
spec/unit/selenium/webdriver Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ class Service < WebDriver::Service
3232
3333 private
3434
35- # NOTE: This processing is deprecated
3635 def extract_service_args ( driver_opts )
3736 driver_args = super
3837 driver_opts = driver_opts . dup
Original file line number Diff line number Diff line change @@ -90,6 +90,9 @@ def shutdown_supported
9090 protected
9191
9292 def extract_service_args ( driver_opts )
93+ WebDriver . logger . deprecate ( "initializing Service class with :args using Hash" ,
94+ ":args parameter with an Array of String values" ,
95+ id : :driver_opts )
9396 driver_opts . key? ( :args ) ? driver_opts . delete ( :args ) : [ ]
9497 end
9598
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ class Service < WebDriver::Service
3232
3333 private
3434
35- # NOTE: This processing is deprecated
3635 def extract_service_args ( driver_opts )
3736 driver_args = super
3837 driver_opts = driver_opts . dup
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ class Service < WebDriver::Service
3232
3333 private
3434
35- # NOTE: This processing is deprecated
3635 def extract_service_args ( driver_opts )
3736 driver_args = super
3837 driver_opts = driver_opts . dup
Original file line number Diff line number Diff line change @@ -88,14 +88,15 @@ module WebDriver
8888 expect ( service . extra_args ) . to eq [ '--foo' , '--bar' ]
8989 end
9090
91- # This is deprecated behavior
9291 it 'uses args when passed in as a Hash' do
9392 allow ( Platform ) . to receive ( :find_binary ) . and_return ( service_path )
9493
95- service = Service . chrome ( args : { log_path : '/path/to/log' ,
96- verbose : true } )
94+ expect {
95+ service = Service . chrome ( args : { log_path : '/path/to/log' ,
96+ verbose : true } )
9797
98- expect ( service . extra_args ) . to eq [ '--log-path=/path/to/log' , '--verbose' ]
98+ expect ( service . extra_args ) . to eq [ '--log-path=/path/to/log' , '--verbose' ]
99+ } . to have_deprecated ( :driver_opts )
99100 end
100101 end
101102
Original file line number Diff line number Diff line change @@ -95,10 +95,12 @@ module WebDriver
9595 it 'uses args when passed in as a Hash' do
9696 allow ( Platform ) . to receive ( :find_binary ) . and_return ( service_path )
9797
98- service = Service . edge ( args : { log_path : '/path/to/log' ,
99- verbose : true } )
98+ expect {
99+ service = Service . edge ( args : { log_path : '/path/to/log' ,
100+ verbose : true } )
100101
101- expect ( service . extra_args ) . to eq [ '--log-path=/path/to/log' , '--verbose' ]
102+ expect ( service . extra_args ) . to eq [ '--log-path=/path/to/log' , '--verbose' ]
103+ } . to have_deprecated ( :driver_opts )
102104 end
103105 end
104106
Original file line number Diff line number Diff line change @@ -84,14 +84,15 @@ module WebDriver
8484 expect ( service . extra_args ) . to eq [ '--foo' , '--bar' ]
8585 end
8686
87- # This is deprecated behavior
8887 it 'uses args when passed in as a Hash' do
8988 allow ( Platform ) . to receive ( :find_binary ) . and_return ( service_path )
9089
91- service = Service . firefox ( args : { log : '/path/to/log' ,
92- marionette_port : 4 } )
90+ expect {
91+ service = Service . firefox ( args : { log : '/path/to/log' ,
92+ marionette_port : 4 } )
9393
94- expect ( service . extra_args ) . to eq [ '--log=/path/to/log' , '--marionette-port=4' ]
94+ expect ( service . extra_args ) . to eq [ '--log=/path/to/log' , '--marionette-port=4' ]
95+ } . to have_deprecated ( :driver_opts )
9596 end
9697 end
9798
Original file line number Diff line number Diff line change @@ -89,10 +89,12 @@ module WebDriver
8989 it 'uses args when passed in as a Hash' do
9090 allow ( Platform ) . to receive ( :find_binary ) . and_return ( service_path )
9191
92- service = Service . ie ( args : { log_file : '/path/to/log' ,
93- silent : true } )
92+ expect {
93+ service = Service . ie ( args : { log_file : '/path/to/log' ,
94+ silent : true } )
9495
95- expect ( service . extra_args ) . to eq [ '--log-file=/path/to/log' , '--silent' ]
96+ expect ( service . extra_args ) . to eq [ '--log-file=/path/to/log' , '--silent' ]
97+ } . to have_deprecated ( :driver_opts )
9698 end
9799 end
98100
You can’t perform that action at this time.
0 commit comments