Skip to content

Commit

Permalink
Migrating htmlunit tests to bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Aug 28, 2019
1 parent ac72dcd commit ece9d60
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ matrix:
- env: CHROME=1 BZL="test --test_tag_filters=chrome --test_env=DISPLAY --test_env=TRAVIS //java/..."
<<: *java
<<: *chrome
- env: BZL="test --test_tag_filters=htmlunit //java/..."
<<: *java
- env: CHROME=1 TASK="calcdeps" BUCK="test //javascript/atoms:atoms-chrome //javascript/selenium-atoms:selenium-atoms-chrome //javascript/selenium-core:selenium-core-chrome //javascript/webdriver:webdriver-chrome"
<<: *java
<<: *chrome
Expand All @@ -104,8 +106,6 @@ matrix:
<<: *firefox-latest
- env: MARIONETTE=1 BUCK="test --labels small --always-exclude //java/..."
<<: *java
- env: BUCK="test htmlunit-test"
<<: *java
- env: TASK=javadocs
<<: *java
- env: TOXENV=py27-unit
Expand Down
9 changes: 7 additions & 2 deletions java/private/test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ _BROWSERS = {
"exclusive",
],
},
"htmlunit": {
"jvm_flags": ["-Dselenium.browser=htmlunit"],
"tags": [],
},
}

def _package_name():
Expand Down Expand Up @@ -149,6 +153,7 @@ _web_test = rule(
"_ie": attr.label_list(default = [Label("//java/client/src/org/openqa/selenium/ie")]),
"_firefox": attr.label_list(default = [Label("//java/client/src/org/openqa/selenium/firefox")]),
"_safari": attr.label_list(default = [Label("//java/client/src/org/openqa/selenium/safari")]),
"_htmlunit": attr.label_list(default = [Label("//third_party/java/selenium:htmlunit-driver")]),
},
fragments = ["java", "cpp"],
)
Expand All @@ -157,7 +162,7 @@ def java_selenium_test_suite(
name,
srcs,
size = "medium",
browsers = ["chrome", "edge", "firefox", "ie", "safari"],
browsers = ["chrome", "edge", "firefox", "ie", "safari", "htmlunit"],
resources = [],
data = [],
deps = [],
Expand Down Expand Up @@ -189,7 +194,7 @@ def java_selenium_test_suite(
tags = tags + _BROWSERS[browser]["tags"] + ["local", "requires-network", browser],
browser = browser,
runtime_dep = ":%s-base-lib" % name,
supported_browsers = ["chrome", "firefox"] + select({
supported_browsers = ["chrome", "firefox", "htmlunit"] + select({
"@bazel_tools//src/conditions:darwin": ["safari"],
"@bazel_tools//src/conditions:host_windows": ["edge", "ie"],
"//conditions:default": [],
Expand Down

0 comments on commit ece9d60

Please sign in to comment.