Skip to content

Commit

Permalink
Correctly generate test suites and all targets for java selenium tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Jul 5, 2022
1 parent 54b8568 commit 71cccff
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion java/private/selenium_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def selenium_test(name, test_class, size = "medium", browsers = BROWSERS.keys(),
stripped_args.pop("jvm_flags", None)
stripped_args.pop("tags", None)

all_tests = []

for browser in browsers:
if not browser in BROWSERS:
fail("Unrecognized browser: " + browser)
Expand All @@ -89,6 +91,12 @@ def selenium_test(name, test_class, size = "medium", browsers = BROWSERS.keys(),
data = BROWSERS[browser]["data"] + data,
**stripped_args
)
if browser == default_browser:
native.alias(
name = "%s-%s" % (name, browser),
actual = test,
)
all_tests.append(":%s" % test)

if "selenium-remote" in tags:
java_junit5_test(
Expand All @@ -106,6 +114,7 @@ def selenium_test(name, test_class, size = "medium", browsers = BROWSERS.keys(),
],
**stripped_args
)
all_tests.append(":%s-remote" % test)

# Handy way to run everything
native.test_suite(name = "%s-all-browsers" % name, tests = [":%s-%s" % (name, default_browser)], tags = tags + ["manual"])
native.test_suite(name = "%s-all-browsers" % name, tests = all_tests, tags = tags + ["manual"])

0 comments on commit 71cccff

Please sign in to comment.