blob: 62f6c79c0d0333ca6b197bea8b5d2c9da85bc57e [file] [edit]
load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_run_binary")
load("@rules_closure//closure:defs.bzl", "closure_js_library")
load("//javascript:defs.bzl", "closure_js_deps", "closure_test_suite")
package(default_visibility = ["//visibility:public"])
js_binary(
name = "strip_trailing_semicolon",
data = ["typescript/strip-trailing-semicolon.js"],
entry_point = "typescript/strip-trailing-semicolon.js",
)
js_binary(
name = "wrap_get_attribute_as_global",
data = ["typescript/wrap-get-attribute-as-global.js"],
entry_point = "typescript/wrap-get-attribute-as-global.js",
)
js_run_binary(
name = "get-attribute-typescript-compiled",
srcs = ["typescript/get-attribute.ts"],
outs = ["typescript/get-attribute.compiled.js"],
args = [
"--target",
"ES2017",
"--module",
"none",
"--removeComments",
"--pretty",
"false",
"--outFile",
"$(rootpath :typescript/get-attribute.compiled.js)",
"$(rootpath :typescript/get-attribute.ts)",
],
tool = "@npm_typescript//:tsc",
)
js_run_binary(
name = "get-attribute-typescript-generated",
srcs = [":get-attribute-typescript-compiled"],
outs = ["typescript/get-attribute.generated.js"],
args = [
"$(rootpath :get-attribute-typescript-compiled)",
"$(rootpath :typescript/get-attribute.generated.js)",
],
tool = ":strip_trailing_semicolon",
)
js_run_binary(
name = "get-attribute-global",
srcs = [":get-attribute-typescript-compiled"],
outs = ["typescript/get-attribute-global.js"],
args = [
"$(rootpath :get-attribute-typescript-compiled)",
"$(rootpath :typescript/get-attribute-global.js)",
],
tool = ":wrap_get_attribute_as_global",
)
filegroup(
name = "atoms",
srcs = glob([
"**/*.html",
"**/*.jpg",
"**/*.js",
"**/*.png",
"**/*.svg",
"**/*.ts",
]) + [":get-attribute-global"],
visibility = [
"//dotnet/test:__subpackages__",
"//java/test/org/openqa/selenium/environment:__pkg__",
"//javascript/selenium-webdriver:__pkg__",
],
)
closure_js_library(
name = "action",
srcs = ["action.js"],
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
visibility = [
"//javascript/atoms/fragments:__pkg__",
"//javascript/selenium-atoms:__pkg__",
"//javascript/webdriver/atoms:__pkg__",
"//javascript/webdriver/atoms/inject:__pkg__",
],
deps = [
":bot",
":devices",
":dom",
":errors",
":events",
"//third_party/closure/goog/array",
"//third_party/closure/goog/dom:tagname",
"//third_party/closure/goog/math:coordinate",
"//third_party/closure/goog/math:vec2",
"//third_party/closure/goog/style",
"//third_party/closure/goog/useragent",
"//third_party/closure/goog/useragent:product",
"//third_party/closure/goog/utils",
],
)
closure_js_library(
name = "bot",
srcs = ["bot.js"],
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
)
closure_js_library(
name = "color",
srcs = ["color.js"],
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
"//third_party/closure/goog/array",
"//third_party/closure/goog/color:names",
],
)
closure_js_library(
name = "devices",
srcs = [
"device.js",
"keyboard.js",
"mouse.js",
"touchscreen.js",
],
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":bot",
":dom",
":errors",
":events",
":locators",
":useragent",
"//third_party/closure/goog/array",
"//third_party/closure/goog/dom",
"//third_party/closure/goog/dom:selection",
"//third_party/closure/goog/dom:tagname",
"//third_party/closure/goog/math:coordinate",
"//third_party/closure/goog/structs:map",
"//third_party/closure/goog/structs:set",
"//third_party/closure/goog/useragent",
"//third_party/closure/goog/useragent:product",
"//third_party/closure/goog/utils",
],
)
closure_js_library(
name = "domcore",
srcs = ["domcore.js"],
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":errors",
":useragent",
"//third_party/closure/goog/array",
"//third_party/closure/goog/dom",
"//third_party/closure/goog/dom:nodetype",
"//third_party/closure/goog/dom:tagname",
],
)
closure_js_library(
name = "dom",
srcs = ["dom.js"],
suppress = [
"JSC_DEPRECATED_PROP",
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":bot",
":color",
":css",
":domcore",
":json",
":useragent",
"//third_party/closure/goog/array",
"//third_party/closure/goog/dom",
"//third_party/closure/goog/dom:nodetype",
"//third_party/closure/goog/dom:tagname",
"//third_party/closure/goog/math",
"//third_party/closure/goog/math:coordinate",
"//third_party/closure/goog/math:rect",
"//third_party/closure/goog/string",
"//third_party/closure/goog/style",
"//third_party/closure/goog/useragent",
],
)
closure_js_library(
name = "errors",
srcs = [
"error.js",
"response.js",
],
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
"//third_party/closure/goog/utils",
],
)
closure_js_library(
name = "events",
srcs = ["events.js"],
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":bot",
":dom",
":errors",
":json",
":useragent",
"//third_party/closure/goog/array",
"//third_party/closure/goog/dom",
"//third_party/closure/goog/events:browserevent",
"//third_party/closure/goog/style",
"//third_party/closure/goog/useragent",
"//third_party/closure/goog/useragent:product",
"//third_party/closure/goog/utils",
],
)
closure_js_library(
name = "frame",
srcs = ["frame.js"],
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
visibility = [
"//javascript/webdriver/atoms/inject:__pkg__",
],
deps = [
":bot",
":dom",
":errors",
":locators",
"//third_party/closure/goog/dom",
"//third_party/closure/goog/dom:tagname",
],
)
closure_js_library(
name = "html5",
srcs = glob(["html5/*.js"]),
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":bot",
":errors",
":json",
":useragent",
"//third_party/closure/goog/useragent",
"//third_party/closure/goog/useragent:product",
],
)
closure_js_library(
name = "inject",
srcs = ["inject.js"],
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
visibility = [
"//javascript/atoms/fragments:__pkg__",
"//javascript/selenium-atoms:__pkg__",
"//javascript/webdriver/atoms/inject:__pkg__",
],
deps = [
":bot",
":errors",
":json",
"//third_party/closure/goog/array",
"//third_party/closure/goog/dom:nodetype",
"//third_party/closure/goog/object",
"//third_party/closure/goog/useragent",
"//third_party/closure/goog/utils",
],
)
closure_js_library(
name = "json",
srcs = ["json.js"],
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":useragent",
"//third_party/closure/goog/json",
"//third_party/closure/goog/useragent",
],
)
closure_js_library(
name = "locators",
srcs = glob(
["locators/*.js"],
exclude = ["locators/css.js"],
),
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_LATE_PROVIDE_ERROR",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":bot",
":css",
":dom",
":errors",
":json",
":useragent",
"//third_party/closure/goog/array",
"//third_party/closure/goog/dom",
"//third_party/closure/goog/dom:nodetype",
"//third_party/closure/goog/dom:tagname",
"//third_party/closure/goog/math:rect",
"//third_party/closure/goog/string",
"//third_party/closure/goog/useragent",
"//third_party/closure/goog/useragent:product",
"//third_party/closure/goog/utils",
],
)
closure_js_library(
name = "useragent",
srcs = ["userAgent.js"],
suppress = [
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
"//third_party/closure/goog/string",
"//third_party/closure/goog/useragent",
"//third_party/closure/goog/useragent:product",
"//third_party/closure/goog/useragent:product_isversion",
],
)
closure_js_library(
name = "window",
srcs = [
"frame.js",
"window.js",
],
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":bot",
":errors",
":events",
":json",
":locators",
],
)
closure_js_library(
name = "css",
srcs = ["locators/css.js"],
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":bot",
":errors",
":useragent",
"//third_party/closure/goog/dom:nodetype",
"//third_party/closure/goog/string",
"//third_party/closure/goog/useragent",
"//third_party/closure/goog/utils",
],
)
closure_js_library(
name = "test_util",
testonly = 1,
srcs = ["test/test_util.js"],
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":useragent",
],
)
closure_js_deps(
name = "deps",
testonly = True,
visibility = [
"//:__pkg__",
"//java/test/org/openqa/selenium/environment:__pkg__",
"//javascript:__pkg__",
"//javascript/webdriver:__pkg__",
],
deps = [
":action",
":bot",
":color",
":css",
":devices",
":dom",
":domcore",
":errors",
":events",
":html5",
":inject",
":json",
":locators",
":test_util",
":useragent",
":window",
"//third_party/closure/goog:library",
"//third_party/closure/goog:testing",
],
)
closure_test_suite(
name = "closure-test",
data = [
":atoms",
":deps",
],
)