Skip to content

Commit

Permalink
Lowercase proxy type for W3C payload
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Aug 31, 2017
1 parent db40117 commit 91be330
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rb/lib/selenium/webdriver/remote/w3c/capabilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,10 @@ def as_json(*)
when :platform
hash['platform'] = value.to_s.upcase
when :proxy
hash['proxy'] = value.as_json if value
if value
hash['proxy'] = value.as_json
hash['proxy']['proxyType'] &&= hash['proxy']['proxyType'].downcase
end
when String, :firefox_binary
hash[key.to_s] = value
when Symbol
Expand Down
36 changes: 36 additions & 0 deletions rb/spec/unit/selenium/webdriver/remote/w3c/capabilities_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# encoding: utf-8
#
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

require File.expand_path('../../../spec_helper', __FILE__)

module Selenium
module WebDriver
module Remote
module W3C
describe Capabilities do
it 'lower cases proxy' do
proxy = Selenium::WebDriver::Proxy.new(http: 'proxy_url')
caps = described_class.new(proxy: proxy)
expect(caps.as_json['proxy']['proxyType']).to eq('manual')
end
end
end # W3C
end # Remote
end # WebDriver
end # Selenium

0 comments on commit 91be330

Please sign in to comment.