Skip to content

Commit b620c61

Browse files
authored
Merge branch 'trunk' into bugfix/rb_fix_child_process_error
2 parents 1aa51ea + 1b0ab9b commit b620c61

File tree

11 files changed

+212
-86
lines changed

11 files changed

+212
-86
lines changed

MODULE.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,17 @@ use_repo(
370370
pin_browsers_extension = use_extension("//common:repositories.bzl", "pin_browsers_extension")
371371
use_repo(
372372
pin_browsers_extension,
373+
"linux_beta_chrome",
374+
"linux_beta_chromedriver",
373375
"linux_beta_firefox",
374376
"linux_chrome",
375377
"linux_chromedriver",
376378
"linux_edge",
377379
"linux_edgedriver",
378380
"linux_firefox",
379381
"linux_geckodriver",
382+
"mac_beta_chrome",
383+
"mac_beta_chromedriver",
380384
"mac_beta_firefox",
381385
"mac_chrome",
382386
"mac_chromedriver",

common/browsers.bzl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,25 @@ firefox_beta_data = select({
8383
],
8484
"//conditions:default": [],
8585
}) + geckodriver_data
86+
87+
chromedriver_beta_data = select({
88+
"@selenium//common:use_pinned_linux_chrome": [
89+
"@linux_beta_chromedriver//:chromedriver",
90+
],
91+
"@selenium//common:use_pinned_macos_chrome": [
92+
"@mac_beta_chromedriver//:chromedriver",
93+
],
94+
"@selenium//common:use_local_chromedriver": ["@selenium//common:chromedriver"],
95+
"//conditions:default": [],
96+
})
97+
98+
chrome_beta_data = select({
99+
"@selenium//common:use_pinned_linux_chrome": [
100+
"@linux_beta_chrome//:files",
101+
"@linux_beta_chrome//:chrome-linux64/chrome",
102+
],
103+
"@selenium//common:use_pinned_macos_chrome": [
104+
"@mac_beta_chrome//:Chrome.app",
105+
],
106+
"//conditions:default": [],
107+
}) + chromedriver_beta_data

common/repositories.bzl

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ js_library(
218218
)
219219
""",
220220
)
221-
222221
http_archive(
223222
name = "mac_chrome",
224223
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.55/mac-x64/chrome-mac-x64.zip",
@@ -240,7 +239,6 @@ js_library(
240239
)
241240
""",
242241
)
243-
244242
http_archive(
245243
name = "linux_chromedriver",
246244
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.55/linux64/chromedriver-linux64.zip",
@@ -270,6 +268,84 @@ package(default_visibility = ["//visibility:public"])
270268
271269
exports_files(["chromedriver"])
272270
271+
js_library(
272+
name = "chromedriver-js",
273+
data = ["chromedriver"],
274+
)
275+
""",
276+
)
277+
278+
http_archive(
279+
name = "linux_beta_chrome",
280+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.4/linux64/chrome-linux64.zip",
281+
sha256 = "d6ead5a796a19ccdebd603fb626eb66ebaafa82a051f03d3898cffed16d1d513",
282+
build_file_content = """
283+
load("@aspect_rules_js//js:defs.bzl", "js_library")
284+
package(default_visibility = ["//visibility:public"])
285+
286+
filegroup(
287+
name = "files",
288+
srcs = glob(["**/*"]),
289+
)
290+
291+
exports_files(["chrome-linux64/chrome"])
292+
293+
js_library(
294+
name = "chrome-js",
295+
data = [":files"],
296+
)
297+
""",
298+
)
299+
http_archive(
300+
name = "mac_beta_chrome",
301+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.4/mac-x64/chrome-mac-x64.zip",
302+
sha256 = "07c32ddffb7ad10038cde6187891a0ba7eaf65869af38d1709b0384697ccdbfa",
303+
strip_prefix = "chrome-mac-x64",
304+
patch_cmds = [
305+
"mv 'Google Chrome for Testing.app' Chrome.app",
306+
"mv 'Chrome.app/Contents/MacOS/Google Chrome for Testing' Chrome.app/Contents/MacOS/Chrome",
307+
],
308+
build_file_content = """
309+
load("@aspect_rules_js//js:defs.bzl", "js_library")
310+
package(default_visibility = ["//visibility:public"])
311+
312+
exports_files(["Chrome.app"])
313+
314+
js_library(
315+
name = "chrome-js",
316+
data = glob(["Chrome.app/**/*"]),
317+
)
318+
""",
319+
)
320+
http_archive(
321+
name = "linux_beta_chromedriver",
322+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.4/linux64/chromedriver-linux64.zip",
323+
sha256 = "187813f44358a8bfa42bd043eced9481687998ff0f691a46108555574836ad38",
324+
strip_prefix = "chromedriver-linux64",
325+
build_file_content = """
326+
load("@aspect_rules_js//js:defs.bzl", "js_library")
327+
package(default_visibility = ["//visibility:public"])
328+
329+
exports_files(["chromedriver"])
330+
331+
js_library(
332+
name = "chromedriver-js",
333+
data = ["chromedriver"],
334+
)
335+
""",
336+
)
337+
338+
http_archive(
339+
name = "mac_beta_chromedriver",
340+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.4/mac-x64/chromedriver-mac-x64.zip",
341+
sha256 = "9823d0e33d930761a9967dce0403a53dc5b2d3376af46cd3e7f10bc28bfe401d",
342+
strip_prefix = "chromedriver-mac-x64",
343+
build_file_content = """
344+
load("@aspect_rules_js//js:defs.bzl", "js_library")
345+
package(default_visibility = ["//visibility:public"])
346+
347+
exports_files(["chromedriver"])
348+
273349
js_library(
274350
name = "chromedriver-js",
275351
data = ["chromedriver"],

java/test/org/openqa/selenium/edge/EdgeDriverFunctionalTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void canSetPermission() {
116116
@NoDriverBeforeTest
117117
public void canSetPermissionHeadless() {
118118
EdgeOptions options = new EdgeOptions();
119-
options.addArguments("--headless=new");
119+
options.addArguments("--headless");
120120

121121
localDriver = new WebDriverBuilder().get(options);
122122
HasPermissions permissions = (HasPermissions) localDriver;

java/test/org/openqa/selenium/testing/drivers/Browser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public Capabilities getCapabilities() {
5050
}
5151

5252
if (Boolean.getBoolean("webdriver.headless")) {
53-
options.addArguments("--headless=new");
53+
options.addArguments("--headless");
5454
}
5555

5656
options.addArguments(
@@ -84,7 +84,7 @@ public Capabilities getCapabilities() {
8484
}
8585

8686
if (Boolean.getBoolean("webdriver.headless")) {
87-
options.addArguments("--headless=new");
87+
options.addArguments("--headless");
8888
}
8989

9090
options.addArguments(

py/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def get_options(driver_class, config):
229229

230230
if headless:
231231
if driver_class == "Chrome" or driver_class == "Edge":
232-
options.add_argument("--headless=new")
232+
options.add_argument("--headless")
233233
if driver_class == "Firefox":
234234
options.add_argument("-headless")
235235

@@ -393,6 +393,6 @@ def chromium_options(request):
393393
options = webdriver.EdgeOptions()
394394

395395
if request.config.option.headless:
396-
options.add_argument("--headless=new")
396+
options.add_argument("--headless")
397397

398398
return options

py/tox.ini

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,50 @@
11
[tox]
2-
envlist = docs, flake8, isort, validate-pyproject
2+
envlist =
3+
validate
4+
linting
35

4-
[testenv:validate-pyproject]
6+
7+
[testenv:validate]
58
skip_install = true
69
deps =
7-
validate-pyproject==0.24.1
8-
packaging==25.0
10+
validate-pyproject==0.24.1
11+
packaging==25.0
912
commands =
10-
validate-pyproject ./pyproject.toml
13+
validate-pyproject ./pyproject.toml
14+
1115

1216
[testenv:docs]
1317
skip_install = true
1418
deps =
15-
-r {toxinidir}/docs/requirements.txt
16-
-r {toxinidir}/requirements.txt
19+
-r {toxinidir}/docs/requirements.txt
20+
-r {toxinidir}/requirements.txt
1721
commands =
18-
; generate `docs/source/api.rst` with module listing
19-
{envpython} ./generate_api_module_listing.py
20-
; regenerate autodoc stub pages
21-
sphinx-autogen docs/source/api.rst
22-
; build api docs
23-
sphinx-build -b html -d ../build/docs/doctrees docs/source ../build/docs/api/py {posargs}
22+
# generate `docs/source/api.rst` with module listing
23+
{envpython} ./generate_api_module_listing.py
24+
# regenerate autodoc stub pages
25+
sphinx-autogen docs/source/api.rst
26+
# build api docs
27+
sphinx-build -b html -d ../build/docs/doctrees docs/source ../build/docs/api/py {posargs}
2428
setenv =
2529
PYTHONPATH = {toxinidir}/.
2630

31+
2732
[testenv:mypy]
2833
skip_install = true
2934
deps =
30-
mypy==1.15.0
31-
lxml==5.3.2
32-
types-urllib3==1.26.25
33-
types-certifi==2021.10.8.3
34-
trio-typing==0.10.0
35-
commands = mypy --install-types {posargs}
35+
mypy==1.15.0
36+
lxml==5.3.2
37+
types-urllib3==1.26.25
38+
types-certifi==2021.10.8.3
39+
trio-typing==0.10.0
40+
commands =
41+
mypy --install-types {posargs}
42+
3643

3744
[testenv:linting]
3845
skip_install = true
3946
deps =
40-
ruff==0.11.12
47+
ruff==0.11.12
4148
commands =
42-
ruff check --fix --show-fixes --exit-non-zero-on-fix .
43-
ruff format --exit-non-zero-on-format .
49+
ruff check --fix --show-fixes --exit-non-zero-on-fix .
50+
ruff format --exit-non-zero-on-format .

rb/spec/integration/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package(default_visibility = ["//rb/spec/integration:__subpackages__"])
22

33
BROWSERS = [
44
"chrome",
5+
"chrome-beta",
56
"edge",
67
"firefox",
78
"ie",

rb/spec/integration/selenium/webdriver/chrome/BUILD.bazel

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ load("//rb/spec:tests.bzl", "rb_integration_test")
44
rb_integration_test(
55
name = file[:-8],
66
srcs = [file],
7-
browsers = ["chrome"], # No need to run in other browsers.
7+
# No need to run in other browsers.
8+
browsers = [
9+
"chrome",
10+
"chrome-beta",
11+
],
12+
data = ["//common/extensions"],
813
)
914
for file in glob(["*_spec.rb"])
1015
]

rb/spec/tests.bzl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ load("@rules_ruby//ruby:defs.bzl", "rb_library", "rb_test")
22
load(
33
"//common:browsers.bzl",
44
"COMMON_TAGS",
5+
"chrome_beta_data",
56
"chrome_data",
67
"edge_data",
78
"firefox_beta_data",
@@ -32,6 +33,30 @@ BROWSERS = {
3233
"//conditions:default": {},
3334
}),
3435
},
36+
"chrome-beta": {
37+
"data": chrome_beta_data,
38+
"deps": ["//rb/lib/selenium/webdriver:chrome"],
39+
"tags": [],
40+
"target_compatible_with": [],
41+
"env": {
42+
"WD_REMOTE_BROWSER": "chrome",
43+
"WD_SPEC_DRIVER": "chrome",
44+
"WD_BROWSER_VERSION": "beta",
45+
} | select({
46+
"@selenium//common:use_pinned_linux_chrome": {
47+
"CHROME_BINARY": "$(location @linux_beta_chrome//:chrome-linux64/chrome)",
48+
"CHROMEDRIVER_BINARY": "$(location @linux_beta_chromedriver//:chromedriver)",
49+
},
50+
"@selenium//common:use_pinned_macos_chrome": {
51+
"CHROME_BINARY": "$(location @mac_beta_chrome//:Chrome.app)/Contents/MacOS/Chrome",
52+
"CHROMEDRIVER_BINARY": "$(location @mac_beta_chromedriver//:chromedriver)",
53+
},
54+
"//conditions:default": {},
55+
}) | select({
56+
"@selenium//common:use_headless_browser": {"HEADLESS": "true"},
57+
"//conditions:default": {},
58+
}),
59+
},
3560
"edge": {
3661
"data": edge_data,
3762
"deps": ["//rb/lib/selenium/webdriver:edge"],

0 commit comments

Comments
 (0)