From 441e01c56800bd96d5243388b40eec06f0f3ade5 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Thu, 19 Oct 2017 13:58:27 +0100 Subject: [PATCH] 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 ` -