The `upgrade` playground example has been disabled for a long time because Protractor initially didn't support running hybrid apps. Now that we use a more recent version of Protractor that handles hybrid apps (also automatically), we can re-enable this long-standing disabled test. Additionally the e2e test logic was outdated and failed because a CSS selector did not match the template of the upgrade example. With this change, the CSS selector has been updated to match the example's template, and also the test has been updated slightly to also ensure that content projection works. PR Close #28490
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
import {browser, by, element} from 'protractor';
|
|
|
|
import {verifyNoBrowserErrors} from '../../../e2e_util/e2e_util';
|
|
|
|
describe('ngUpgrade', function() {
|
|
const URL = '/';
|
|
|
|
beforeEach(function() {
|
|
browser.rootEl = 'body';
|
|
browser.get(URL);
|
|
});
|
|
|
|
afterEach(function() {
|
|
browser.useAllAngular2AppRoots();
|
|
verifyNoBrowserErrors();
|
|
});
|
|
|
|
it('should bootstrap AngularJS and Angular apps together', function() {
|
|
const ng1NameInput = element(by.css('input[ng-model="name"]'));
|
|
expect(ng1NameInput.getAttribute('value')).toEqual('World');
|
|
|
|
const projectedGreetingEl = element(by.css('.projected-content .greeting'));
|
|
const upgradedNg1ComponentEl = element(by.css('ng1-user'));
|
|
|
|
expect(projectedGreetingEl.getText()).toMatch(/World!$/);
|
|
expect(upgradedNg1ComponentEl.getText()).toMatch(/^User: World/);
|
|
});
|
|
});
|