The time-travel dilemma
Let’s begin with the most basic script – login. Open login.page.ts
in the \pageobjects
folder. Note there is an async
command in the login()
function:
public async login (username: string, password: string) await this.inputUsername.setValue(username); await this.inputPassword.setValue(password); await this.btnSubmit.click(); }
The async
keyword forces the function to always be asynchronous, returning a Promise
object representing the completion or failure of the function. There is also an await
keyword preceding the .setValue
and .click
commands, which pauses the function until the Promise
object is resolved or rejected. What would happen if the await
command were removed?
public async login (username: string, password: string...