<commit_before>'use strict';

var htmlReporter = require('./htmlReporter');
var junitReporter = require('./junitReporter');
var chrome = require('selenium-webdriver/chrome');
var firefox = require('selenium-webdriver/firefox');
require('chromedriver');
require('geckodriver');

module.exports = function(grunt, WebDriver, Promise, AxeBuilder, reporter) {
	var options = this.options({
		browser: 'firefox',
		browserArguments: '',
		server: null,
		threshold: 0,
		tags: null
	});

	var tagsAreDefined =
		(!Array.isArray(options.tags) && options.tags !== null && options.tags !== '') ||
		(Array.isArray(options.tags) && options.tags.length > 0);
	var done = this.async();
	var driver = new WebDriver.Builder()
		.forBrowser(options.browser)
		.setChromeOptions(new chrome.Options().addArguments(options.browserArguments))
		.setFirefoxOptions(new firefox.Options().addArguments(options.browserArguments))
		.usingServer(options.server)
		.build();

	var dest = this.data.dest;
	var junitDest = this.data.junitDest;
	var htmlDest = this.data.htmlDest;

	if(typeof this.data.urls === 'function') {
		this.data.urls = this.data.urls();
	}

	Promise.all(this.data.urls.map(function(url) {
		return new Promise(function(resolve, reject) {
			driver
				.get(url)<commit_msg>fix: Chrome running with invalid arguments<commit_after>'use strict';

var htmlReporter = require('./htmlReporter');
var junitReporter = require('./junitReporter');
var chrome = require('selenium-webdriver/chrome');
var firefox = require('selenium-webdriver/firefox');
require('chromedriver');
require('geckodriver');

module.exports = function(grunt, WebDriver, Promise, AxeBuilder, reporter) {
	var options = this.options({
		browser: 'firefox',
		browserArguments: '',
		server: null,
		threshold: 0,
		tags: null
	});

	var tagsAreDefined =
		(!Array.isArray(options.tags) && options.tags !== null && options.tags !== '') ||
		(Array.isArray(options.tags) && options.tags.length > 0);
	var done = this.async();

	var driver = new WebDriver.Builder()
		.forBrowser(options.browser)
		.usingServer(options.server)

	if (options.browser === 'chrome' && options.browserArguments) {
		driver = driver.setChromeOptions(new chrome.Options().addArguments(options.browserArguments))
	} else if (options.browser === 'firefox' && options.browserArguments) {
		driver = driver.setFirefoxOptions(new firefox.Options().addArguments(options.browserArguments))
	}
	driver = driver.build();

	var dest = this.data.dest;
	var junitDest = this.data.junitDest;
	var htmlDest = this.data.htmlDest;

	if(typeof this.data.urls === 'function') {
		this.data.urls = this.data.urls();
	}

	Promise.all(this.data.urls.map(function(url) {
		return new Promise(function(resolve, reject) {
			driver
				.get(url)
{'fraction_non_alphanumeric': 0.15736040609137056, 'fraction_numerical': 0.0014503263234227702, 'mean_word_length': 5.0905077262693155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1916591', 'n_tokens_mistral': 919, 'n_tokens_neox': 864, 'n_words': 172}