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/scouting_test.protractor.on-prepare.js b/scouting/scouting_test.protractor.on-prepare.js
new file mode 100644
index 0000000..7919fe7
--- /dev/null
+++ b/scouting/scouting_test.protractor.on-prepare.js
@@ -0,0 +1,22 @@
+// The function exported from this file is used by the protractor_web_test_suite.
+// It is passed to the `onPrepare` configuration setting in protractor and executed
+// before running tests.
+//
+// If the function returns a promise, as it does here, protractor will wait
+// for the promise to resolve before running tests.
+
+const protractorUtils = require('@bazel/protractor/protractor-utils');
+const protractor = require('protractor');
+
+module.exports = function(config) {
+  // In this example, `@bazel/protractor/protractor-utils` is used to run
+  // the server. protractorUtils.runServer() runs the server on a randomly
+  // selected port (given a port flag to pass to the server as an argument).
+  // The port used is returned in serverSpec and the protractor serverUrl
+  // is the configured.
+  return protractorUtils
+      .runServer(config.workspace, config.server, '--port', [])
+      .then(serverSpec => {
+        protractor.browser.baseUrl = `http://localhost:${serverSpec.port}`;
+      });
+};