"use strict";

var _LoginPage = _interopRequireDefault(require("./pageObjects/LoginPage"));

var _SearchPage = _interopRequireDefault(require("./pageObjects/SearchPage"));

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

describe('when logged out', function suite() {
  const loginPage = new _LoginPage.default();
  const searchPage = new _SearchPage.default();
  beforeEach(() => {
    loginPage.open();
    loginPage.login(testParams.adminUser.username, testParams.adminUser.password);
    searchPage.becomesVisible();
    searchPage.logout();
  });
  it('should open the login page when an attempt is made to open a protected page', () => {
    searchPage.open();
    searchPage.becomesVisible().should.equal(false);
    loginPage.becomesVisible().should.equal(true);
  });
});