2018-07-06 17:51:37 -04:00
|
|
|
load("//packages/bazel:index.bzl", "protractor_web_test_suite")
|
2019-03-13 12:41:31 -04:00
|
|
|
load("@npm_bazel_typescript//:index.bzl", "ts_config", "ts_devserver")
|
2019-02-21 17:05:31 -05:00
|
|
|
load("@build_bazel_rules_nodejs//:defs.bzl", "http_server", "rollup_bundle")
|
2018-10-04 16:14:14 -04:00
|
|
|
load("//tools:defaults.bzl", "ts_library")
|
2018-07-06 17:51:37 -04:00
|
|
|
|
2019-03-13 12:41:31 -04:00
|
|
|
ts_config(
|
|
|
|
name = "tsconfig-test",
|
|
|
|
src = "tsconfig-test.json",
|
|
|
|
deps = [":tsconfig.json"],
|
|
|
|
)
|
|
|
|
|
2018-07-06 17:51:37 -04:00
|
|
|
ts_library(
|
|
|
|
name = "app",
|
|
|
|
srcs = ["app.ts"],
|
2018-07-27 14:32:51 -04:00
|
|
|
tsconfig = ":tsconfig.json",
|
2018-07-06 17:51:37 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
ts_devserver(
|
|
|
|
name = "devserver",
|
|
|
|
serving_path = "/bundle.min.js",
|
|
|
|
static_files = ["index.html"],
|
|
|
|
deps = [":app"],
|
|
|
|
)
|
|
|
|
|
|
|
|
rollup_bundle(
|
|
|
|
name = "bundle",
|
|
|
|
entry_point = "packages/bazel/test/protractor-2/app",
|
|
|
|
deps = [":app"],
|
|
|
|
)
|
|
|
|
|
|
|
|
http_server(
|
|
|
|
name = "prodserver",
|
|
|
|
data = [
|
|
|
|
"index.html",
|
|
|
|
":bundle",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "ts_spec",
|
|
|
|
testonly = True,
|
|
|
|
srcs = ["test.spec.ts"],
|
2019-03-13 12:41:31 -04:00
|
|
|
tsconfig = ":tsconfig-test",
|
2018-10-04 16:14:14 -04:00
|
|
|
deps = [
|
2019-02-20 12:54:42 -05:00
|
|
|
"@npm//@types/selenium-webdriver",
|
|
|
|
"@npm//protractor",
|
2018-10-04 16:14:14 -04:00
|
|
|
],
|
2018-07-06 17:51:37 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
protractor_web_test_suite(
|
|
|
|
name = "prodserver_test",
|
|
|
|
configuration = ":conf.js",
|
|
|
|
data = ["//packages/bazel/src/protractor/utils"],
|
|
|
|
on_prepare = ":on-prepare.js",
|
|
|
|
server = ":prodserver",
|
2018-10-04 16:14:14 -04:00
|
|
|
deps = [
|
|
|
|
":ts_spec",
|
2019-02-20 12:54:42 -05:00
|
|
|
"@npm//protractor",
|
2018-10-04 16:14:14 -04:00
|
|
|
],
|
2018-07-06 17:51:37 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
protractor_web_test_suite(
|
|
|
|
name = "devserver_test",
|
|
|
|
configuration = ":conf.js",
|
|
|
|
data = ["//packages/bazel/src/protractor/utils"],
|
|
|
|
on_prepare = ":on-prepare.js",
|
2018-07-31 17:08:19 -04:00
|
|
|
server = ":devserver",
|
2018-10-04 16:14:14 -04:00
|
|
|
deps = [
|
|
|
|
":ts_spec",
|
2019-02-20 12:54:42 -05:00
|
|
|
"@npm//protractor",
|
2018-10-04 16:14:14 -04:00
|
|
|
],
|
2018-07-06 17:51:37 -04:00
|
|
|
)
|