'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _LoginForm = require('./LoginForm');

var _LoginForm2 = _interopRequireDefault(_LoginForm);

var _Notification = require('./Notification');

var _Notification2 = _interopRequireDefault(_Notification);

var _Page = require('./Page');

var _Page2 = _interopRequireDefault(_Page);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

class LoginPage extends _Page2.default {
  constructor() {
    super();

    this.url = '/login';
    this.selector = '.cspace-ui-LoginPage--common';

    this.loginForm = new _LoginForm2.default();
    this.notification = new _Notification2.default();
  }

  getNotificationText() {
    return this.notification.getText();
  }

  getPromptText() {
    return this.loginForm.getPromptText();
  }

  setUsername(username) {
    this.loginForm.setUsername(username);

    return this;
  }

  setPassword(password) {
    this.loginForm.setPassword(password);

    return this;
  }

  clickSubmitButton() {
    this.loginForm.clickSubmitButton();

    return this;
  }

  enterUsernameInput() {
    this.loginForm.enterUsernameInput();

    return this;
  }

  enterPasswordInput() {
    this.loginForm.enterPasswordInput();

    return this;
  }

  submit() {
    return this.clickSubmitButton();
  }

  login(username, password) {
    this.loginForm.login(username, password);

    return this;
  }
}
exports.default = LoginPage;