<commit_before>const { join } = require('path');

const fs = require('fs');
var path = require('path');
var VisualRegressionCompare = require('wdio-novus-visual-regression-service/compare');
var getScreenshotName = require('./getScreenshotName');

const CustomReporter = require('./customReporter.v6');

const debug = process.env.DEBUG;
const defaultTimeoutInterval = 180000;
var defaultMaxInstances = 2;

let screenshotRoot = process.env.SCREENSHOT_DIRECTORY;

// correct if screenshot directory has trailing slash
screenshotRoot = screenshotRoot.replace(/\/$/, '');

var diffDir = path.join(process.cwd(), `${screenshotRoot}/diff/`);
var refDir = path.join(process.cwd(), `${screenshotRoot}/reference/`);
var screenDir = path.join(process.cwd(), `${screenshotRoot}/screen/`);
var errorDir =
    (process.env.JUNIT_REPORT_PATH || './shared/results/') + 'errors/';

console.log(`ENV SCREENSHOT_DIRECTORY: ${process.env.SCREENSHOT_DIRECTORY}`);
console.log(`ENV JUNIT_REPORT_PATH PATH: ${process.env.JUNIT_REPORT_PATH}`);
console.log(`ENV JUNIT_REPORT_PATH PATH: ${process.env.JUNIT_REPORT_PATH}`);

console.log(`screenshot root: ${screenshotRoot}`);
console.log(`diff dir: ${diffDir}`);
console.log(`ref dir: ${refDir}`);
console.log(`screen dir: ${screenDir}`);

const LocalCompare = new VisualRegressionCompare.LocalCompare({
    referenceName: getScreenshotName(refDir),
    screenshotName: getScreenshotName(screenDir),
    diffName: getScreenshotName(diffDir),
    misMatchTolerance: 0.1,
});

function proxyComparisonMethod(target) {
    const oldProcessScreenshot = target.processScreenshot;<commit_msg>set e2e instances to 1<commit_after>const { join } = require('path');

const fs = require('fs');
var path = require('path');
var VisualRegressionCompare = require('wdio-novus-visual-regression-service/compare');
var getScreenshotName = require('./getScreenshotName');

const CustomReporter = require('./customReporter.v6');

const debug = process.env.DEBUG;
const defaultTimeoutInterval = 180000;
var defaultMaxInstances = 1;

let screenshotRoot = process.env.SCREENSHOT_DIRECTORY;

// correct if screenshot directory has trailing slash
screenshotRoot = screenshotRoot.replace(/\/$/, '');

var diffDir = path.join(process.cwd(), `${screenshotRoot}/diff/`);
var refDir = path.join(process.cwd(), `${screenshotRoot}/reference/`);
var screenDir = path.join(process.cwd(), `${screenshotRoot}/screen/`);
var errorDir =
    (process.env.JUNIT_REPORT_PATH || './shared/results/') + 'errors/';

console.log(`ENV SCREENSHOT_DIRECTORY: ${process.env.SCREENSHOT_DIRECTORY}`);
console.log(`ENV JUNIT_REPORT_PATH PATH: ${process.env.JUNIT_REPORT_PATH}`);
console.log(`ENV JUNIT_REPORT_PATH PATH: ${process.env.JUNIT_REPORT_PATH}`);

console.log(`screenshot root: ${screenshotRoot}`);
console.log(`diff dir: ${diffDir}`);
console.log(`ref dir: ${refDir}`);
console.log(`screen dir: ${screenDir}`);

const LocalCompare = new VisualRegressionCompare.LocalCompare({
    referenceName: getScreenshotName(refDir),
    screenshotName: getScreenshotName(screenDir),
    diffName: getScreenshotName(diffDir),
    misMatchTolerance: 0.1,
});

function proxyComparisonMethod(target) {
    const oldProcessScreenshot = target.processScreenshot;
{'fraction_non_alphanumeric': 0.1536079281511304, 'fraction_numerical': 0.006813254877671105, 'mean_word_length': 6.6, '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': '2875954', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1049, 'n_words': 195}