Skip to content

Commit

Permalink
Make sure we preserve the test name when single browser selected (#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkdn authored Nov 28, 2024
1 parent 165b1c8 commit 9ac6aa5
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions closure/testing/webdriver_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Macro for running webtest with a test driver."""

load("@io_bazel_rules_webtesting//web:web.bzl", "web_test_suite")
load("@io_bazel_rules_webtesting//web:web.bzl", "web_test", "web_test_suite")
load("//closure:webfiles/web_library.bzl", "web_library")

def webdriver_test(
Expand Down Expand Up @@ -73,16 +73,28 @@ def webdriver_test(
use_full_path = True,
)

web_test_suite(
name = name,
data = [test_file_js, html],
test = ":%s_test_runner" % name,
args = [html_webpath],
browsers = browsers,
tags = tags + ["no-sandbox", "native"],
visibility = visibility,
**kwargs
)
if len(browsers) == 1:
web_test(
name = name,
data = [test_file_js, html],
browser = str(browsers[0]),
test = ":%s_test_runner" % name,
args = [html_webpath],
tags = tags + ["no-sandbox", "native"],
visibility = visibility,
**kwargs
)
else:
web_test_suite(
name = name,
data = [test_file_js, html],
browsers = browsers,
test = ":%s_test_runner" % name,
args = [html_webpath],
tags = tags + ["no-sandbox", "native"],
visibility = visibility,
**kwargs
)

def _gen_test_html_impl(ctx):
"""Implementation of the gen_test_html rule."""
Expand Down

0 comments on commit 9ac6aa5

Please sign in to comment.