Use browsers in Bazel and run tests with them.
Add the dependency for rules_browsers to your MODULE.bazel file.
bazel_dep(name = "rules_browsers", version = "0.4.0")This allows you to use provided testing macros. You can also use the
browser_group and browser_toolchain_alias targets in the browser
directories.
By default, browsers will be used at the default version. The default version
is usually the latest version that was available at the time of the used release
of rules_browsers. The consequence of this is that upgrading rules_browsers
usually means changing the default browser version.
Note
The default version of browsers can change in any release.
You can manually specify the exact browser version to use for each browser by
providing a version in your own MODULE.bazel file. The set of available
versions can be found in browsers/private/versions/<browser>.bzl.
browsers = use_extension("@rules_browsers//browsers:extensions.bzl", "browsers")
browsers.chrome(version = "x.x.x")
browsers.chromedriver(version = "x.x.x")
browsers.firefox(version = "x.x.x")- Chrome (
chrome-headless-shell) - Chromedriver
- Firefox
Each browser is provided for the following OS x architecture combinations:
linux_x64macos_x64macos_arm64windows_x64
This project does not explicitly follow any versioning policy at this time. Any release may include breaking changes.