| 
									
										
										
										
											2017-09-11 00:18:55 -07:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							| 
									
										
										
										
											2020-05-19 12:08:49 -07:00
										 |  |  |  * Copyright Google LLC All Rights Reserved. | 
					
						
							| 
									
										
										
										
											2017-09-11 00:18:55 -07:00
										 |  |  |  * | 
					
						
							|  |  |  |  * 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 './util'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | describe('TransferState', function() { | 
					
						
							|  |  |  |   it('should transfer component state', function() { | 
					
						
							| 
									
										
										
										
											2018-01-30 21:46:38 +01:00
										 |  |  |     // Load the page without waiting for Angular since it is not bootstrapped automatically.
 | 
					
						
							| 
									
										
										
										
											2017-09-11 00:18:55 -07:00
										 |  |  |     browser.driver.get(browser.baseUrl + 'transferstate'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // Test the contents from the server.
 | 
					
						
							|  |  |  |     const serverDiv = browser.driver.findElement(by.css('div')); | 
					
						
							|  |  |  |     expect(serverDiv.getText()).toEqual('5'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // Bootstrap the client side app and retest the contents
 | 
					
						
							|  |  |  |     browser.executeScript('doBootstrap()'); | 
					
						
							|  |  |  |     expect(element(by.css('div')).getText()).toEqual('50'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // Make sure there were no client side errors.
 | 
					
						
							|  |  |  |     verifyNoBrowserErrors(); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | }); |