Update gulpfile and project to add a tsconfig to protractor test folders Change all sample e2e-spec.js -> e2e-spec.ts Split typings between e2e-spec & app code Use same config for all e2e tests Only 1/3 e2e specs truly converted. Most don't pass because they fail TS transpile by Protractor due to missing type annotations
		
			
				
	
	
		
			30 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| /// <reference path="../_protractor/e2e.d.ts" />
 | |
| describe('Homepage Hello World', function () {
 | |
| 
 | |
|   beforeAll(function () {
 | |
|     browser.get('');
 | |
|   });
 | |
| 
 | |
|   // Does it even launch?
 | |
|   let expectedLabel = 'Name:';
 | |
|   it('should display the label: ' + expectedLabel, function () {
 | |
|     expect(element(by.css('label')).getText()).toEqual(expectedLabel);
 | |
|   });
 | |
|   
 | |
|   it('should display entered name', function () {
 | |
|     let testName = 'Bobby Joe';
 | |
|     let newValue;
 | |
|     let nameEle = element.all(by.css('input')).get(0);
 | |
|     nameEle.getAttribute('value').then(function(value) {
 | |
|       // nameEle.sendKeys(testName); // should work but doesn't
 | |
|       sendKeys(nameEle, testName); // utility that does work
 | |
|       newValue = value + testName; // old input box value + new name
 | |
|       expect(nameEle.getAttribute('value')).toEqual(newValue);
 | |
|     }).then(function() {
 | |
|       // Check the interpolated message built from name
 | |
|       let helloEle = element.all(by.css('h1')).get(0);
 | |
|       expect(helloEle.getText()).toEqual('Hello ' + testName + '!');
 | |
|     });
 | |
|   });
 | |
| });
 |