| 
									
										
										
										
											2016-06-16 02:01:03 +01:00
										 |  |  | /// <reference path='../_protractor/e2e.d.ts' />
 | 
					
						
							|  |  |  | 'use strict'; | 
					
						
							| 
									
										
										
										
											2016-01-22 02:40:37 -08:00
										 |  |  | describe('Homepage Hello World', function () { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   beforeAll(function () { | 
					
						
							|  |  |  |     browser.get(''); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Does it even launch?
 | 
					
						
							| 
									
										
										
										
											2016-05-30 11:05:09 -07:00
										 |  |  |   let expectedLabel = 'Name:'; | 
					
						
							| 
									
										
										
										
											2016-06-01 18:11:58 +02:00
										 |  |  |   it(`should display the label: ${expectedLabel}`, function () { | 
					
						
							| 
									
										
										
										
											2016-01-22 02:40:37 -08:00
										 |  |  |     expect(element(by.css('label')).getText()).toEqual(expectedLabel); | 
					
						
							|  |  |  |   }); | 
					
						
							| 
									
										
										
										
											2016-06-08 01:06:25 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-22 02:40:37 -08:00
										 |  |  |   it('should display entered name', function () { | 
					
						
							| 
									
										
										
										
											2016-05-30 11:05:09 -07:00
										 |  |  |     let testName = 'Bobby Joe'; | 
					
						
							|  |  |  |     let nameEle = element.all(by.css('input')).get(0); | 
					
						
							| 
									
										
										
										
											2016-01-22 02:40:37 -08:00
										 |  |  |     nameEle.getAttribute('value').then(function(value) { | 
					
						
							|  |  |  |       // nameEle.sendKeys(testName); // should work but doesn't
 | 
					
						
							|  |  |  |       sendKeys(nameEle, testName); // utility that does work
 | 
					
						
							| 
									
										
										
										
											2016-06-01 18:11:58 +02:00
										 |  |  |       let newValue = value + testName; // old input box value + new name
 | 
					
						
							| 
									
										
										
										
											2016-01-22 02:40:37 -08:00
										 |  |  |       expect(nameEle.getAttribute('value')).toEqual(newValue); | 
					
						
							|  |  |  |     }).then(function() { | 
					
						
							|  |  |  |       // Check the interpolated message built from name
 | 
					
						
							| 
									
										
										
										
											2016-05-30 11:05:09 -07:00
										 |  |  |       let helloEle = element.all(by.css('h1')).get(0); | 
					
						
							| 
									
										
										
										
											2016-01-22 02:40:37 -08:00
										 |  |  |       expect(helloEle.getText()).toEqual('Hello ' + testName + '!'); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | }); |