441e01c568
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 |
||
---|---|---|
.. | ||
api.e2e-spec.ts | ||
api.po.ts | ||
app.e2e-spec.ts | ||
app.po.ts | ||
tsconfig.e2e.json |