angular-cn/aio/e2e
Peter Bacon Darwin 441e01c568 fix(aio): simplify GaService to avoid e2e test failures
The GaService and the E2E specs were unnecessarily complicated and had
arbitrary async timeouts to ensure that the interplay between the GA
library code and the rest of the app worked correctly. This resulted
in potential flaky tests if the timeouts were not adequate; this was
experienced when Travis upgraded to Chrome 62.

The new approach is to block loading of the Analytics library altogether
if there is a `__e2e__` flag set in the `SessionStorage` of the browser.
It doesn't appear to be enough just to set the flag directly on the
window. I think this is because the window gets cleaned when navigation
occurs (but I am not certain).

The downside of this is that we had to add a small piece of extra logic
to the GA snippet in index.html; and we also had to switch from using
`<script async ...>` to a programmatic approach to loading the GA library
which prevents the browser from eagerly fetching the library. This may
be mitigated by adding it to the HTTP/2 push configuration of the Firebase
hosting.

Re-enables the test that was disabled in https://github.com/angular/angular/pull/19784

Closes #19785
2017-10-20 09:40:52 -07:00
..
api.e2e-spec.ts build(aio): fix various API rendering issues 2017-10-03 08:15:02 -07:00
api.po.ts build(aio): fix various API rendering issues 2017-10-03 08:15:02 -07:00
app.e2e-spec.ts fix(aio): simplify GaService to avoid e2e test failures 2017-10-20 09:40:52 -07:00
app.po.ts fix(aio): simplify GaService to avoid e2e test failures 2017-10-20 09:40:52 -07:00
tsconfig.e2e.json build(aio): update project config for @angular/cli v1.0.0 2017-03-27 11:55:26 -07:00