'use strict';

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

var _LoginPage2 = _interopRequireDefault(_LoginPage);

var _ObjectRecordPage = require('./pageObjects/ObjectRecordPage');

var _ObjectRecordPage2 = _interopRequireDefault(_ObjectRecordPage);

var _ProtectedPage = require('./pageObjects/ProtectedPage');

var _ProtectedPage2 = _interopRequireDefault(_ProtectedPage);

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

describe('object record page', function suite() {
  var loginPage = new _LoginPage2.default();
  var objectRecordPage = new _ObjectRecordPage2.default();
  var protectedPage = new _ProtectedPage2.default();

  describe('when logged in as the admin user', function () {
    before(function () {
      loginPage.open();
      loginPage.login(testParams.adminUser.username, testParams.adminUser.password);

      protectedPage.becomesVisible();

      objectRecordPage.open();
      objectRecordPage.becomesVisible();
    });

    after(function () {
      if (protectedPage.isVisible()) {
        protectedPage.logout();
      }
    });

    it('should open', function () {
      objectRecordPage.isVisible().should.equal(true);
    });
  });
});