<commit_before>/**
 * Helper methods and variables for capser test suite.
 */

// Define the url for all tests.
var url = casper.cli.get('url');

// Set default viewport for all tests.
casper.options.viewportSize = { width: 1280, height: 1024 };

// Use to log in before performing a test.
casper.login = function(username, password) {
  // If no arguments are given, log in using default test account
  username = typeof username == "string" ? username : "<EMAIL>";
  password = typeof password == "string" ? password : "<PASSWORD>";

  this.echo("Logging in as: " + username);

  // Go home and login.
  casper.thenOpen(url + "/user", function() {
    this.fill('form[action="/user/login"]', {
      name: username,
      pass: password
    }, true);
  });
}

// Use to log out after completing a test.
casper.logout = function() {
  // Go home and click the "Log Out" button
  casper.thenOpen(url + "/user/logout", function() {
    this.echo("Logging out of test user.");
  });
}

// We want to start at the homepage on each test.<commit_msg>PhantomCSS configuration.<commit_after>/**
 * Helper methods and variables for capser test suite.
 */

var ROOT = '/var/www/vagrant/';

// Define the url for all tests.
var url = casper.cli.get('url');
var phantomcss = require(ROOT + 'scripts/tests/vendor/phantomcss');
phantomcss.init({
});

// Set default viewport for all tests.
casper.options.viewportSize = { width: 1280, height: 1024 };

// Use to log in before performing a test.
casper.login = function(username, password) {
  // If no arguments are given, log in using default test account
  username = typeof username == "string" ? username : "<EMAIL>";
  password = typeof password == "string" ? password : "<PASSWORD>";

  this.echo("Logging in as: " + username);

  // Go home and login.
  casper.thenOpen(url + "/user", function() {
    this.fill('form[action="/user/login"]', {
      name: username,
      pass: password
    }, true);
  });
}

// Use to log out after completing a test.
casper.logout = function() {
  // Go home and click the "Log Out" button
  casper.thenOpen(url + "/user/logout", function() {
    this.echo("Logging out of test user.");
  });
}

// We want to start at the homepage on each test.
{'fraction_non_alphanumeric': 0.14696629213483145, 'fraction_numerical': 0.0071910112359550565, 'mean_word_length': 3.2807692307692307, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '4476774', 'n_tokens_mistral': 699, 'n_tokens_neox': 673, 'n_words': 240}