Skip to content

Commit

Permalink
[bazel]: Start adding data to allow browser tests to run
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Stewart committed Nov 22, 2018
1 parent ac18576 commit 4b18ac6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
12 changes: 12 additions & 0 deletions common/src/web/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
filegroup(
name = "web",
data = glob([
"**/*.css",
"**/*.html",
"**/*.jpg",
"**/*.png",
]),
visibility = [
"//java/client/test/org/openqa/selenium/environment:__pkg__",
],
)
4 changes: 4 additions & 0 deletions java/client/test/org/openqa/selenium/environment/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ java_library(
"**/*TestBase.java",
],
),
data = [
"//common/src/web",
"//third_party/closure:goog",
],
visibility = [
"//java/client/test:__subpackages__",
"//java/server/test:__subpackages__",
Expand Down
7 changes: 6 additions & 1 deletion java/client/test/org/openqa/selenium/testing/InProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public class InProject {
* be found
*/
public static Path locate(String path) {
Path actualPath = Paths.get(path);
if (Files.exists(actualPath)) {
return actualPath;
}

// Find the rakefile first
Path dir = Paths.get(".").toAbsolutePath();
Path pwd = dir;
Expand All @@ -46,7 +51,7 @@ public static Path locate(String path) {
}
dir = dir.getParent();
}
Preconditions.checkNotNull(dir, "Unable to find root of project in " + pwd);
Preconditions.checkNotNull(dir, "Unable to find root of project in %s when looking for %s", pwd, path);
dir = dir.normalize();

Path needle = dir.resolve(path);
Expand Down
10 changes: 10 additions & 0 deletions third_party/closure/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
filegroup(
name = "goog",
data = glob(["goog/**"]),
licenses = [
"notice", # Apache 2
],
visibility = [
"//java/client/test/org/openqa/selenium/environment:__pkg__",
],
)

0 comments on commit 4b18ac6

Please sign in to comment.