Skip to content

Commit

Permalink
Add a target to make it easy to run the Grid with pinned browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Jul 5, 2021
1 parent a0e9c2e commit 3f896ba
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 5 deletions.
5 changes: 5 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ alias(
actual = "//java/server/src/org/openqa/selenium/grid:executable-grid",
)

alias(
name = "pinned-grid",
actual = "//java/server/src/org/openqa/selenium/grid:pinned-grid",
)

alias(
name = "debug-server",
actual = "//java/client/test/org/openqa/selenium/environment:appserver",
Expand Down
46 changes: 41 additions & 5 deletions java/server/src/org/openqa/selenium/grid/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,42 @@ genrule(
],
)

java_binary(
name = "pinned-grid",
data = select({
"//common:linux": [
"@linux_chromedriver//:chromedriver",
"@linux_chrome//:chrome-linux",
"@linux_geckodriver//:geckodriver",
"@linux_firefox//:firefox",
],
"//common:macos": [
"@mac_chromedriver//:chromedriver",
"@mac_chrome//:Chromium.app",
"@mac_firefox//:Firefox.app",
"@mac_geckodriver//:geckodriver",
],
"//conditions:default": [],
}),
jvm_flags = select({
"//common:linux": [
"-Dwebdriver.chrome.driver=$(location @linux_chromedriver//:chromedriver)",
"-Dwebdriver.chrome.binary=$(location @linux_chrome//:chrome-linux)/chrome",
"-Dwebdriver.gecko.driver=$(location @linux_geckodriver//:geckodriver)",
"-Dwebdriver.firefox.bin=$(location @linux_firefox//:firefox)/firefox",
],
"//common:macos": [
"-Dwebdriver.chrome.driver=$(location @mac_chromedriver//:chromedriver)",
"-Dwebdriver.chrome.binary=$(location @mac_chrome//:Chromium.app)/Contents/MacOS/Chromium",
"-Dwebdriver.gecko.driver=$(location @mac_geckodriver//:geckodriver)",
"-Dwebdriver.firefox.bin=$(location @mac_firefox//:Firefox.app)/Contents/MacOS/firefox",
],
"//conditions:default": [],
}),
main_class = "org.openqa.selenium.grid.Bootstrap",
runtime_deps = [":grid"],
)

BASE_COMMAND_SRCS = [
"TemplateGridCommand.java",
"TemplateGridServerCommand.java",
Expand Down Expand Up @@ -91,11 +127,11 @@ java_export(
)

merge_jars(
name = "add-build-info",
inputs = [
":selenium_server_deploy.jar",
"//java/client/src/org/openqa/selenium:manifest",
],
name = "add-build-info",
inputs = [
":selenium_server_deploy.jar",
"//java/client/src/org/openqa/selenium:manifest",
],
)

java_binary(
Expand Down

0 comments on commit 3f896ba

Please sign in to comment.