A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/seleniumhq/selenium/commit/6f77a1e4630dd37a9a3e30d8fa3fdfff6da8e17e below:

Deprecate non `W3C` capability implicit conversion · SeleniumHQ/selenium@6f77a1e · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+19

-4

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+19

-4

lines changed Original file line number Diff line number Diff line change

@@ -75,7 +75,6 @@

75 75

'platform': 'platformName'

76 76

}

77 77 78 - 79 78

cdp = None

80 79 81 80

@@ -104,7 +103,11 @@ def _make_w3c_caps(caps):

104 103

caps['proxy']['proxyType'] = caps['proxy']['proxyType'].lower()

105 104

for k, v in caps.items():

106 105

if v and k in _OSS_W3C_CONVERSION:

107 -

always_match[_OSS_W3C_CONVERSION[k]] = v.lower() if k == 'platform' else v

106 +

# Todo: Remove in 4.7.0 (Deprecated in 4.5.0)

107 +

w3c_equivalent = _OSS_W3C_CONVERSION[k]

108 +

warnings.warn(f"{k} is not a w3c capability. use `{w3c_equivalent}` instead. This will no longer be"

109 +

f" converted in 4.7.0", DeprecationWarning, stacklevel=2)

110 +

always_match[w3c_equivalent] = v.lower() if k == 'platform' else v

108 111

if k in _W3C_CAPABILITY_NAMES or ':' in k:

109 112

always_match[k] = v

110 113

if profile:

@@ -1191,7 +1194,8 @@ def _get_cdp_details(self):

1191 1194

http = urllib3.PoolManager()

1192 1195

_firefox = False

1193 1196

if self.caps.get("browserName") == "chrome":

1194 -

debugger_address = self.caps.get(f"{self.vendor_prefix}:{self.caps.get('browserName')}Options").get("debuggerAddress")

1197 +

debugger_address = self.caps.get(f"{self.vendor_prefix}:{self.caps.get('browserName')}Options").get(

1198 +

"debuggerAddress")

1195 1199

else:

1196 1200

_firefox = True

1197 1201

debugger_address = self.caps.get("moz:debuggerAddress")

Original file line number Diff line number Diff line change

@@ -22,9 +22,9 @@

22 22

import pytest

23 23 24 24

from selenium.webdriver import DesiredCapabilities

25 +

from selenium.webdriver.remote import webdriver

25 26

from selenium.webdriver.remote.command import Command

26 27

from selenium.webdriver.remote.webdriver import WebDriver

27 -

from selenium.webdriver.remote import webdriver

28 28 29 29 30 30

def test_converts_oss_capabilities_to_w3c(mocker):

@@ -36,6 +36,17 @@ def test_converts_oss_capabilities_to_w3c(mocker):

36 36

mock.assert_called_with(Command.NEW_SESSION, expected_params)

37 37 38 38 39 +

@pytest.mark.parametrize("oss_name, val, w3c_name", (

40 +

('acceptSslCerts', True, 'acceptInsecureCerts'),

41 +

("version", '11', "browserVersion"),

42 +

("platform", 'windows', 'platformName')))

43 +

def test_non_compliant_w3c_caps_is_deprecated(oss_name, val, w3c_name):

44 +

from selenium.webdriver.remote.webdriver import _make_w3c_caps

45 +

msg = f"{oss_name} is not a w3c capability. use `{w3c_name}` instead. This will no longer be converted in 4.7.0"

46 +

with pytest.warns(DeprecationWarning, match=msg):

47 +

_ = _make_w3c_caps({oss_name: val})

48 + 49 + 39 50

def test_converts_proxy_type_value_to_lowercase_for_w3c(mocker):

40 51

mock = mocker.patch('selenium.webdriver.remote.webdriver.WebDriver.execute')

41 52

oss_caps = {'proxy': {'proxyType': 'MANUAL', 'httpProxy': 'foo'}}

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4