build(examples): work around protractor typings issues and fix existing type errors

This works around the typings issues until we have a build of protractor with typings that don't
polute global types via ambient type definitions
This commit is contained in:
Igor Minar 2016-09-13 15:58:45 -07:00
parent 7105021c41
commit 4e6c41b3a1
17 changed files with 37 additions and 37 deletions

View File

@ -161,5 +161,4 @@ do
fi
done
# TODO(i): uncomment once the protractor typings issue is resolved
#./modules/@angular/examples/build.sh
./modules/@angular/examples/build.sh

View File

@ -10,8 +10,8 @@ import {verifyNoBrowserErrors} from '../../../../../_common/e2e_util';
describe('contentChild example', () => {
afterEach(verifyNoBrowserErrors);
let button: ElementFinder;
let result: ElementFinder;
let button: protractor.ElementFinder;
let result: protractor.ElementFinder;
beforeEach(() => {
browser.get('/core/di/ts/contentChild/index.html');

View File

@ -10,8 +10,8 @@ import {verifyNoBrowserErrors} from '../../../../../_common/e2e_util';
describe('contentChildren example', () => {
afterEach(verifyNoBrowserErrors);
let button: ElementFinder;
let result: ElementFinder;
let button: protractor.ElementFinder;
let result: protractor.ElementFinder;
beforeEach(() => {
browser.get('/core/di/ts/contentChildren/index.html');

View File

@ -10,8 +10,8 @@ import {verifyNoBrowserErrors} from '../../../../../_common/e2e_util';
describe('viewChild example', () => {
afterEach(verifyNoBrowserErrors);
let button: ElementFinder;
let result: ElementFinder;
let button: protractor.ElementFinder;
let result: protractor.ElementFinder;
beforeEach(() => {
browser.get('/core/di/ts/viewChild/index.html');

View File

@ -25,7 +25,7 @@ export class Pane {
<div>Selected: {{selectedPane}}</div>
`,
})
export class ViewChildComp implements AfterViewInit {
export class ViewChildComp {
@ViewChild(Pane)
set pane(v: Pane) {
setTimeout(() => { this.selectedPane = v.id; }, 0);

View File

@ -10,8 +10,8 @@ import {verifyNoBrowserErrors} from '../../../../../_common/e2e_util';
describe('viewChildren example', () => {
afterEach(verifyNoBrowserErrors);
let button: ElementFinder;
let result: ElementFinder;
let button: protractor.ElementFinder;
let result: protractor.ElementFinder;
beforeEach(() => {
browser.get('/core/di/ts/viewChildren/index.html');

View File

@ -10,8 +10,8 @@ import {verifyNoBrowserErrors} from '../../../../_common/e2e_util';
describe('formBuilder example', () => {
afterEach(verifyNoBrowserErrors);
let inputs: ElementFinder;
let paragraphs: ElementFinder;
let inputs: protractor.ElementArrayFinder;
let paragraphs: protractor.ElementArrayFinder;
beforeEach(() => {
browser.get('/forms/ts/formBuilder/index.html');

View File

@ -10,8 +10,8 @@ import {verifyNoBrowserErrors} from '../../../../_common/e2e_util';
describe('nestedFormArray example', () => {
afterEach(verifyNoBrowserErrors);
let inputs: ElementFinder;
let buttons: ElementFinder;
let inputs: protractor.ElementArrayFinder;
let buttons: protractor.ElementArrayFinder;
beforeEach(() => {
browser.get('/forms/ts/nestedFormArray/index.html');
@ -25,12 +25,12 @@ describe('nestedFormArray example', () => {
});
it('should add inputs programmatically', () => {
expect(browser.isElementPresent(inputs.get(2))).toBe(false);
expect(inputs.count()).toBe(2);
buttons.get(1).click();
inputs = element.all(by.css('input'));
expect(browser.isElementPresent(inputs.get(2))).toBe(true);
expect(inputs.count()).toBe(3);
});
it('should set the value programmatically', () => {

View File

@ -34,7 +34,7 @@ export class NestedFormArray {
]),
});
get cities(): FormArray { return this.form.get('cities'); }
get cities(): FormArray { return this.form.get('cities') as FormArray; }
addCity() { this.cities.push(new FormControl()); }

View File

@ -10,9 +10,9 @@ import {verifyNoBrowserErrors} from '../../../../_common/e2e_util';
describe('nestedFormGroup example', () => {
afterEach(verifyNoBrowserErrors);
let firstInput: ElementFinder;
let lastInput: ElementFinder;
let button: ElementFinder;
let firstInput: protractor.ElementFinder;
let lastInput: protractor.ElementFinder;
let button: protractor.ElementFinder;
beforeEach(() => {
browser.get('/forms/ts/nestedFormGroup/index.html');

View File

@ -10,8 +10,8 @@ import {verifyNoBrowserErrors} from '../../../../_common/e2e_util';
describe('ngModelGroup example', () => {
afterEach(verifyNoBrowserErrors);
let inputs: ElementFinder;
let buttons: ElementFinder;
let inputs: protractor.ElementArrayFinder;
let buttons: protractor.ElementArrayFinder;
beforeEach(() => {
browser.get('/forms/ts/ngModelGroup/index.html');

View File

@ -10,8 +10,8 @@ import {verifyNoBrowserErrors} from '../../../../_common/e2e_util';
describe('simpleForm example', () => {
afterEach(verifyNoBrowserErrors);
let inputs: ElementFinder;
let paragraphs: ElementFinder;
let inputs: protractor.ElementArrayFinder;
let paragraphs: protractor.ElementArrayFinder;
beforeEach(() => {
browser.get('/forms/ts/simpleForm/index.html');

View File

@ -12,9 +12,9 @@ describe('simpleFormControl example', () => {
afterEach(verifyNoBrowserErrors);
describe('index view', () => {
let input: ElementFinder;
let valueP: ElementFinder;
let statusP: ElementFinder;
let input: protractor.ElementFinder;
let valueP: protractor.ElementFinder;
let statusP: protractor.ElementFinder;
beforeEach(() => {
browser.get('/forms/ts/simpleFormControl/index.html');

View File

@ -12,8 +12,8 @@ describe('formControlName example', () => {
afterEach(verifyNoBrowserErrors);
describe('index view', () => {
let firstInput: ElementFinder;
let lastInput: ElementFinder;
let firstInput: protractor.ElementFinder;
let lastInput: protractor.ElementFinder;
beforeEach(() => {
browser.get('/forms/ts/simpleFormGroup/index.html');

View File

@ -10,9 +10,9 @@ import {verifyNoBrowserErrors} from '../../../../_common/e2e_util';
describe('simpleNgModel example', () => {
afterEach(verifyNoBrowserErrors);
let input: ElementFinder;
let paragraphs: ElementFinder;
let button: ElementFinder;
let input: protractor.ElementFinder;
let paragraphs: protractor.ElementArrayFinder;
let button: protractor.ElementFinder;
beforeEach(() => {
browser.get('/forms/ts/simpleNgModel/index.html');

View File

@ -16,7 +16,7 @@
"target": "es5",
"lib": ["es2015", "dom"],
"skipLibCheck": true,
"types": ["jasmine", "protractor", "node"]
"types": ["jasmine", "node"]
},
"include": [
"./_common/*.ts",
@ -24,6 +24,8 @@
"./**/test/*.ts",
"./**/e2e_test/*.ts",
"../../../node_modules/zone.js/dist/zone.js.d.ts",
"../../system.d.ts"
"../../system.d.ts",
// TODO(i): we can't use protractor's built-in typings because they contain lots of ambient definitions
"../../../node_modules/@types/protractor/index.d.ts",
]
}

View File

@ -37,8 +37,7 @@ if [[ ${TRAVIS} ]]; then
sh -e /etc/init.d/xvfb start
fi
NODE_PATH=$NODE_PATH:./dist/all $(npm bin)/protractor ./protractor-e2e.conf.js --bundles=true
# TODO(i): uncomment once the protractor typings issue is resolved
#NODE_PATH=$NODE_PATH:./dist/all $(npm bin)/protractor ./protractor-examples-e2e.conf.js --bundles=true
NODE_PATH=$NODE_PATH:./dist/all $(npm bin)/protractor ./protractor-examples-e2e.conf.js --bundles=true
NODE_PATH=$NODE_PATH:./dist/all $(npm bin)/protractor ./protractor-perf.conf.js --bundles=true --dryrun
echo 'travis_fold:end:test.e2e.localChrome'