diff --git a/modules/@angular/upgrade/src/upgrade_adapter.ts b/modules/@angular/upgrade/src/upgrade_adapter.ts index fa4860633a..e460935d85 100644 --- a/modules/@angular/upgrade/src/upgrade_adapter.ts +++ b/modules/@angular/upgrade/src/upgrade_adapter.ts @@ -383,11 +383,8 @@ export class UpgradeAdapter { } }); - Promise - .all([ - this.compileNg2Components(compiler, componentFactoryRefMap), ng1BootstrapPromise, - ng1compilePromise - ]) + Promise.all([ng1BootstrapPromise, ng1compilePromise]) + .then(() => { return this.compileNg2Components(compiler, componentFactoryRefMap); }) .then(() => { ngZone.run(() => { if (rootScopePrototype) { diff --git a/modules/playground/e2e_test/upgrade/upgrade_spec.ts b/modules/playground/e2e_test/upgrade/upgrade_spec.ts index dae943987e..bc54e44442 100644 --- a/modules/playground/e2e_test/upgrade/upgrade_spec.ts +++ b/modules/playground/e2e_test/upgrade/upgrade_spec.ts @@ -8,20 +8,28 @@ import {verifyNoBrowserErrors} from "e2e_util/e2e_util"; -// TODO(i): reenable once we fix issue with exposing testability to protractor when using ngUpgrade -// https://github.com/angular/angular/issues/9407 +// TODO(i): reenable once we are using a version of protractor containing the +// change in https://github.com/angular/protractor/pull/3403 xdescribe('ngUpgrade', function() { var URL = 'all/playground/src/upgrade/index.html'; - beforeEach(function() { browser.get(URL); }); + beforeEach(function() { + browser.rootEl = 'body'; + (browser).ng12Hybrid = true; + browser.get(URL); + }); - afterEach(verifyNoBrowserErrors); + afterEach(function() { + (browser).useAllAngular2AppRoots(); + (browser).ng12Hybrid = false; + verifyNoBrowserErrors(); + }); it('should bootstrap Angular 1 and Angular 2 apps together', function() { - var ng1NameInput = element(by.css('input[ng-model]=name')); + var ng1NameInput = element(by.css('input[ng-model="name"]')); expect(ng1NameInput.getAttribute('value')).toEqual('World'); var userSpan = element(by.css('user span')); - expect(userSpan.getText()).toMatch('/World$/'); + expect(userSpan.getText()).toMatch(/World$/); }); });