- Build Instructions
- Contributing to Selenium
- Setting up Bazel plugin with IntelliJ
- Run tests in a bazel project in IntelliJ
- Bazel Tutorial: Build a Java Project
To list all targets run the below command in the directory that contains the WORKSPACE
file (Remember this is the root directory of the bazel project)
bazel query //...
The above output can be quite verbose, so remember to redirect the output to some text file using a command that looks like below:
bazel query //... > ~/Desktop/targets.txt
Here we are redirecting the output to ~/Desktop/targets.txt
Run the below command for building the grid
bazel build grid
This command is going to compile the relevant java classes, run tests and then build a jar file out of it.
You will find the built artifact (jar in this case) at the below location:
bazel-bin/java/src/org/openqa/selenium/grid/
in the root directory (The one that contains WORKSPACE
file) and it would be called grid-project.jar
Refer:
- Contributing for the instructions
- README for more information
bazel test --cache_test_results=no --test_size_filters=small grid java/test/...
bazel test --cache_test_results=no java/test/org/openqa/selenium/grid/router:large-tests
bazel test --test_size_filters=small,medium --cache_test_results=no --test_tag_filters=-browser-test //java/...
Here am going to conveniently assume that you are working with Maven project.
- Update the version to whatever you want in the file
selenium/java/version.bzl
(for e.g.,9.8.7
) - Now from the root directory ( the directory that contains the file
WORKSPACE
) run the command :./go maven-install
- Now in your test project you can set the version to the version you just now published (for e.g., in this case it would be
9.8.7
) as the maven dependency and you are good to go!