async / await boilerplate in protractor : <p>I'm trying to use <code>async</code> / <code>await</code> with <code>protractor</code> in <code>TypeScript</code>. I'm following the example at: <a href="https://github.com/angular/protractor/tree/master/exampleTypescript/asyncAwait" rel="noreferrer">https://github.com/angular/protractor/tree/master/exampleTypescript/asyncAwait</a></p>

<p>It's working fine in my experiments. However, I have to use <code>await</code> on every calls related to browser interactions.</p>

<p>For example:</p>

<p>I have a page object for a login page:</p>

<p>login.ts:</p>

<pre><code>import {browser, element, by, By, $, $$, ExpectedConditions} from "protractor";
import { DashboardPage } from "./dashboard";
export class LoginPage {
    usernameInput = element(by.id("username"));
    passwordInput = element(by.id("password"));
    loginButton = element(by.id("login_button"));

    async get() {
        await browser.get(login_url);
        return this;
    }

    async getTitle() {
        let title = await browser.getTitle();
        return title;
    }

    async typeUsername(username: string) {
        await this.usernameInput.sendKeys(username);
    }

    async typePassword(password: string) {
        await this.passwordInput.sendKeys(password);
    }

    async login() {
        await this.loginButton.click();
        return new DashboardPage();
    }
}
</code></pre>

<p>LoginSpec.ts:</p>

<pre><code>import {browser, element, by, By, $, $$, ExpectedConditions} from "protractor";
import { LoginPage } from "../pages/login";
describe("Login Page", function() {

    beforeEach(() =&gt; {
        // login page is not an angular page.
        browser.ignoreSynchronization = true;
    });

    afterEach(() =&gt; {
        browser.ignoreSynchronization = false;
    });

    it("should go to dashboard page after successfully login", async (): Promise&lt;any&gt; =&gt; {
        let loginPage = new LoginPage();
        await loginPage.get();
        await loginPage.typeUsername(username);
        await loginPage.typePassword(password);
        let dashboard = await loginPage.login();
        expect(await dashboard.getTitle()).toEqual(`Dashboard`);
    });
});
</code></pre>

<p>In the above test spec, I have to use many <code>await</code> for all the calls to browser interactions. That introduces a lot of boilerplate for <code>await</code>.</p>

<p>The question is, is there any idea or way to reduce the boilerplate? Also, is this the right way to use <code>async</code> / <code>await</code> with <code>protractor</code>?</p>
