2016-06-23 12:47:54 -04:00
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
*/
|
|
|
|
|
2016-11-10 21:13:11 -05:00
|
|
|
import {browser, by, element} from 'protractor';
|
2016-06-16 12:56:14 -04:00
|
|
|
|
2020-04-24 13:26:36 -04:00
|
|
|
import {verifyNoBrowserErrors} from '../../../e2e_util/e2e_util';
|
2019-02-01 08:51:13 -05:00
|
|
|
|
|
|
|
describe('ngUpgrade', function() {
|
|
|
|
const URL = '/';
|
2016-06-16 12:56:14 -04:00
|
|
|
|
2016-07-26 00:14:35 -04:00
|
|
|
beforeEach(function() {
|
|
|
|
browser.rootEl = 'body';
|
|
|
|
browser.get(URL);
|
|
|
|
});
|
2016-06-16 12:56:14 -04:00
|
|
|
|
2016-07-26 00:14:35 -04:00
|
|
|
afterEach(function() {
|
2019-02-01 08:51:13 -05:00
|
|
|
browser.useAllAngular2AppRoots();
|
2016-07-26 00:14:35 -04:00
|
|
|
verifyNoBrowserErrors();
|
|
|
|
});
|
2016-06-16 12:56:14 -04:00
|
|
|
|
2017-01-27 01:30:42 -05:00
|
|
|
it('should bootstrap AngularJS and Angular apps together', function() {
|
2016-11-12 08:08:58 -05:00
|
|
|
const ng1NameInput = element(by.css('input[ng-model="name"]'));
|
2016-06-16 12:56:14 -04:00
|
|
|
expect(ng1NameInput.getAttribute('value')).toEqual('World');
|
|
|
|
|
2019-02-01 08:51:13 -05:00
|
|
|
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/);
|
2016-06-16 12:56:14 -04:00
|
|
|
});
|
|
|
|
});
|