| 
									
										
										
										
											2016-10-06 23:25:52 +01:00
										 |  |  | 'use strict'; // necessary for es6 output in node 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import { browser, element, by, ElementFinder } from 'protractor'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-20 19:07:01 -07:00
										 |  |  | describe('Cookbook: component-relative paths', function () { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-30 11:05:09 -07:00
										 |  |  |   interface Page { | 
					
						
							| 
									
										
										
										
											2016-10-06 23:25:52 +01:00
										 |  |  |     title: ElementFinder; | 
					
						
							|  |  |  |     absComp: ElementFinder; | 
					
						
							|  |  |  |     relComp: ElementFinder; | 
					
						
							| 
									
										
										
										
											2016-05-30 11:05:09 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2016-05-20 19:07:01 -07:00
										 |  |  |   function getPageStruct() { | 
					
						
							|  |  |  |     return { | 
					
						
							|  |  |  |       title: element( by.tagName( 'h1' )), | 
					
						
							|  |  |  |       absComp: element( by.css( 'absolute-path div' ) ), | 
					
						
							|  |  |  |       relComp: element( by.css( 'relative-path div' ) ) | 
					
						
							| 
									
										
										
										
											2016-06-08 01:06:25 +02:00
										 |  |  |     }; | 
					
						
							| 
									
										
										
										
											2016-05-20 19:07:01 -07:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-30 11:05:09 -07:00
										 |  |  |   let page: Page; | 
					
						
							| 
									
										
										
										
											2016-05-20 19:07:01 -07:00
										 |  |  |   beforeAll(function () { | 
					
						
							|  |  |  |       browser.get(''); | 
					
						
							|  |  |  |       page = getPageStruct(); | 
					
						
							|  |  |  |   }); | 
					
						
							| 
									
										
										
										
											2016-05-20 15:14:13 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-20 19:07:01 -07:00
										 |  |  |   it('should display title of the sample', function () { | 
					
						
							|  |  |  |     expect(element(by.tagName('h1')).getText()).toContain('Paths'); | 
					
						
							|  |  |  |   }); | 
					
						
							| 
									
										
										
										
											2016-05-20 15:14:13 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-20 19:07:01 -07:00
										 |  |  |   it('should have absolute-path element', function () { | 
					
						
							|  |  |  |     expect(page.absComp.isPresent()).toBe(true, 'no <absolute-path> element'); | 
					
						
							|  |  |  |   }); | 
					
						
							| 
									
										
										
										
											2016-05-20 15:14:13 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-20 19:07:01 -07:00
										 |  |  |   it('should display the absolute path text', function () { | 
					
						
							|  |  |  |     expect(page.absComp.getText()).toContain('Absolute'); | 
					
						
							| 
									
										
										
										
											2016-05-20 15:14:13 -07:00
										 |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-20 19:07:01 -07:00
										 |  |  |   it('should display the component-relative path text', function () { | 
					
						
							|  |  |  |     expect(page.relComp.getText()).toContain('Component-relative'); | 
					
						
							|  |  |  |   }); | 
					
						
							| 
									
										
										
										
											2016-05-20 15:14:13 -07:00
										 |  |  | }); |