load("//dotnet:defs.bzl", "dotnet_nunit_test_suite", "nuget_package")

filegroup(
    name = "test-data",
    testonly = True,
    srcs = [],
    data = [
        "appconfig.json",
        "//common/extensions",
        "//common/src/web",
        "//dotnet/src/webdriver:manager-linux",
        "//dotnet/src/webdriver:manager-macos",
        "//dotnet/src/webdriver:manager-windows",
        "//javascript/atoms",
        "//third_party/closure/goog",
        "//third_party/js/selenium:webdriver_json",
    ],
    visibility = [
        "//dotnet/test:__subpackages__",
    ],
)

dotnet_nunit_test_suite(
    name = "webdriver",
    size = "small",
    srcs = glob(
        ["**/*.cs"],
        exclude = [
            "bin/**",
            "obj/**",
        ],
    ),
    out = "WebDriver.Tests",
    browsers = [
        # The first browser in this list is assumed to be the one that should
        # be used by default.
        "firefox",
        "safari",
        "ie",
        "edge",
        "chrome",
    ],
    data = [
        ":test-data",
    ],
    project_sdk = "web",
    target_frameworks = ["net10.0"],
    visibility = ["//dotnet/test:__subpackages__"],
    deps = [
        "//dotnet/src/webdriver:webdriver-net8.0",
        "//dotnet/test/testing.webserver",
        nuget_package("BenderProxy"),
        nuget_package("Moq"),
        nuget_package("NUnit.Analyzers"),
        nuget_package("Runfiles"),
    ],
)
