<commit_before>import {expect} from 'chai';
import webdriverio from 'webdriverio';
import path from 'path';

const BROWSER_OPTIONS = {
  desiredCapabilities: {
    browserName: 'PhantomJS'
  }
};
const VIEWPORT_SIZE = {
  width: 1024,
  height: 768
};
const URL = 'file://' + path.join(__dirname, '..', '..', 'visual-report',
            'statics', 'index.html');

describe('Mocha Mugshot acceptance tests', function() {
  let client;

  before(function() {
    return client = webdriverio.remote(BROWSER_OPTIONS).init()
      .setViewportSize(VIEWPORT_SIZE)
      .url(URL);
  });

  it('should display the navigation bar', function() {
    client
        .isExisting('.navbar')
        .then(function(exists) {
          return expect(exists).to.be.true;
        });
  });

  it('should display the results', function() {
    client
        .isExisting('.results')
        .then(function(exists) {
          return expect(exists).to.be.true;
        });
  });

  it('should toggle the details when clicking on a test title', function() {
    client
        .click('.test-title:first')
        // gets the class atribute for all tests
        // but only the first one is toggled
        .getAttribute('.test', 'class')
        .then(function(testsClasses) {
          return expect(testsClasses[0]).to.contain('toggled');
        });
  });

  it('should display only the passed tests when clicking on Passed',
    function() {
      client
          .click('.passes')
          .getText('.test-state')
          .then(function(content) {
            return expect(content).to.not.contain('failed');
          });
    });

  it('should display only the failed tests when clicking on Failures',
    function() {
      client
          .click('.failures')
          .getText('.test-state')
          .then(function(content) {
            return expect(content).to.not.contain('passed');
          });
    });
});
<commit_msg>Clean up after test hook #48<commit_after>import {expect} from 'chai';
import webdriverio from 'webdriverio';
import path from 'path';
import {cleanUp} from './helpers.js';

const BROWSER_OPTIONS = {
  desiredCapabilities: {
    browserName: 'PhantomJS'
  }
};
const VIEWPORT_SIZE = {
  width: 1024,
  height: 768
};
const URL = 'file://' + path.join(__dirname, '..', '..', 'visual-report',
            'statics', 'index.html');

describe('Mocha Mugshot acceptance tests', function() {
  let client;

  before(function() {
    return client = webdriverio.remote(BROWSER_OPTIONS).init()
      .setViewportSize(VIEWPORT_SIZE)
      .url(URL);
  });

  it('should display the navigation bar', function() {
    client
        .isExisting('.navbar')
        .then(function(exists) {
          return expect(exists).to.be.true;
        });
  });

  it('should display the results', function() {
    client
        .isExisting('.results')
        .then(function(exists) {
          return expect(exists).to.be.true;
        });
  });

  it('should toggle the details when clicking on a test title', function() {
    client
        .click('.test-title:first')
        // gets the class atribute for all tests
        // but only the first one is toggled
        .getAttribute('.test', 'class')
        .then(function(testsClasses) {
          return expect(testsClasses[0]).to.contain('toggled');
        });
  });

  it('should display only the passed tests when clicking on Passed',
    function() {
      client
          .click('.passes')
          .getText('.test-state')
          .then(function(content) {
            return expect(content).to.not.contain('failed');
          });
    });

  it('should display only the failed tests when clicking on Failures',
    function() {
      client
          .click('.failures')
          .getText('.test-state')
          .then(function(content) {
            return expect(content).to.not.contain('passed');
          });
    });

  after(function(done) {
    cleanUp('visual-report', function() {
      done();
    });
  });
});

{'fraction_non_alphanumeric': 0.15111333500125093, 'fraction_numerical': 0.004503377533149862, 'mean_word_length': 2.420017108639863, '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': '5737432', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1162, 'n_words': 273}