Skip to content

Commit

Permalink
fix(@schematics/angular): Add types annotations to e2e AppPage
Browse files Browse the repository at this point in the history
This is a cherry-pick of dc2e40a
Original PR: #13406

When app.po.ts is compiled under Bazel with Typescript 3.2,
AppPage produces the following error:

e2e/src/app.po.ts:4:3 - error TS2742: The inferred type of 'navigateTo' cannot be named without a reference to '../../external/npm/node_modules/@types/selenium-webdriver/index'. This is likely not portable. A type annotation is necessary.

4 navigateTo() {
~~~~~~~~~~
e2e/src/app.po.ts:8:3 - error TS2742: The inferred type of 'getTitleText' cannot be named without a reference to '../../external/npm/node_modules/@types/selenium-webdriver/index'. This is likely not portable. A type annotation is necessary.

8 getTitleText() {
~~~~~~~~~~~~
  • Loading branch information
kyliau authored and mgechev committed Jan 23, 2019
1 parent aad3856 commit 364b38a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/schematics/angular/e2e/files/src/app.po.ts
Expand Up @@ -2,10 +2,10 @@ import { browser, by, element } from 'protractor';

export class AppPage {
navigateTo() {
return browser.get('/');
return browser.get('/') as Promise<any>;
}

getTitleText() {
return element(by.css('<%= rootSelector %> h1')).getText();
return element(by.css('<%= rootSelector %> h1')).getText() as Promise<string>;
}
}

0 comments on commit 364b38a

Please sign in to comment.