From 81173b0d29852828768773fc1a366eeea824689a Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Wed, 18 Oct 2017 08:50:00 -0700 Subject: [PATCH] fix(aio): make tests less flaky (#19784) PR Close #19784 --- aio/content/examples/component-styles/e2e/app.e2e-spec.ts | 6 ++++-- aio/e2e/app.e2e-spec.ts | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/aio/content/examples/component-styles/e2e/app.e2e-spec.ts b/aio/content/examples/component-styles/e2e/app.e2e-spec.ts index 943d592271..986bd2b494 100644 --- a/aio/content/examples/component-styles/e2e/app.e2e-spec.ts +++ b/aio/content/examples/component-styles/e2e/app.e2e-spec.ts @@ -12,8 +12,10 @@ describe('Component Style Tests', function () { let componentH1 = element(by.css('app-root > h1')); let externalH1 = element(by.css('body > h1')); - expect(componentH1.getCssValue('fontWeight')).toEqual('normal'); - expect(externalH1.getCssValue('fontWeight')).not.toEqual('normal'); + // Note: sometimes webdriver returns the fontWeight as "normal", + // othertimes as "400", both of which are equal in CSS terms. + expect(componentH1.getCssValue('fontWeight')).toMatch(/normal|400/); + expect(externalH1.getCssValue('fontWeight')).not.toMatch(/normal|400/); }); diff --git a/aio/e2e/app.e2e-spec.ts b/aio/e2e/app.e2e-spec.ts index dfcd7c6b53..c60c6022b9 100644 --- a/aio/e2e/app.e2e-spec.ts +++ b/aio/e2e/app.e2e-spec.ts @@ -66,7 +66,9 @@ describe('site App', function() { }); }); - describe('google analytics', () => { + // TODO(https://github.com/angular/angular/issues/19785): Activate this again + // once it is no more flaky. + xdescribe('google analytics', () => { beforeEach(done => page.gaReady.then(done)); it('should call ga', done => {