From b7738ef9e495050b9e6ad7524c77bf0fedc98eab Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Thu, 31 Jan 2019 22:57:45 +0100 Subject: [PATCH] build: fix bazel protractor tests not capturing console output (#28490) Currently we depend on the "rules_webtesting" version that is installed by "rules_typescript//:package.bzl". This version of the webtesting rules comes with a very old version of Chromium and the `chromedriver` that does not support capturing console errors properly (with stack traces). Since we have a few e2e tests that depend on console output (e.g. playground/src/source-map), we need to make sure that these tests can pass upon Bazel migration. PR Close #28490 --- .../playground/e2e_test/sourcemap/sourcemap_spec.ts | 3 --- packages/bazel/package.bzl | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/playground/e2e_test/sourcemap/sourcemap_spec.ts b/modules/playground/e2e_test/sourcemap/sourcemap_spec.ts index 0de005d2e7..2a2155dd8c 100644 --- a/modules/playground/e2e_test/sourcemap/sourcemap_spec.ts +++ b/modules/playground/e2e_test/sourcemap/sourcemap_spec.ts @@ -20,9 +20,6 @@ describe('sourcemaps', function() { $('error-app .errorButton').click(); - // TODO(tbosch): Bug in ChromeDriver: Need to execute at least one command - // so that the browser logs can be read out! - browser.executeScript('1+1'); browser.manage().logs().get(logging.Type.BROWSER).then(function(logs: any) { let errorLine: number = null; let errorColumn: number = null; diff --git a/packages/bazel/package.bzl b/packages/bazel/package.bzl index 8e538d9b10..0c8a34f57c 100644 --- a/packages/bazel/package.bzl +++ b/packages/bazel/package.bzl @@ -60,6 +60,16 @@ def rules_angular_dev_dependencies(): url = "https://github.com/google/brotli/archive/v1.0.5.zip", ) + # The TypeScript rules transitively fetch a version of "rules_webtesting", but the version + # does not include 239b491e8251588bb46297b899d306ae7024858e which updates the "chromedriver" + # version so that e2e tests are able to capture the browser console output. This is needed + # for a few e2e tests, so we manually fetch a version that includes that required SHA. + http_archive( + name = "io_bazel_rules_webtesting", + url = "https://github.com/bazelbuild/rules_webtesting/archive/1f430d5e1cae10efc953a6511147e21b3bc03a5d.zip", + strip_prefix = "rules_webtesting-1f430d5e1cae10efc953a6511147e21b3bc03a5d", + ) + ############################################# # Dependencies for generating documentation # #############################################