diff --git a/aio/content/examples/attribute-directives/e2e/src/app.e2e-spec.ts b/aio/content/examples/attribute-directives/e2e/src/app.e2e-spec.ts index ebc9d5e986..00ef4e33c6 100644 --- a/aio/content/examples/attribute-directives/e2e/src/app.e2e-spec.ts +++ b/aio/content/examples/attribute-directives/e2e/src/app.e2e-spec.ts @@ -17,6 +17,7 @@ describe('Attribute directives', () => { it('should be able to select green highlight', () => { const highlightedEle = element(by.cssContainingText('p', 'Highlight me!')); const lightGreen = 'rgba(144, 238, 144, 1)'; + const getBgColor = () => highlightedEle.getCssValue('background-color'); expect(highlightedEle.getCssValue('background-color')).not.toEqual(lightGreen); @@ -24,6 +25,8 @@ describe('Attribute directives', () => { greenRb.click(); browser.actions().mouseMove(highlightedEle).perform(); - expect(highlightedEle.getCssValue('background-color')).toEqual(lightGreen); + // Wait for up to 2s for the background color to be updated, + // to account for slow environments (e.g. CI). + browser.wait(() => highlightedEle.getCssValue('background-color').then(c => c === lightGreen), 2000); }); }); diff --git a/aio/content/examples/dependency-injection-in-action/e2e/src/app.e2e-spec.ts b/aio/content/examples/dependency-injection-in-action/e2e/src/app.e2e-spec.ts index 07ab501be7..00dd11868c 100644 --- a/aio/content/examples/dependency-injection-in-action/e2e/src/app.e2e-spec.ts +++ b/aio/content/examples/dependency-injection-in-action/e2e/src/app.e2e-spec.ts @@ -73,8 +73,12 @@ describe('Dependency Injection Cookbook', function () { let yellow = 'rgba(255, 255, 0, 1)'; expect(target.getCssValue('background-color')).not.toEqual(yellow); - browser.actions().mouseMove(target.getWebElement()).perform(); - expect(target.getCssValue('background-color')).toEqual(yellow); + + browser.actions().mouseMove(target).perform(); + + // Wait for up to 2s for the background color to be updated, + // to account for slow environments (e.g. CI). + browser.wait(() => target.getCssValue('background-color').then(c => c === yellow), 2000); }); describe('in Parent Finder', function () {