<commit_before>package org.alienlabs.hatchetharry.integrationTest;

import junit.framework.Assert;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.opera.core.systems.OperaDriver;

public class VerifyQUnitTests
{
	private static final Logger LOGGER = LoggerFactory.getLogger(VerifyQUnitTests.class);

	private WebDriver operaDriver;
	private WebDriver firefoxDriver;
	private WebDriver chromeDriver1, chromeDriver2;
	private final String port = "9999";

	@Before
	public void setUp()
	{

		this.operaDriver = new OperaDriver();
		this.operaDriver.get("http://localhost:" + this.port + "/");

		this.firefoxDriver = new FirefoxDriver();
		this.firefoxDriver.get("http://localhost:" + this.port + "/");

		System.setProperty("webdriver.chrome.driver", "/home/nostromo/chromedriver");
		this.chromeDriver1 = new ChromeDriver();
		this.chromeDriver1.get("http://localhost:" + this.port + "/");

		this.chromeDriver2 = new ChromeDriver();
		this.chromeDriver2.get("http://localhost:" + this.port + "/");


	}

	@Test
	public void testQunit()
	{
		final WebElement parent1 = this.chromeDriver1.findElement(By.id("qunit-testresult"));
		final String chromePassed1 = parent1.findElement(By.className("passed")).getText();
		final String chromeTotal1 = parent1.findElement(By.className("total")).getText();
		final String chromeFailed1 = parent1.findElement(By.className("failed")).getText();

		Assert.assertEquals("8", chromePassed1);
		Assert.assertEquals("8", chromeTotal1);
		Assert.assertEquals("0", chromeFailed1);

		final WebElement parent2 = this.chromeDriver2.findElement(By.id("qunit-testresult"));
		final String chromePassed2 = parent2.findElement(By.className("passed")).getText();
		final String chromeTotal2 = parent2.findElement(By.className("total")).getText();
		final String chromeFailed2 = parent2.findElement(By.className("failed")).getText();

		Assert.assertEquals("8", chromePassed2);
		Assert.assertEquals("8", chromeTotal2);
		Assert.assertEquals("0", chromeFailed2);

		final WebElement parent3 = this.firefoxDriver.findElement(By.id("qunit-testresult"));
		final String firefoxPassed3 = parent3.findElement(By.className("passed")).getText();
		final String firefoxTotal3 = parent3.findElement(By.className("total")).getText();
		final String firefoxFailed3 = parent3.findElement(By.className("failed")).getText();
<commit_msg>added a timer for qunit tests<commit_after>package org.alienlabs.hatchetharry.integrationTest;

import junit.framework.Assert;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.opera.core.systems.OperaDriver;

public class VerifyQUnitTests
{
	private static final Logger LOGGER = LoggerFactory.getLogger(VerifyQUnitTests.class);

	private WebDriver operaDriver;
	private WebDriver firefoxDriver;
	private WebDriver chromeDriver1, chromeDriver2;
	private final String port = "9999";

	@Before
	public void setUp() throws InterruptedException
	{

		this.operaDriver = new OperaDriver();
		this.operaDriver.get("http://localhost:" + this.port + "/");

		this.firefoxDriver = new FirefoxDriver();
		this.firefoxDriver.get("http://localhost:" + this.port + "/");

		System.setProperty("webdriver.chrome.driver", "/home/nostromo/chromedriver");
		this.chromeDriver1 = new ChromeDriver();
		this.chromeDriver1.get("http://localhost:" + this.port + "/");

		this.chromeDriver2 = new ChromeDriver();
		this.chromeDriver2.get("http://localhost:" + this.port + "/");

		Thread.sleep(3000);
	}

	@Test
	public void testQunit()
	{
		final WebElement parent1 = this.chromeDriver1.findElement(By.id("qunit-testresult"));
		final String chromePassed1 = parent1.findElement(By.className("passed")).getText();
		final String chromeTotal1 = parent1.findElement(By.className("total")).getText();
		final String chromeFailed1 = parent1.findElement(By.className("failed")).getText();

		Assert.assertEquals("8", chromePassed1);
		Assert.assertEquals("8", chromeTotal1);
		Assert.assertEquals("0", chromeFailed1);

		final WebElement parent2 = this.chromeDriver2.findElement(By.id("qunit-testresult"));
		final String chromePassed2 = parent2.findElement(By.className("passed")).getText();
		final String chromeTotal2 = parent2.findElement(By.className("total")).getText();
		final String chromeFailed2 = parent2.findElement(By.className("failed")).getText();

		Assert.assertEquals("8", chromePassed2);
		Assert.assertEquals("8", chromeTotal2);
		Assert.assertEquals("0", chromeFailed2);

		final WebElement parent3 = this.firefoxDriver.findElement(By.id("qunit-testresult"));
		final String firefoxPassed3 = parent3.findElement(By.className("passed")).getText();
		final String firefoxTotal3 = parent3.findElement(By.className("total")).getText();
		final String firefoxFailed3 = parent3.findElement(By.className("failed")).getText();

{'fraction_non_alphanumeric': 0.14000373343289155, 'fraction_numerical': 0.018293821168564494, 'mean_word_length': 6.059288537549407, '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': '142602', 'n_tokens_mistral': 1760, 'n_tokens_neox': 1616, 'n_words': 288}