Skip to content

Commit 11e851b

Browse files
authored
Merge branch 'trunk' into typing-import-enchencement
2 parents 32eb114 + 4b7d174 commit 11e851b

File tree

10 files changed

+63
-14
lines changed

10 files changed

+63
-14
lines changed

.github/workflows/ci-python.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ jobs:
100100
fail-fast: false
101101
matrix:
102102
include:
103-
- browser: safari
104-
os: macos
105103
- browser: chrome
106104
os: ubuntu
107105
- browser: edge
@@ -116,3 +114,21 @@ jobs:
116114
run: |
117115
bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:common-${{ matrix.browser }}-bidi
118116
bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:test-${{ matrix.browser }}
117+
118+
safari-tests:
119+
name: Browser Tests
120+
needs: build
121+
uses: ./.github/workflows/bazel.yml
122+
strategy:
123+
fail-fast: false
124+
matrix:
125+
include:
126+
- browser: safari
127+
os: macos
128+
with:
129+
name: Integration Tests (${{ matrix.browser }}, ${{ matrix.os }})
130+
browser: ${{ matrix.browser }}
131+
os: ${{ matrix.os }}
132+
cache-key: py-browser-${{ matrix.browser }}
133+
run: |
134+
bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:test-${{ matrix.browser }}

java/src/org/openqa/selenium/remote/RemoteWebDriver.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,12 +1148,16 @@ public WebDriver window(String windowHandleOrName) {
11481148
// simulate search by name
11491149
String original = getWindowHandle();
11501150
for (String handle : getWindowHandles()) {
1151-
switchTo().window(handle);
1152-
if (windowHandleOrName.equals(executeScript("return window.name"))) {
1153-
return RemoteWebDriver.this; // found by name
1151+
try {
1152+
execute(DriverCommand.SWITCH_TO_WINDOW(handle));
1153+
if (windowHandleOrName.equals(executeScript("return window.name"))) {
1154+
return RemoteWebDriver.this; // found by name
1155+
}
1156+
} catch (NoSuchWindowException nswe) {
1157+
// swallow
11541158
}
11551159
}
1156-
switchTo().window(original);
1160+
execute(DriverCommand.SWITCH_TO_WINDOW(original));
11571161
throw nsw;
11581162
}
11591163
}

py/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ attrs==23.2.0
33
certifi==2023.11.17
44
cffi==1.16.0
55
cryptography==42.0.8
6+
secretstorage==3.3.3
67
debugpy==1.8.7
78
filetype==1.2.0
89
h11==0.14.0

py/requirements_lock.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ cryptography==42.0.8 \
208208
# via
209209
# -r py/requirements.txt
210210
# pyopenssl
211+
# secretstorage
211212
debugpy==1.8.7 \
212213
--hash=sha256:11ad72eb9ddb436afb8337891a986302e14944f0f755fd94e90d0d71e9100bba \
213214
--hash=sha256:171899588bcd412151e593bd40d9907133a7622cd6ecdbdb75f89d1551df13c2 \
@@ -288,6 +289,10 @@ jaraco-classes==3.3.0 \
288289
--hash=sha256:10afa92b6743f25c0cf5f37c6bb6e18e2c5bb84a16527ccfc0040ea377e7aaeb \
289290
--hash=sha256:c063dd08e89217cee02c8d5e5ec560f2c8ce6cdc2fcdc2e68f7b2e5547ed3621
290291
# via keyring
292+
jeepney==0.8.0 \
293+
--hash=sha256:5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806 \
294+
--hash=sha256:c0a454ad016ca575060802ee4d590dd912e35c122fa04e70306de3d076cce755
295+
# via secretstorage
291296
keyring==24.3.0 \
292297
--hash=sha256:4446d35d636e6a10b8bce7caa66913dd9eca5fd222ca03a3d42c38608ac30836 \
293298
--hash=sha256:e730ecffd309658a08ee82535a3b5ec4b4c8669a9be11efb66249d8e0aeb9a25
@@ -512,6 +517,10 @@ rich==13.7.0 \
512517
--hash=sha256:5cb5123b5cf9ee70584244246816e9114227e0b98ad9176eede6ad54bf5403fa \
513518
--hash=sha256:6da14c108c4866ee9520bbffa71f6fe3962e193b7da68720583850cd4548e235
514519
# via twine
520+
secretstorage==3.3.3 \
521+
--hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \
522+
--hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99
523+
# via -r py/requirements.txt
515524
sniffio==1.3.1 \
516525
--hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \
517526
--hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc

py/selenium/webdriver/remote/webdriver.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,12 @@ def start_devtools(self):
10571057
raise WebDriverException("Unable to find url to connect to from capabilities")
10581058

10591059
devtools = cdp.import_devtools(version)
1060+
if self.caps["browserName"].lower() == "firefox":
1061+
warnings.warn(
1062+
"CDP support for Firefox is deprecated and will be removed in future versions. Please switch to WebDriver BiDi.",
1063+
DeprecationWarning,
1064+
stacklevel=2,
1065+
)
10601066
self._websocket_connection = WebSocketConnection(ws_url)
10611067
targets = self._websocket_connection.execute(devtools.target.get_targets())
10621068
target_id = targets[0].target_id

py/test/selenium/webdriver/common/devtools_tests.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,18 @@
2121

2222
@pytest.mark.xfail_safari
2323
def test_check_console_messages(driver, pages):
24-
devtools, connection = driver.start_devtools()
24+
with pytest.warns(None) as record:
25+
devtools, connection = driver.start_devtools()
2526
console_api_calls = []
2627

28+
if driver.caps["browserName"].lower() == "firefox":
29+
assert (
30+
record[0].message.args[0]
31+
== "CDP support for Firefox is deprecated and will be removed in future versions. Please switch to WebDriver BiDi."
32+
)
33+
else:
34+
assert len(record) == 0
35+
2736
connection.execute(devtools.runtime.enable())
2837
connection.on(devtools.runtime.ConsoleAPICalled, console_api_calls.append)
2938
driver.execute_script("console.log('I love cheese')")

py/test/selenium/webdriver/firefox/firefox_service_tests.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ def test_log_output_as_filename() -> None:
2727
log_file = "geckodriver.log"
2828
service = Service(log_output=log_file)
2929
try:
30-
driver = Firefox(service=service)
30+
with pytest.warns(None) as record:
31+
driver = Firefox(service=service)
32+
assert len(record) == 0
3133
with open(log_file) as fp:
3234
assert "geckodriver\tINFO\tListening" in fp.readline()
3335
finally:

py/test/selenium/webdriver/remote/remote_firefox_profile_tests.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222

2323
@pytest.fixture
2424
def driver(options):
25-
driver = webdriver.Remote(options=options)
25+
with pytest.warns(None) as record:
26+
driver = webdriver.Remote(options=options)
27+
assert len(record) == 0
2628
yield driver
2729
driver.quit()
2830

rb/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ end
77

88
gem 'curb', '~> 1.0.5', require: false, platforms: %i[mri mingw x64_mingw]
99
gem 'debug', '~> 1.7', require: false, platforms: %i[mri mingw x64_mingw]
10-
gem 'steep', '~> 1.5.0', require: false, platforms: %i[mri mingw x64_mingw]
10+
gem 'steep', '1.5.2', require: false, platforms: %i[mri mingw x64_mingw]

rb/Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ GEM
6767
rb-fsevent (~> 0.10, >= 0.10.3)
6868
rb-inotify (~> 0.9, >= 0.9.10)
6969
logger (1.6.1)
70-
minitest (5.25.1)
70+
minitest (5.25.2)
7171
parallel (1.26.3)
7272
parser (3.3.6.0)
7373
ast (~> 2.4.1)
@@ -137,8 +137,8 @@ GEM
137137
rubocop (~> 1.61)
138138
ruby-progressbar (1.13.0)
139139
rubyzip (2.3.2)
140-
securerandom (0.3.1)
141-
steep (1.5.3)
140+
securerandom (0.3.2)
141+
steep (1.5.2)
142142
activesupport (>= 5.1)
143143
concurrent-ruby (>= 1.1.10)
144144
csv (>= 3.0.9)
@@ -192,7 +192,7 @@ DEPENDENCIES
192192
rubocop-rspec (~> 2.16)
193193
selenium-devtools!
194194
selenium-webdriver!
195-
steep (~> 1.5.0)
195+
steep (= 1.5.2)
196196
webmock (~> 3.5)
197197
webrick (~> 1.7)
198198
yard (~> 0.9.11, >= 0.9.36)

0 commit comments

Comments
 (0)