Skip to content

Instantly share code, notes, and snippets.

@alex-popov-tech
Created October 11, 2018 12:29
Show Gist options
  • Save alex-popov-tech/17e1f9c15c1b7458d25dc68ad5f7e19e to your computer and use it in GitHub Desktop.
Save alex-popov-tech/17e1f9c15c1b7458d25dc68ad5f7e19e to your computer and use it in GitHub Desktop.
export class LoginForm {
private readonly logInButton = element(With.id('sub'));
@ScreenedStep()
async login(username: string, password: string): Promise<void> {
await this.setLogin(username);
await this.setPassword(password);
await this.submit();
}
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