load("@rules_jvm_external//:defs.bzl", "artifact")
load("//java:defs.bzl", "JUNIT5_DEPS", "java_selenium_test_suite", "java_test_suite")
load("//java:version.bzl", "TOOLS_JAVA_VERSION")

LARGE_TESTS = [
    "DrainTest.java",
]

java_selenium_test_suite(
    name = "large-tests",
    size = "large",
    srcs = LARGE_TESTS,
    browsers = [
        "chrome",
        "firefox",
        "edge",
    ],
    javacopts = [
        "--release",
        TOOLS_JAVA_VERSION,
    ],
    tags = [
        "selenium-remote",
    ],
    deps = [
        "//java/src/org/openqa/selenium/chrome",
        "//java/src/org/openqa/selenium/firefox",
        "//java/src/org/openqa/selenium/grid",
        "//java/src/org/openqa/selenium/grid/config",
        "//java/src/org/openqa/selenium/grid/distributor",
        "//java/src/org/openqa/selenium/json",
        "//java/src/org/openqa/selenium/remote",
        "//java/src/org/openqa/selenium/support",
        "//java/test/org/openqa/selenium/environment",
        "//java/test/org/openqa/selenium/grid/testing",
        "//java/test/org/openqa/selenium/remote/tracing:tracing-support",
        "//java/test/org/openqa/selenium/testing:annotations",
        "//java/test/org/openqa/selenium/testing:test-base",
        artifact("org.junit.jupiter:junit-jupiter-api"),
        artifact("org.junit.jupiter:junit-jupiter-params"),
        artifact("org.assertj:assertj-core"),
        "//java/src/org/openqa/selenium:core",
        "//java/src/org/openqa/selenium/remote/http",
    ] + JUNIT5_DEPS,
)

java_test_suite(
    name = "medium-tests",
    size = "medium",
    srcs = glob(
        ["*.java"],
        exclude = LARGE_TESTS,
    ),
    javacopts = [
        "--release",
        TOOLS_JAVA_VERSION,
    ],
    deps = [
        "//java/src/org/openqa/selenium:core",
        "//java/src/org/openqa/selenium/events",
        "//java/src/org/openqa/selenium/events/local",
        "//java/src/org/openqa/selenium/events/zeromq",
        "//java/src/org/openqa/selenium/grid/component",
        "//java/src/org/openqa/selenium/grid/data",
        "//java/src/org/openqa/selenium/grid/distributor",
        "//java/src/org/openqa/selenium/grid/distributor/local",
        "//java/src/org/openqa/selenium/grid/distributor/remote",
        "//java/src/org/openqa/selenium/grid/distributor/selector",
        "//java/src/org/openqa/selenium/grid/node",
        "//java/src/org/openqa/selenium/grid/node/local",
        "//java/src/org/openqa/selenium/grid/security",
        "//java/src/org/openqa/selenium/grid/sessionmap",
        "//java/src/org/openqa/selenium/grid/sessionmap/local",
        "//java/src/org/openqa/selenium/grid/sessionqueue",
        "//java/src/org/openqa/selenium/grid/sessionqueue/local",
        "//java/src/org/openqa/selenium/grid/web",
        "//java/src/org/openqa/selenium/json",
        "//java/src/org/openqa/selenium/remote",
        "//java/src/org/openqa/selenium/support",
        "//java/test/org/openqa/selenium/grid/testing",
        "//java/test/org/openqa/selenium/remote/tracing:tracing-support",
        artifact("com.google.guava:guava"),
        artifact("io.opentelemetry:opentelemetry-api"),
        artifact("org.junit.jupiter:junit-jupiter-api"),
        artifact("org.assertj:assertj-core"),
        artifact("org.zeromq:jeromq"),
    ] + JUNIT5_DEPS,
)
