Guest User

Untitled

a guest
Oct 11th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. export class LoginForm {
  2.  
  3. private readonly logInButton = element(With.id('sub'));
  4.  
  5. @ScreenedStep()
  6. async login(username: string, password: string): Promise<void> {
  7. await this.setLogin(username);
  8. await this.setPassword(password);
  9. await this.submit();
  10. }
  11.  
  12. async setLogin(username = 'username'): Promise<void> {
  13. await element('#txtUserID').setValue(username);
  14. }
  15.  
  16. async setPassword(password = 'password'): Promise<void> {
  17. await element('#txtPassword').setValue(password);
  18. }
  19.  
  20. async submit(): Promise<void> {
  21. await this.logInButton.click();
  22. }
  23.  
  24. async errorMessageShouldBe(text: string) {
  25. ...
  26. }
  27. }
Add Comment
Please, Sign In to add comment