From 3def2cc5527a893dbf5e86e6902e9f3f8f98620e Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Tue, 28 Nov 2017 13:35:22 +0000 Subject: [PATCH] test(aio): cleaner approach to reliable Google Analytics e2e tests (#20661) PR Close #20661 --- aio/e2e/app.e2e-spec.ts | 2 -- aio/e2e/app.po.ts | 5 +---- aio/src/index.html | 8 +++++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/aio/e2e/app.e2e-spec.ts b/aio/e2e/app.e2e-spec.ts index f8e219fccd..d612ee4037 100644 --- a/aio/e2e/app.e2e-spec.ts +++ b/aio/e2e/app.e2e-spec.ts @@ -80,8 +80,6 @@ describe('site App', function() { }); }); - // TODO(https://github.com/angular/angular/issues/19785): Activate this again - // once it is no more flaky. describe('google analytics', () => { it('should call ga with initial URL', done => { diff --git a/aio/e2e/app.po.ts b/aio/e2e/app.po.ts index 7beb57d1ea..89d2ec8a53 100644 --- a/aio/e2e/app.po.ts +++ b/aio/e2e/app.po.ts @@ -29,10 +29,7 @@ export class SitePage { locationPath() { return browser.executeScript('return document.location.pathname') as promise.Promise; } navigateTo(pageUrl = '') { - return browser.get('/' + pageUrl) - // We need to tell the index.html not to load the real analytics library - // See the GA snippet in index.html - .then(() => browser.executeScript('sessionStorage.setItem("__e2e__", true);')); + return browser.get('/' + pageUrl); } getDocViewerText() { diff --git a/aio/src/index.html b/aio/src/index.html index 9318d4af05..8f2dafbb63 100644 --- a/aio/src/index.html +++ b/aio/src/index.html @@ -34,11 +34,13 @@