'use strict';

var _LoginPage = require('./pageObjects/LoginPage');

var _LoginPage2 = _interopRequireDefault(_LoginPage);

var _SearchPage = require('./pageObjects/SearchPage');

var _SearchPage2 = _interopRequireDefault(_SearchPage);

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

describe('when logged out', function suite() {
  var loginPage = new _LoginPage2.default();
  var searchPage = new _SearchPage2.default();

  beforeEach(function () {
    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', function () {
    searchPage.open();

    searchPage.becomesVisible().should.equal(false);

    loginPage.becomesVisible().should.equal(true);
  });
});