<commit_before>const webdriver = require("selenium-webdriver");
const driver = new webdriver.Builder().withCapabilities(webdriver.Capabilities.chrome()).build();

console.log("Loading...");
driver.get("file:///" + __dirname + "/index.html");
driver.takeScreenshot().then((data) => {
    require("fs").writeFileSync("screenshot.png", data, "base64");
});
console.log("Wait for test results...");
driver.findElement(webdriver.By.id("mocha-stats"));
const result = driver.executeScript(`
    const passedTests = document.querySelectorAll(".test.pass");
    const failedTests = document.querySelectorAll(".test.fail");
    return {
        passed: passedTests.length
        failed: failedTests.length
    };
`);

console.log("Test result :");
console.log(result.passed + " test(s) passed.");
console.log(result.failed + " test(s) failed.");

console.log("Tear down...");
driver.quit();

if (result.failed) {
    process.exit(1);
}
//process.exit(0);
<commit_msg>Setting circleci up<commit_after>const webdriver = require("selenium-webdriver");
const driver = new webdriver.Builder().withCapabilities(webdriver.Capabilities.chrome()).build();

console.log("Loading...");
driver.get("file:///" + __dirname + "/index.html");
console.log("Wait for test results...");
driver.findElement(webdriver.By.id("mocha-stats")).then(() => {
    driver.takeScreenshot().then((data) => {
        require("fs").writeFileSync("screenshot.png", data, "base64");
    });
    const result = driver.executeScript(`
        const passedTests = document.querySelectorAll(".test.pass");
        const failedTests = document.querySelectorAll(".test.fail");
        return {
            passed: passedTests.length
            failed: failedTests.length
        };
    `);
    console.log(result.passed + " test(s) passed.");
    console.log(result.failed + " test(s) failed.");
    driver.quit();
});

{'fraction_non_alphanumeric': 0.18813468733297703, 'fraction_numerical': 0.003206841261357563, 'mean_word_length': 4.073170731707317, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '1491998', 'n_tokens_mistral': 557, 'n_tokens_neox': 549, 'n_words': 92}