<commit_before>'use strict';

var webdriverio = require('webdriverio');

var e = require('./setup/test-environment');
var C = require('./setup/test-constants');

// Global before and after

before(function(done) {
    this.timeout(30000);

    if (C.CONFIG.login.enabled) {
        throw new Error('Login security is enabled! Please disable login security in cfg/nodecg.json before running tests');
    }

    if (C.CONFIG.ssl.enabled) {
        throw new Error('SSL is enabled! Please disable SSL in cfg/nodecg.json before running tests');
    }

    e.server.once('started', function() {
        /** Extension API setup **/
        e.apis.extension = e.server.getExtensions()[C.BUNDLE_NAME];

        e.browsers.dashboard = webdriverio.remote({
            desiredCapabilities: {
                tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
            },
            host: 'ondemand.saucelabs.com',
            port: 80,
            user: process.env.SAUCE_USERNAME,
            key: process.env.SAUCE_ACCESS_KEY
        })
            .init()
            .url(C.DASHBOARD_URL);

        // Zombie doesn't set referers itself when requesting assets on a page
        // For this reason, there is a workaround in lib/bundle_views
        e.browsers.view = webdriverio.remote({
            desiredCapabilities: {
                tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
            },
            host: 'ondemand.saucelabs.com',
            port: 80,
            user: process.env.SAUCE_USERNAME,
            key: process.env.SAUCE_ACCESS_KEY
        })
            .init()
            .url(C.VIEW_URL);

        done();
    });
    e.server.start();
});

after(function() {
    try{
        e.server.stop();
        e.browsers.dashboard.end();
        e.browsers.view.end();
    } catch(e) {}
});<commit_msg>Don't proceed with tests until ready to go.<commit_after>'use strict';

var webdriverio = require('webdriverio');

var e = require('./setup/test-environment');
var C = require('./setup/test-constants');

// Global before and after

before(function(done) {
    this.timeout(30000);

    if (C.CONFIG.login.enabled) {
        throw new Error('Login security is enabled! Please disable login security in cfg/nodecg.json before running tests');
    }

    if (C.CONFIG.ssl.enabled) {
        throw new Error('SSL is enabled! Please disable SSL in cfg/nodecg.json before running tests');
    }

    e.server.once('started', function() {
        /** Extension API setup **/
        e.apis.extension = e.server.getExtensions()[C.BUNDLE_NAME];

        var dashboardReady = false;
        var viewReady = false;

        e.browsers.dashboard = webdriverio.remote({
            desiredCapabilities: {
                tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
            },
            host: 'ondemand.saucelabs.com',
            port: 80,
            user: process.env.SAUCE_USERNAME,
            key: process.env.SAUCE_ACCESS_KEY
        })
            .init()
            .url(C.DASHBOARD_URL)
            .call(function() {
                dashboardReady = true;

                if (dashboardReady && viewReady) {
                    done();
                }
            });

        // Zombie doesn't set referers itself when requesting assets on a page
        // For this reason, there is a workaround in lib/bundle_views
        e.browsers.view = webdriverio.remote({
            desiredCapabilities: {
                tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
            },
            host: 'ondemand.saucelabs.com',
            port: 80,
            user: process.env.SAUCE_USERNAME,
            key: process.env.SAUCE_ACCESS_KEY
        })
            .init()
            .url(C.VIEW_URL)
            .call(function() {
                viewReady = true;

                if (dashboardReady && viewReady) {
                    done();
                }
            });
    });
    e.server.start();
});

after(function() {
    try{
        e.server.stop();
        e.browsers.dashboard.end();
        e.browsers.view.end();
    } catch(e) {}
});
{'fraction_non_alphanumeric': 0.11979421852033317, 'fraction_numerical': 0.004409603135717786, 'mean_word_length': 1.831484049930652, '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': '2074530', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1183, 'n_words': 254}