Skip to content
Open
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
25 changes: 13 additions & 12 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,23 @@ try-import %workspace%/.bazelrc.windows.local

common --lockfile_mode=off

# Prepare for Bazel 8. These become the default in 8.0.0
common --incompatible_disallow_empty_glob
common --incompatible_use_plus_in_repo_names
# Bazel 8 compatibility flags. We should find ways to avoid needing these
common --legacy_external_runfiles

# Ensure Windows support is accurate.

startup --windows_enable_symlinks
build --enable_runfiles

build --flag_alias=pin_browsers=//common:pin_browsers
build --flag_alias=headless=//common:headless

# Set the default java toolchain

build --java_language_version=21
build --java_runtime_version=remotejdk_21
build --tool_java_language_version=21
build --tool_java_runtime_version=remotejdk_21

# We target java 11 by default

build --javacopt="--release 11"

# Require java dependencies to be used and first-order
Expand All @@ -45,7 +41,7 @@ build --javacopt="-Xep:WildcardImport:ERROR"
build --nobuild_runfile_links

# More JS magic
build --experimental_allow_unresolved_symlinks
build --allow_unresolved_symlinks
# Avoid a warning about directory tracking being unsound
startup --host_jvm_args=-DBAZEL_TRACK_SOURCE_DIRECTORIES=1

Expand All @@ -62,7 +58,17 @@ query --@aspect_rules_ts//ts:default_to_tsc_transpiler

build --incompatible_strict_action_env

# Required for prebuilt protoc to be used
common --incompatible_enable_proto_toolchain_resolution

# Ensure that we don't accidentally build protobuf or gRPC
common --per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
common --host_per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
common --per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
common --host_per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT

# Required to get `protobuf` compiling, which is required for `rules_closure`
common --incompatible_enable_proto_toolchain_resolution
build --incompatible_enable_cc_toolchain_resolution
build:linux --cxxopt=-std=c++17
build:linux --host_cxxopt=-std=c++17
Expand All @@ -75,19 +81,16 @@ build:windows --host_per_file_copt=external/protobuf\\+.*@/w
common --define=protobuf_allow_msvc=true

# For build stamping

build --enable_platform_specific_config
build:linux --workspace_status_command=scripts/build-info.sh
build:macos --workspace_status_command=scripts/build-info.sh
build:windows --workspace_status_command="powershell.exe scripts/build-info.ps1"

# Make sure we get something helpful when tests fail

build --verbose_failures
build --test_output=errors

# pass environment variables to the test environment

test --test_env=CI
test --test_env=DASHBOARD_URL
test --test_env=DISPLAY
Expand All @@ -99,7 +102,6 @@ test --test_env=PYTHON_VERSION
test --test_env=SE_AVOID_STATS=true

# Remove once rules_ruby support proper $LOAD_PATH expansion.

test --test_env=RUBYOPT="-Irb/lib -w"

# Speed up JRuby startup.
Expand All @@ -109,7 +111,6 @@ build --action_env=JRUBY_OPTS="--dev"
test --test_env=JRUBY_OPTS="--dev"

# Expose necessary variables for Selenium-Manager.

test:windows --test_env=PATH
test:windows --test_env=LOCALAPPDATA
test:windows --test_env=PROCESSOR_ARCHITECTURE
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.4.1
8.5.0
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
load("@aspect_rules_js//npm:defs.bzl", "npm_link_package")
load("@buildifier_prebuilt//:rules.bzl", "buildifier")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@rules_java//java:java_binary.bzl", "java_binary")
load("//common:browsers.bzl", "chrome_data", "firefox_data")
load("//java:browsers.bzl", "chrome_jvm_flags", "firefox_jvm_flags")
load("//java:defs.bzl", "artifact")
Expand Down
77 changes: 57 additions & 20 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,37 +1,66 @@
module(name = "selenium")

bazel_dep(name = "apple_rules_lint", version = "0.4.0")
bazel_dep(name = "aspect_bazel_lib", version = "2.14.0")
bazel_dep(name = "aspect_rules_esbuild", version = "0.21.0")
bazel_dep(name = "aspect_bazel_lib", version = "2.22.0")
bazel_dep(name = "aspect_rules_esbuild", version = "0.25.0")
bazel_dep(name = "aspect_rules_jest", version = "0.24.3")
bazel_dep(name = "aspect_rules_js", version = "2.3.7")
bazel_dep(name = "aspect_rules_ts", version = "3.6.0")
bazel_dep(name = "bazel_features", version = "1.32.0")
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "buildifier_prebuilt", version = "7.3.1")
bazel_dep(name = "contrib_rules_jvm", version = "0.27.0")
bazel_dep(name = "aspect_rules_js", version = "2.8.3")
bazel_dep(name = "aspect_rules_ts", version = "3.8.1")
bazel_dep(name = "bazel_features", version = "1.38.0")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "buildifier_prebuilt", version = "8.2.1.1")
bazel_dep(name = "contrib_rules_jvm", version = "0.31.1")
bazel_dep(name = "platforms", version = "1.0.0")

# If you update this, also update the prebuilt version of `protoc` we use below
bazel_dep(name = "protobuf", version = "32.1")

# Required for rules_rust to import the crates properly
bazel_dep(name = "rules_cc", version = "0.2.8", dev_dependency = True)
bazel_dep(name = "rules_cc", version = "0.2.16", dev_dependency = True)

bazel_dep(name = "rules_closure", version = "0.15.0")
bazel_dep(name = "rules_dotnet", version = "0.20.5")
bazel_dep(name = "rules_java", version = "8.7.1")
bazel_dep(name = "rules_jvm_external", version = "6.8")
bazel_dep(name = "rules_multitool", version = "1.3.0")
bazel_dep(name = "rules_nodejs", version = "6.3.2")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_dotnet", version = "0.21.5")

# See below for actual version used
bazel_dep(name = "rules_java", version = "0.0.0")
bazel_dep(name = "rules_jvm_external", version = "6.9")
bazel_dep(name = "rules_multitool", version = "1.11.1")
bazel_dep(name = "rules_nodejs", version = "6.6.2")
bazel_dep(name = "rules_oci", version = "2.2.7")
bazel_dep(name = "rules_pkg", version = "1.1.0")
bazel_dep(name = "rules_python", version = "1.7.0")
bazel_dep(name = "rules_proto", version = "7.0.2")
bazel_dep(name = "rules_ruby", version = "0.19.0")
bazel_dep(name = "rules_rust", version = "0.67.0")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "rules_ruby", version = "0.21.1")
bazel_dep(name = "rules_rust", version = "0.68.1")
bazel_dep(name = "toolchains_protoc", version = "0.6.0")

# Force rules_java version to avoid Unsafe warnings in remote_java_tools
single_version_override(
module_name = "rules_java",
version = "8.15.2",
)

# Until `rules_jvm_external` 6.8 ships
# Provide mechanisms to group javadocs together.
single_version_override(
module_name = "rules_jvm_external",
patch_strip = 1,
patches = ["//java:rules_jvm_external_javadoc.patch"],
patches = ["//third_party/bazel:rules_jvm_external_javadoc.patch"],
)

# Work around `contrib_rules_jvm` not properly handling non-iterable
# items in lists.
single_version_override(
module_name = "contrib_rules_jvm",
patch_strip = 1,
patches = ["//third_party/bazel:contrib_rules_jvm_select_fix.patch"],
)

# Patch protobuf to use toolchain resolution for internal_gen_well_known_protos_java
# instead of hardcoding //:protoc dependency, enabling prebuilt protoc usage.
single_version_override(
module_name = "protobuf",
patch_strip = 1,
patches = ["//third_party/bazel:protobuf_toolchain_resolution.patch"],
)

multitool = use_extension("@rules_multitool//multitool:extension.bzl", "multitool")
Expand Down Expand Up @@ -232,6 +261,7 @@ maven.install(
fail_on_missing_checksum = True,
fetch_sources = True,
known_contributing_modules = [
"protobuf",
"rules_closure",
"rules_web_testing_java",
"selenium",
Expand Down Expand Up @@ -371,6 +401,13 @@ crate.from_cargo(
)
use_repo(crate, "crates")

# Override the toolchain registration from the protobuf module
protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc")
protoc.toolchain(version = "v32.1")
use_repo(protoc, "toolchains_protoc_hub")

register_toolchains("@toolchains_protoc_hub//:all")

selenium_manager_artifacts = use_extension("//common:selenium_manager.bzl", "selenium_manager_artifacts")
use_repo(
selenium_manager_artifacts,
Expand Down
1 change: 1 addition & 0 deletions common/remote-build/cc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

# This becomes the BUILD file for @local_config_cc// under non-BSD unixes.

load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite")
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
Expand Down
1 change: 1 addition & 0 deletions common/remote-build/cc/armeabi_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ load(
"feature",
"tool_path",
)
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")

def _impl(ctx):
toolchain_identifier = "stub_armeabi-v7a"
Expand Down
1 change: 1 addition & 0 deletions common/remote-build/cc/cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ load(
"variable_with_value",
"with_feature_set",
)
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")

def layering_check_features(compiler):
if compiler != "clang":
Expand Down
2 changes: 2 additions & 0 deletions cpp/linux-specific/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")

cc_binary(
name = "noblur64",
srcs = glob([
Expand Down
2 changes: 2 additions & 0 deletions java/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load("@contrib_rules_jvm//java:defs.bzl", "spotbugs_binary", "spotbugs_config")
load("@rules_java//java:java_library.bzl", "java_library")
load("@rules_java//java:java_plugin.bzl", "java_plugin")
load(":defs.bzl", "artifact")

exports_files(
Expand Down
4 changes: 2 additions & 2 deletions java/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ load("//java/private:module.bzl", _java_module = "java_module")
load("//java/private:selenium_test.bzl", _selenium_test = "selenium_test")
load("//java/private:suite.bzl", _java_selenium_test_suite = "java_selenium_test_suite")

def java_test_suite(name, runner = "junit5", **kwargs):
_java_test_suite(name = name, runner = runner, **kwargs)
def java_test_suite(name, **kwargs):
_java_test_suite(name = name, **kwargs)

SINGLE_BROWSER = ["chrome"]

Expand Down
17 changes: 8 additions & 9 deletions java/maven_install.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL",
"__INPUT_ARTIFACTS_HASH": -1221745853,
"__RESOLVED_ARTIFACTS_HASH": -267267215,
"__INPUT_ARTIFACTS_HASH": 1543966012,
"__RESOLVED_ARTIFACTS_HASH": -1859504569,
"artifacts": {
"args4j:args4j": {
"shasums": {
Expand Down Expand Up @@ -173,10 +173,10 @@
},
"com.google.errorprone:error_prone_annotations": {
"shasums": {
"jar": "a56e782b5b50811ac204073a355a21d915a2107fce13ec711331ad036f660fcc",
"sources": "8885bccb4277d4de785da8e5cd9b8610cc12fb3740776741555639afb92ec849"
"jar": "ff80626baaf12a09342befd4e84cba9d50662f5fcd7f7a9b3490a6b7cf87e66c",
"sources": "bf08616e340f5e2ef50aaa84aea8baa086fd7bb2ad310501ff4e88ec77f8f31a"
},
"version": "2.41.0"
"version": "2.5.1"
},
"com.google.googlejavaformat:google-java-format": {
"shasums": {
Expand Down Expand Up @@ -207,10 +207,10 @@
},
"com.google.j2objc:j2objc-annotations": {
"shasums": {
"jar": "84d3a150518485f8140ea99b8a985656749629f6433c92b80c75b36aba3b099b",
"sources": "295938307f4016b3f128f7347101b236ada1394808104519c9e93cd61b64602b"
"jar": "f02a95fa1a5e95edb3ed859fd0fb7df709d121a35290eff8b74dce2ab7f4d6ed",
"sources": "7413eed41f111453a08837f5ac680edded7faed466cbd35745e402e13f4cc3f5"
},
"version": "3.1"
"version": "2.8"
},
"com.google.javascript:closure-compiler": {
"shasums": {
Expand Down Expand Up @@ -1026,7 +1026,6 @@
}
},
"conflict_resolution": {
"com.google.errorprone:error_prone_annotations:2.43.0": "com.google.errorprone:error_prone_annotations:2.41.0",
"com.google.guava:failureaccess:1.0.1": "com.google.guava:failureaccess:1.0.3",
"commons-io:commons-io:2.20.0": "commons-io:commons-io:2.5",
"io.projectreactor:reactor-core:3.6.2": "io.projectreactor:reactor-core:3.6.6",
Expand Down
1 change: 1 addition & 0 deletions java/private/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:java_binary.bzl", "java_binary")
load("@rules_jvm_external//:defs.bzl", "artifact")

exports_files(
Expand Down
1 change: 1 addition & 0 deletions java/private/common.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load("//java/private:module.bzl", "JavaModuleInfo")

MavenInfo = provider(
Expand Down
1 change: 1 addition & 0 deletions java/private/dist_info.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load("//java/private:common.bzl", "MavenInfo", "explode_coordinates", "read_coordinates")
load("//java/private:module.bzl", "JavaModuleInfo")

Expand Down
3 changes: 0 additions & 3 deletions java/private/java_test_suite.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ load(":junit5_test.bzl", "junit5_test")
def java_test_suite(
name,
srcs,
runner = "junit5",
test_suffixes = DEFAULT_TEST_SUFFIXES,
package = None,
deps = None,
Expand All @@ -19,9 +18,7 @@ def java_test_suite(
test_suffixes = test_suffixes,
package = package,
define_library = java_library,
# We want to use our own test runner
define_test = junit5_test,
runner = runner,
deps = deps,
runtime_deps = runtime_deps,
size = size,
Expand Down
3 changes: 3 additions & 0 deletions java/private/module.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
load("@rules_java//java/common:java_common.bzl", "java_common")
load("@rules_java//java/common:java_info.bzl", "JavaInfo")

_GatheredModuleInfo = provider(
fields = {
"name": "Name of the module, may be `None`.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ private static Object asAtomLocatorParameter(Object object) {
return Map.of((String) raw.get("using"), raw.get("value"));
}

@SuppressWarnings("CheckReturnValue")
private static void assertLocatorCanBeSerialized(Object locator) {
Require.nonNull("Locator", locator);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ void canCallFunctionWithSetArgument() {

EvaluateResultSuccess successResult = (EvaluateResultSuccess) result;
assertThat(successResult.getResult().getType()).isEqualTo("set");
assertThat(successResult.getResult().getValue().isPresent());
assertThat(successResult.getResult().getValue().isPresent()).isTrue();

List<RemoteValue> resultValue = (List<RemoteValue>) successResult.getResult().getValue().get();
assertThat(resultValue).hasSize(1);
Expand Down
1 change: 1 addition & 0 deletions java/test/org/openqa/selenium/firefox/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:java_library.bzl", "java_library")
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//common:defs.bzl", "copy_file")
load("//java:defs.bzl", "JUNIT5_DEPS", "java_selenium_test_suite", "java_test_suite")
Expand Down
1 change: 1 addition & 0 deletions java/test/org/openqa/selenium/grid/router/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:java_library.bzl", "java_library")
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//java:defs.bzl", "BIDI_BROWSERS", "JUNIT5_DEPS", "SINGLE_BROWSER", "java_selenium_test_suite", "java_test_suite")
load("//java:version.bzl", "TOOLS_JAVA_VERSION")
Expand Down
1 change: 1 addition & 0 deletions java/test/org/openqa/selenium/netty/server/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:java_library.bzl", "java_library")
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//java:defs.bzl", "JUNIT5_DEPS", "java_test_suite")

Expand Down
1 change: 1 addition & 0 deletions javascript/grid-ui/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ load("@aspect_rules_jest//jest:defs.bzl", "jest_test")
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@rules_java//java:java_import.bzl", "java_import")
load("@rules_pkg//pkg:zip.bzl", "pkg_zip")
load("//java:defs.bzl", "merge_jars")

Expand Down
1 change: 1 addition & 0 deletions javascript/grid-ui/public/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_java//java:java_import.bzl", "java_import")
load("@rules_pkg//pkg:zip.bzl", "pkg_zip")

pkg_zip(
Expand Down
Loading