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
		
			
				
	
	
		
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
/// <reference path="../_protractor/e2e.d.ts" />
 | 
						|
describe('Cookbook: component-relative paths', function () {
 | 
						|
 | 
						|
  interface Page {
 | 
						|
    title: protractor.ElementFinder;
 | 
						|
    absComp: protractor.ElementFinder;
 | 
						|
    relComp: protractor.ElementFinder;
 | 
						|
 | 
						|
  }
 | 
						|
  function getPageStruct() {
 | 
						|
    return {
 | 
						|
      title: element( by.tagName( 'h1' )),
 | 
						|
      absComp: element( by.css( 'absolute-path div' ) ),
 | 
						|
      relComp: element( by.css( 'relative-path div' ) )
 | 
						|
    }
 | 
						|
  }
 | 
						|
 | 
						|
  let page: Page;
 | 
						|
  beforeAll(function () {
 | 
						|
      browser.get('');
 | 
						|
      page = getPageStruct();
 | 
						|
  });
 | 
						|
 | 
						|
  it('should display title of the sample', function () {
 | 
						|
    expect(element(by.tagName('h1')).getText()).toContain('Paths');
 | 
						|
  });
 | 
						|
 | 
						|
  it('should have absolute-path element', function () {
 | 
						|
    expect(page.absComp.isPresent()).toBe(true, 'no <absolute-path> element');
 | 
						|
  });
 | 
						|
 | 
						|
  it('should display the absolute path text', function () {
 | 
						|
    expect(page.absComp.getText()).toContain('Absolute');
 | 
						|
  });
 | 
						|
 | 
						|
  it('should display the component-relative path text', function () {
 | 
						|
    expect(page.relComp.getText()).toContain('Component-relative');
 | 
						|
  });
 | 
						|
});
 |