Skip to content

Commit

Permalink
[java] Running Firefox-specific tests with bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Nov 27, 2018
1 parent 89622a8 commit c621a76
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 1 deletion.
12 changes: 12 additions & 0 deletions java/client/src/org/openqa/selenium/firefox/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
load("//java:version.bzl", "SE_VERSION")

genrule(
name = "webdriver_prefs",
srcs = [
"//third_party/js/selenium:webdriver_prefs",
],
outs = ["webdriver_prefs.json"],
cmd = "cp \"$(location //third_party/js/selenium:webdriver_prefs)\" \"$@\"",
)

java_library(
name = "firefox",
srcs = glob(["*.java"]),
resources = [
":webdriver_prefs",
],
tags = [
"maven_coordinates=org.seleniumhq.selenium:selenium-firefox-driver:" + SE_VERSION,
],
Expand Down
38 changes: 38 additions & 0 deletions java/client/test/org/openqa/selenium/firefox/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
load("//java:bazel-rules.bzl", "gen_java_selenium_tests")

genrule(
name = "firebug",
srcs = [
"//third_party/firebug",
],
outs = ["firebug.xpi"],
cmd = "cp \"$(location //third_party/firebug)\" \"$@\"",
)

java_library(
name = "resources",
srcs = [],
resources = [
":firebug",
],
resource_strip_prefix = "java/client/test"
)

gen_java_selenium_tests(
drivers = ["firefox"],
srcs = glob(["*Test.java"], exclude = ["FirefoxDriverTest.java"]),
deps = [
":resources",
"//java/client/src/org/openqa/selenium/firefox",
"//java/client/src/org/openqa/selenium/remote",
"//java/client/test/org/openqa/selenium/build",
"//java/client/test/org/openqa/selenium",
"//java/client/test/org/openqa/selenium/environment",
"//java/client/test/org/openqa/selenium/testing",
"//java/client/test/org/openqa/selenium/testing/drivers",
"//third_party/java/assertj",
"//third_party/java/guava",
"//third_party/java/junit",
"//third_party/java/mockito:mockito-core",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
public class FirefoxProfileTest {
private static final String FIREBUG_PATH = "third_party/firebug/firebug-1.5.0-fx.xpi";
private static final String FIREBUG_RESOURCE_PATH =
"/org/openqa/selenium/testing/drivers/firebug-1.5.0-fx.xpi";
"/org/openqa/selenium/firefox/firebug.xpi";
private static final String MOOLTIPASS_PATH = "third_party/firebug/mooltipass-1.1.87.xpi";

private FirefoxProfile profile;
Expand Down
12 changes: 12 additions & 0 deletions third_party/firebug/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
filegroup(
name = "firebug",
srcs = [
"firebug-1.5.0-fx.xpi",
],
licenses = [
"notice", # BSD
],
visibility = [
"//java/client/test/org/openqa/selenium/firefox:__pkg__",
],
)
12 changes: 12 additions & 0 deletions third_party/js/selenium/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
filegroup(
name = "webdriver_prefs",
srcs = [
"webdriver.json",
],
licenses = [
"notice", # Apache 2
],
visibility = [
"//java/client/src/org/openqa/selenium/firefox:__pkg__",
],
)

0 comments on commit c621a76

Please sign in to comment.