Migrate //scouting:scouting_test to Protractor
This framework automatically takes care of the webdriver/selenium
setup. It just lets us focus on writing tests.
This patch migrates the scouting test to use Protractor. It validates
that the application loads correctly and displays the only message
that exists so far.
I can confirm that that test uses a sandboxed version of the chromium
browser:
$ bazel cquery 'somepath(//scouting:scouting_test, @org_chromium_chromium_linux_x64//:metadata)' 2>/dev/null
//scouting:scouting_test (cdf6808)
//scouting:scouting_test_chromium-local (cdf6808)
@io_bazel_rules_webtesting//browsers:chromium-local (3ee7ec9)
@io_bazel_rules_webtesting//third_party/chromium:chromium (3ee7ec9)
@org_chromium_chromium_linux_x64//:metadata (3ee7ec9)
I based the test itself on the upstream example code:
https://github.com/bazelbuild/rules_nodejs/tree/stable/examples/angular/e2e/src
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I8d24e82077af3c104d676168e52ecec89fda8004
diff --git a/scouting/BUILD b/scouting/BUILD
index 9b8adee..0ed540b 100644
--- a/scouting/BUILD
+++ b/scouting/BUILD
@@ -1,5 +1,5 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
-load("//tools/build_rules:js.bzl", "turn_files_into_runfiles")
+load("//tools/build_rules:js.bzl", "protractor_ts_test", "turn_files_into_runfiles")
go_binary(
name = "sql_demo",
@@ -35,12 +35,11 @@
],
)
-py_test(
+protractor_ts_test(
name = "scouting_test",
srcs = [
- "scouting_test.py",
+ ":scouting_test.ts",
],
- data = [
- ":scouting",
- ],
+ on_prepare = ":scouting_test.protractor.on-prepare.js",
+ server = ":scouting",
)