Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
strategy:
fail-fast: false
matrix:
browser: [chrome, firefox, chrome-bidi, edge]
browser: [chrome, firefox, chrome-bidi, edge, chrome-grid, firefox-grid]
os: [windows]
include:
- browser: safari
Expand Down
50 changes: 48 additions & 2 deletions py/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,8 @@ BIDI_IMPLEMENTATIONS = []
# generates no targets: an empty test_suite would mean every test in the package.
REMOTE_BIDI_TESTS = []

GRID_TESTS = glob(["test/selenium/webdriver/remote/**/*.py"])

# Test files that only run against browsers supporting the given feature.
# Each group is split into its own sub-suite so that changing the underlying
# library only triggers that group's targets, not the full ~700-target suite.
Expand Down Expand Up @@ -1200,7 +1202,6 @@ FEATURE_SUITE_DEFS = {
srcs = glob(
[
"test/selenium/webdriver/common/**/*.py",
"test/selenium/webdriver/remote/**/*.py",
"test/selenium/webdriver/support/**/*.py",
] + BROWSER_TESTS[browser]["browser_srcs"],
exclude = BIDI_TESTS + ACTIONS_TESTS + FEATURE_TESTS + DRIVER_FINDER_TESTS +
Expand Down Expand Up @@ -1236,6 +1237,41 @@ FEATURE_SUITE_DEFS = {
]
]

[
py_test_suite(
name = "test-%s-remote-grid" % browser,
size = "large",
srcs = GRID_TESTS,
args = [
"--instafail",
"--remote",
] + BROWSERS[browser]["args"],
data = BROWSERS[browser]["data"] + [
":java-location",
"//java/src/org/openqa/selenium/grid:selenium_server_deploy.jar",
"@bazel_tools//tools/jdk:current_java_runtime",
],
env = {
"SE_BAZEL_JAVA_LOCATION": "$(rootpath :java-location)",
},
env_inherit = ["DISPLAY"],
tags = ["no-sandbox"] + BROWSERS[browser]["tags"] + [
"remote",
"%s-remote" % browser,
],
target_compatible_with = BROWSERS[browser]["target_compatible_with"],
test_suffix = "%s-remote" % browser,
deps = [
":init-tree",
":webserver",
] + BROWSER_TESTS[browser]["deps"] + TEST_DEPS,
)
for browser in [
"chrome",
"firefox",
]
]

# Generate test-<browser>-remote-actions targets (chrome and firefox only)
[
py_test_suite(
Expand Down Expand Up @@ -1310,11 +1346,12 @@ FEATURE_SUITE_DEFS = {
for feature in FEATURE_SUITE_DEFS
]

# Aggregate test-<browser>-remote = remote-common + remote-actions + remote-features
# Aggregate test-<browser>-remote = remote-common + remote-grid + remote-actions + remote-features
[test_suite(
name = "test-%s-remote" % browser,
tests = [
":test-%s-remote-common" % browser,
":test-%s-remote-grid" % browser,
":test-%s-remote-actions" % browser,
] + [":test-%s-remote-%s" % (browser, f) for f in FEATURE_SUITE_DEFS] + ([":test-%s-remote-bidi" % browser] if REMOTE_BIDI_TESTS else []),
) for browser in [
Expand All @@ -1331,6 +1368,15 @@ test_suite(
],
)

# Lets an OS job check Grid works without paying for the whole remote suite.
[test_suite(
name = "test-%s-grid" % browser,
tests = [":test-%s-remote-grid" % browser] + ([":test-%s-remote-bidi" % browser] if REMOTE_BIDI_TESTS else []),
) for browser in [
"chrome",
"firefox",
]]

py_binary(
name = "generate-api-listing",
srcs = ["generate_api_module_listing.py"],
Expand Down
1 change: 1 addition & 0 deletions py/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ bazel test //py:test-chrome-bidi
# Against a Grid server (chrome and firefox only). The suite starts its own
# Selenium standalone server and talks to it with webdriver.Remote.
bazel test //py:test-chrome-remote
bazel test //py:test-chrome-grid # only the Grid-specific tests
bazel test //py:test-remote # every remote suite

# Test filters
Expand Down
Loading