<commit_before>var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);

var expect = chai.expect;

module.exports = function() {

    waitUrlChange = function(){
        //Waits for URL to change
        browser.getCurrentUrl().then(function(url){
            startUrl = url;
        });
        browser.wait(function() {
            return browser.getCurrentUrl().then(function(url) {
                return (url !== startUrl);
            });
        }, 20000);
    }

    this.When(/^I wait for the file to be processed$/, function (next) {
        waitUrlChange();
        next();<commit_msg>Reworked url change waiting function to return a promise<commit_after>var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);

var expect = chai.expect;

module.exports = function() {

    waitUrlChange = function(){
        //Waits for URL to change before allowing execution to move forward. Timeout is at end of fn.
        var deferred = protractor.promise.defer();
        browser.getCurrentUrl().then(function(url){
            startUrl = url;
        });
        browser.wait(function() {
            return browser.getCurrentUrl().then(function(url) {
                return (url !== startUrl);
            });
        }, 20000);
        deferred.fulfill();
        return deferred.promise;
    }

    this.When(/^I wait for the file to be processed$/, function (next) {
        waitUrlChange().then(function(){
            next();
        });
{'fraction_non_alphanumeric': 0.13156189241736876, 'fraction_numerical': 0.0064808813998703824, 'mean_word_length': 2.356521739130435, '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': '6610708', 'n_tokens_mistral': 446, 'n_tokens_neox': 431, 'n_words': 107}