<commit_before>/* global element, by */
'use strict';

var authentication = require('../authentication/authentication');
var common = require('../common/common');
var applications = require('../applications/applications');

describe('Quick search', function() {
  beforeEach(function() {
    common.before();
  });

  afterEach(function() {
    common.after();
  });

  var checkQuickSearchForm = function(recommended) {
    expect(element(by.model('itemSelected')).isDisplayed()).toBe(recommended);
  };

  var uploadData = function() {
    authentication.login('admin');

    authentication.reLogin('applicationManager');
    applications.createApplication('Compute-application', '');
    applications.createApplication('Root-application', '');
    applications.createApplication('Storage-application', '');
    authentication.logout();
  };

  it('should be able to authenticate with any role and see the quicksearch form', function() {
    console.log('################# should be able to authenticate with any role and see the quicksearch form');
    checkQuickSearchForm(false);
    uploadData();
    // login
    for (var userKey in authentication.users) {
      if (authentication.users.hasOwnProperty(userKey) && authentication.users[userKey].registered) { // all registered users should be able to view the quick search.
        authentication.login(userKey);
        checkQuickSearchForm(true);
        authentication.logout();
      }
    }<commit_msg>Fix error detected by Jenkins on quick_search<commit_after>/* global element, by */
'use strict';

var authentication = require('../authentication/authentication');
var common = require('../common/common');
var applications = require('../applications/applications');

describe('Quick search', function() {
  beforeEach(function() {
    common.before();
  });

  afterEach(function() {
    common.after();
  });

  var checkQuickSearchForm = function(recommended) {
    browser.sleep(1000);
    expect(element(by.model('itemSelected')).isPresent()).toBe(recommended);
  };

  var uploadData = function() {
    authentication.login('admin');

    authentication.reLogin('applicationManager');
    applications.createApplication('Compute-application', '');
    applications.createApplication('Root-application', '');
    applications.createApplication('Storage-application', '');
    authentication.logout();
  };

  it('should be able to authenticate with any role and see the quicksearch form', function() {
    console.log('################# should be able to authenticate with any role and see the quicksearch form');
    checkQuickSearchForm(false);
    uploadData();
    // login
    for (var userKey in authentication.users) {
      if (authentication.users.hasOwnProperty(userKey) && authentication.users[userKey].registered) { // all registered users should be able to view the quick search.
        authentication.login(userKey);
        checkQuickSearchForm(true);
        authentication.logout();
      }
    }
{'fraction_non_alphanumeric': 0.14549111632584646, 'fraction_numerical': 0.0013409319477036541, 'mean_word_length': 4.300177619893428, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3133654', 'n_tokens_mistral': 770, 'n_tokens_neox': 764, 'n_words': 183}