Created
October 11, 2018 12:32
-
-
Save alex-popov-tech/a90cc9cea5df42c3ae63099ce4ceb9ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class LoginForm { | |
private readonly logInButton = element(With.id('sub')); | |
async login(username: string, password: string) { | |
await this.setLogin(username); | |
await this.setPassword(password); | |
await this.submit(); | |
const mainpage = new MainPage(); | |
await mainpage.shouldBeOpened() | |
return mainpage; | |
} | |
async setLogin(username = 'username'): Promise<void> { | |
await element('#txtUserID').setValue(username); | |
} | |
async setPassword(password = 'password'): Promise<void> { | |
await element('#txtPassword').setValue(password); | |
} | |
async submit(): Promise<void> { | |
await this.logInButton.click(); | |
} | |
async errorMessageShouldBe(text: string) { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment