File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
lib/selenium/webdriver/chrome
spec/unit/selenium/webdriver/chrome Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ def create_capabilities(opts)
103
103
end
104
104
105
105
options = options . as_json
106
- caps . merge! ( options ) unless options . empty?
106
+ caps . merge! ( options ) unless options [ Options :: KEY ] . empty?
107
107
108
108
caps [ :proxy ] = opts . delete ( :proxy ) if opts . key? ( :proxy )
109
109
caps [ :proxy ] ||= opts . delete ( 'proxy' ) if opts . key? ( 'proxy' )
Original file line number Diff line number Diff line change @@ -54,7 +54,6 @@ module Chrome
54
54
it 'does not set the chrome.detach capability by default' do
55
55
Driver . new ( http_client : http )
56
56
57
- expect ( caps [ 'goog:chromeOptions' ] ) . to eq ( { } )
58
57
expect ( caps [ 'chrome.detach' ] ) . to be nil
59
58
end
60
59
@@ -111,6 +110,17 @@ module Chrome
111
110
Driver . new ( http_client : http , desired_capabilities : custom_caps , args : %w[ baz ] )
112
111
end
113
112
113
+ it 'does not merge empty options' do
114
+ custom_caps = Remote ::Capabilities . new ( 'goog:chromeOptions' => { args : %w[ foo bar ] } )
115
+
116
+ expect ( http ) . to receive ( :call ) do |_ , _ , payload |
117
+ expect ( payload [ :desiredCapabilities ] [ 'goog:chromeOptions' ] [ :args ] ) . to eq ( %w[ foo bar ] )
118
+ resp
119
+ end
120
+
121
+ Driver . new ( http_client : http , desired_capabilities : custom_caps )
122
+ end
123
+
114
124
it 'handshakes protocol' do
115
125
expect ( Remote ::Bridge ) . to receive ( :handshake )
116
126
Driver . new ( http_client : http )
You can’t perform that action at this time.
0 commit comments