| 
									
										
										
										
											2016-06-23 09:47:54 -07:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							| 
									
										
										
										
											2020-05-19 12:08:49 -07:00
										 |  |  |  * Copyright Google LLC All Rights Reserved. | 
					
						
							| 
									
										
										
										
											2016-06-23 09:47:54 -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
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-10 18:13:11 -08:00
										 |  |  | import {browser} from 'protractor'; | 
					
						
							| 
									
										
										
										
											2015-07-14 19:53:04 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-24 13:14:28 -07:00
										 |  |  | import {verifyNoBrowserErrors} from '../../../../dev-infra/benchmark/driver-utilities'; | 
					
						
							| 
									
										
										
										
											2019-02-01 14:46:38 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-14 19:53:04 -05:00
										 |  |  | describe('jsonp', function() { | 
					
						
							|  |  |  |   afterEach(verifyNoBrowserErrors); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   describe('fetching', function() { | 
					
						
							| 
									
										
										
										
											2019-02-01 14:46:38 +01:00
										 |  |  |     const URL = '/'; | 
					
						
							| 
									
										
										
										
											2015-07-14 19:53:04 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     it('should fetch and display people', function() { | 
					
						
							|  |  |  |       browser.get(URL); | 
					
						
							|  |  |  |       expect(getComponentText('jsonp-app', '.people')).toEqual('hello, caitp'); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-23 16:21:18 +02:00
										 |  |  | function getComponentText(selector: string, innerSelector: string) { | 
					
						
							| 
									
										
										
										
											2020-04-13 16:40:21 -07:00
										 |  |  |   return browser.executeScript(`return document.querySelector("${selector}").querySelector("${ | 
					
						
							|  |  |  |       innerSelector}").textContent.trim()`);
 | 
					
						
							| 
									
										
										
										
											2015-07-14 19:53:04 -05:00
										 |  |  | } |