Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class LoginPage{
- constructor(){
- this.email= '#name';
- this.password = '#password';
- this.login = '.single-sign-on';
- this.url = "index.php?/auth/login";
- }
- visit(){
- return cy.visit(this.url);
- }
- getUrl(){
- return this.url;
- }
- setEmail(value){
- const field = cy.get(this.email);
- field.clear;
- field.type(value);
- return this
- }
- setPassword(value){
- const field = cy.get(this.password)
- field.clear();
- field.type(value)
- return this
- }
- submit(){
- return cy.get(this.login).click();
- }
- onLogin(email,password){
- this.setEmail(email);
- this.setPassword(password);
- this.submit();
- return this;
- }
- }
- export default LoginPage;
Add Comment
Please, Sign In to add comment