<commit_before>/* global server */
/* global AutoTrack */

'use strict';

module.exports = {
    'Pageload with requirejs': function (browser) {
        var chai = require('chai');
        browser
        .deleteCookies()
        .getCookies(function callback(result) {
            this.assert.equal(result.value.length, 0);
        })
		.url('http://1172.16.58.3:8080/dev/requiretests/indexSimple.html')
        .waitForElementVisible('body', 1000)
		.pause(1000)
		.execute(function() {
            return server.requests;
        }, [''], function(res) {
			this.assert.equal(res.value.length, 2);
			var requestBody = JSON.parse(res.value[1].requestBody);
			chai.assert.include(requestBody[0].provider['@id'], 'pulseTest');
        })
		.execute(function() {
			return AutoTrack.getVisitorId();
		}, [''], function(res) {
			this.assert.equal(res.value, 'abcd3456');
		})
		.getCookies(function callback(result) {
            this.assert.equal(result.value.length, 4);

			var nameArray = [
				'_DataTrackerSession',
				'_DataTrackerEnv',
				'_DataTrackerVisitor',
				'_DataTrackerUser'
			];

			var valueArray = [
				'abcd2345',
				'abcd4567',
				'abcd3456',
				'abcd1234'
			];

			var count = 0;

			while (nameArray.length > 0) {
				var needleName = nameArray.pop();
				var needleValue = valueArray.pop();
				var haystackArray = result.value;
				
				for (var j = 0; j < haystackArray.length; j++) {
					if (haystackArray[j].name === needleName) {
						this.assert.equal(haystackArray[j].value, needleValue);
						count++;
					}
				}
			}

			this.assert.equal(result.value.length, count);

        })
		.click('body #test-click-element')
		.pause(100)
		.execute(function() {
            return server.requests;
        }, [''], function(res) {
			this.assert.equal(res.value.length, 3);

			var requestBody = JSON.parse(res.value[2].requestBody);

			this.assert.equal(requestBody[0]['@type'], 'Accept');
			this.assert.notEqual(requestBody[0]['@context'], undefined);
			this.assert.notEqual(requestBody[0].provider, undefined);
			this.assert.notEqual(requestBody[0].actor, undefined);
			this.assert.notEqual(requestBody[0].object, undefined);
			chai.assert.include(requestBody[0].object['@id'], 'test-click-element');

        })
		.execute(function() {
            server.restore();
        }, [''])
        .end();
    }
};<commit_msg>fixed lint errors<commit_after>/* global server */
/* global AutoTrack */

'use strict';

module.exports = {
    'Pageload with requirejs': function (browser) {
        var chai = require('chai');
        browser
        .deleteCookies()
        .getCookies(function callback(result) {
            this.assert.equal(result.value.length, 0);
        })
		.url('http://127.0.0.1:8080/dev/requiretests/indexSimple.html')
        .waitForElementVisible('body', 1000)
		.pause(1000)
		.execute(function() {
            return server.requests;
        }, [''], function(res) {
			this.assert.equal(res.value.length, 2);
			var requestBody = JSON.parse(res.value[1].requestBody);
			chai.assert.include(requestBody[0].provider['@id'], 'pulseTest');
        })
		.execute(function() {
			return AutoTrack.getVisitorId();
		}, [''], function(res) {
			this.assert.equal(res.value, 'abcd3456');
		})
		.getCookies(function callback(result) {
            this.assert.equal(result.value.length, 4);

			var nameArray = [
				'_DataTrackerSession',
				'_DataTrackerEnv',
				'_DataTrackerVisitor',
				'_DataTrackerUser'
			];

			var valueArray = [
				'abcd2345',
				'abcd4567',
				'abcd3456',
				'abcd1234'
			];

			var count = 0;

			while (nameArray.length > 0) {
				var needleName = nameArray.pop();
				var needleValue = valueArray.pop();
				var haystackArray = result.value;

				for (var j = 0; j < haystackArray.length; j++) {
					if (haystackArray[j].name === needleName) {
						this.assert.equal(haystackArray[j].value, needleValue);
						count++;
					}
				}
			}

			this.assert.equal(result.value.length, count);

        })
		.click('body #test-click-element')
		.pause(100)
		.execute(function() {
            return server.requests;
        }, [''], function(res) {
			this.assert.equal(res.value.length, 3);

			var requestBody = JSON.parse(res.value[2].requestBody);

			this.assert.equal(requestBody[0]['@type'], 'Accept');
			this.assert.notEqual(requestBody[0]['@context'], undefined);
			this.assert.notEqual(requestBody[0].provider, undefined);
			this.assert.notEqual(requestBody[0].actor, undefined);
			this.assert.notEqual(requestBody[0].object, undefined);
			chai.assert.include(requestBody[0].object['@id'], 'test-click-element');

        })
		.execute(function() {
            server.restore();
        }, [''])
        .end();
    }
};

{'fraction_non_alphanumeric': 0.17046413502109706, 'fraction_numerical': 0.024683544303797468, 'mean_word_length': 2.9052718286655685, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4605954', 'n_tokens_mistral': 1844, 'n_tokens_neox': 1530, 'n_words': 234}