Skip to content

Commit 3f896ba

Browse files
committed
Add a target to make it easy to run the Grid with pinned browsers
1 parent a0e9c2e commit 3f896ba

File tree

2 files changed

+46
-5
lines changed

2 files changed

+46
-5
lines changed

BUILD.bazel

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ alias(
1616
actual = "//java/server/src/org/openqa/selenium/grid:executable-grid",
1717
)
1818

19+
alias(
20+
name = "pinned-grid",
21+
actual = "//java/server/src/org/openqa/selenium/grid:pinned-grid",
22+
)
23+
1924
alias(
2025
name = "debug-server",
2126
actual = "//java/client/test/org/openqa/selenium/environment:appserver",

java/server/src/org/openqa/selenium/grid/BUILD.bazel

+41-5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,42 @@ genrule(
1919
],
2020
)
2121

22+
java_binary(
23+
name = "pinned-grid",
24+
data = select({
25+
"//common:linux": [
26+
"@linux_chromedriver//:chromedriver",
27+
"@linux_chrome//:chrome-linux",
28+
"@linux_geckodriver//:geckodriver",
29+
"@linux_firefox//:firefox",
30+
],
31+
"//common:macos": [
32+
"@mac_chromedriver//:chromedriver",
33+
"@mac_chrome//:Chromium.app",
34+
"@mac_firefox//:Firefox.app",
35+
"@mac_geckodriver//:geckodriver",
36+
],
37+
"//conditions:default": [],
38+
}),
39+
jvm_flags = select({
40+
"//common:linux": [
41+
"-Dwebdriver.chrome.driver=$(location @linux_chromedriver//:chromedriver)",
42+
"-Dwebdriver.chrome.binary=$(location @linux_chrome//:chrome-linux)/chrome",
43+
"-Dwebdriver.gecko.driver=$(location @linux_geckodriver//:geckodriver)",
44+
"-Dwebdriver.firefox.bin=$(location @linux_firefox//:firefox)/firefox",
45+
],
46+
"//common:macos": [
47+
"-Dwebdriver.chrome.driver=$(location @mac_chromedriver//:chromedriver)",
48+
"-Dwebdriver.chrome.binary=$(location @mac_chrome//:Chromium.app)/Contents/MacOS/Chromium",
49+
"-Dwebdriver.gecko.driver=$(location @mac_geckodriver//:geckodriver)",
50+
"-Dwebdriver.firefox.bin=$(location @mac_firefox//:Firefox.app)/Contents/MacOS/firefox",
51+
],
52+
"//conditions:default": [],
53+
}),
54+
main_class = "org.openqa.selenium.grid.Bootstrap",
55+
runtime_deps = [":grid"],
56+
)
57+
2258
BASE_COMMAND_SRCS = [
2359
"TemplateGridCommand.java",
2460
"TemplateGridServerCommand.java",
@@ -91,11 +127,11 @@ java_export(
91127
)
92128

93129
merge_jars(
94-
name = "add-build-info",
95-
inputs = [
96-
":selenium_server_deploy.jar",
97-
"//java/client/src/org/openqa/selenium:manifest",
98-
],
130+
name = "add-build-info",
131+
inputs = [
132+
":selenium_server_deploy.jar",
133+
"//java/client/src/org/openqa/selenium:manifest",
134+
],
99135
)
100136

101137
java_binary(

0 commit comments

Comments
 (0)