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