File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
lib/selenium/webdriver/remote/w3c
spec/unit/selenium/webdriver/remote/w3c Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -249,6 +249,9 @@ def as_json(*)
249
249
if value
250
250
hash [ 'proxy' ] = value . as_json
251
251
hash [ 'proxy' ] [ 'proxyType' ] &&= hash [ 'proxy' ] [ 'proxyType' ] . downcase
252
+ if hash [ 'proxy' ] [ 'noProxy' ] . is_a? ( String )
253
+ hash [ 'proxy' ] [ 'noProxy' ] = hash [ 'proxy' ] [ 'noProxy' ] . split ( ', ' )
254
+ end
252
255
end
253
256
when String , :firefox_binary
254
257
hash [ key . to_s ] = value
Original file line number Diff line number Diff line change @@ -27,6 +27,18 @@ module W3C
27
27
caps = described_class . new ( proxy : proxy )
28
28
expect ( caps . as_json [ 'proxy' ] [ 'proxyType' ] ) . to eq ( 'manual' )
29
29
end
30
+
31
+ it 'converts noProxy from string to array' do
32
+ proxy = Selenium ::WebDriver ::Proxy . new ( no_proxy : 'proxy_url, localhost' )
33
+ caps = described_class . new ( proxy : proxy )
34
+ expect ( caps . as_json [ 'proxy' ] [ 'noProxy' ] ) . to eq ( [ 'proxy_url' , 'localhost' ] )
35
+ end
36
+
37
+ it 'does not convert noProxy if it is already array' do
38
+ proxy = Selenium ::WebDriver ::Proxy . new ( no_proxy : [ 'proxy_url' ] )
39
+ caps = described_class . new ( proxy : proxy )
40
+ expect ( caps . as_json [ 'proxy' ] [ 'noProxy' ] ) . to eq ( [ 'proxy_url' ] )
41
+ end
30
42
end
31
43
end # W3C
32
44
end # Remote
You can’t perform that action at this time.
0 commit comments