Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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) {
- ...
- }
- }
Add Comment
Please, Sign In to add comment