Guest User

Untitled

a guest
Jan 20th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. class LoginPage{
  2.  
  3. constructor(){
  4. this.email= '#name';
  5. this.password = '#password';
  6. this.login = '.single-sign-on';
  7. this.url = "index.php?/auth/login";
  8. }
  9.  
  10. visit(){
  11. return cy.visit(this.url);
  12. }
  13.  
  14. getUrl(){
  15. return this.url;
  16. }
  17.  
  18. setEmail(value){
  19. const field = cy.get(this.email);
  20. field.clear;
  21. field.type(value);
  22. return this
  23. }
  24.  
  25. setPassword(value){
  26. const field = cy.get(this.password)
  27. field.clear();
  28. field.type(value)
  29. return this
  30. }
  31.  
  32. submit(){
  33. return cy.get(this.login).click();
  34. }
  35.  
  36. onLogin(email,password){
  37. this.setEmail(email);
  38. this.setPassword(password);
  39. this.submit();
  40. return this;
  41. }
  42. }
  43.  
  44. export default LoginPage;
Add Comment
Please, Sign In to add comment