BestNotes/test/specs/components/login.js

35 lines
893 B
JavaScript
Raw Normal View History

2019-11-29 22:16:18 +01:00
const path = require('path');
const base = require('../base/base');
class Login {
constructor() {
this.loginForm = '.login-form-2';
2019-12-08 13:16:12 +01:00
this.emailField = '#loginform';
this.passwordField = '#passwordform';
2019-11-29 22:51:45 +01:00
this.loginButton = '.btnSubmit';
this.warringMessage = '.text-warning';
2019-11-29 22:16:18 +01:00
}
isLoginFormDisplayed() {
base.waitForDisplayed(this.loginForm);
return base.isDisplayed(this.loginForm);
}
2019-11-29 22:51:45 +01:00
fillCredentials(selector, text) {
base.fillIn(selector, text, 'Fill credentials');
return this;
}
clickLoginButton() {
base.click(this.loginButton, 'Login button');
return this;
}
getErrorMessage() {
base.waitForDisplayed(this.warringMessage);
return base.getAttribute(this.warringMessage, 'textContent', 'Error message text');
}
2019-11-29 22:16:18 +01:00
}
module.exports = Login;