Skip to content

Commit

Permalink
only check for proxyType once
Browse files Browse the repository at this point in the history
  • Loading branch information
lmtierney committed Sep 1, 2017
1 parent e9d3ff1 commit 5e93ba1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions py/selenium/webdriver/remote/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ def _make_w3c_caps(caps):
caps = copy.deepcopy(caps)
profile = caps.get('firefox_profile')
always_match = {}
if caps.get('proxy') and caps['proxy'].get('proxyType'):
caps['proxy']['proxyType'] = caps['proxy']['proxyType'].lower()
for k, v in caps.items():
if v and k in _OSS_W3C_CONVERSION:
always_match[_OSS_W3C_CONVERSION[k]] = v.lower() if k == 'platform' else v
if k in _W3C_CAPABILITY_NAMES or ':' in k:
if k == 'proxy' and v.get('proxyType'):
v['proxyType'] = v['proxyType'].lower()
always_match[k] = v
if profile:
moz_opts = always_match.get('moz:firefoxOptions', {})
Expand Down
4 changes: 2 additions & 2 deletions py/test/unit/selenium/webdriver/remote/test_new_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def test_converts_oss_capabilities_to_w3c(mocker):

def test_converts_proxy_type_value_to_lowercase_for_w3c(mocker):
mock = mocker.patch('selenium.webdriver.remote.webdriver.WebDriver.execute')
oss_caps = {'proxy': {'proxyType': 'MANUAL'}}
w3c_caps = {'proxy': {'proxyType': 'manual'}}
oss_caps = {'proxy': {'proxyType': 'MANUAL', 'httpProxy': 'foo'}}
w3c_caps = {'proxy': {'proxyType': 'manual', 'httpProxy': 'foo'}}
WebDriver(desired_capabilities=deepcopy(oss_caps))
expected_params = {'capabilities': {'firstMatch': [{}], 'alwaysMatch': w3c_caps},
'desiredCapabilities': oss_caps}
Expand Down

0 comments on commit 5e93ba1

Please sign in to comment.