regressify 1.0.35 → 1.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.engine_scripts/playwright/login-user.js +1 -1
- package/.engine_scripts/puppet/login-user.js +1 -1
- package/package.json +1 -1
- package/src/config.d.ts +2 -0
- package/src/config.js +165 -0
- package/src/config.js.map +1 -0
- package/src/helpers.d.ts +4 -0
- package/src/helpers.js +28 -0
- package/src/helpers.js.map +1 -0
- package/src/index.d.ts +2 -0
- package/src/index.js.map +1 -0
- package/src/initialization/generate-tests.d.ts +2 -0
- package/src/initialization/generate-tests.js +52 -0
- package/src/initialization/generate-tests.js.map +1 -0
- package/src/initialization/init.d.ts +1 -0
- package/src/initialization/init.js +8 -0
- package/src/initialization/init.js.map +1 -0
- package/src/initialization/update-package.d.ts +1 -0
- package/src/initialization/update-package.js +23 -0
- package/src/initialization/update-package.js.map +1 -0
- package/src/regressify.d.ts +1 -0
- package/src/regressify.js +48 -0
- package/src/regressify.js.map +1 -0
- package/src/replacements.d.ts +1 -0
- package/src/replacements.js +26 -0
- package/src/replacements.js.map +1 -0
- package/src/scenarios.d.ts +2 -0
- package/src/scenarios.js +19 -0
- package/src/scenarios.js.map +1 -0
- package/src/types.d.ts +42 -0
- package/src/types.js +2 -0
- package/src/types.js.map +1 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/.github/workflows/deploy.yml +0 -39
- package/.vscode/settings.json +0 -57
- package/src/config.ts +0 -189
- package/src/helpers.ts +0 -30
- package/src/initialization/generate-tests.ts +0 -29
- package/src/initialization/init.ts +0 -7
- package/src/initialization/update-package.ts +0 -25
- package/src/regressify.ts +0 -51
- package/src/replacements.ts +0 -32
- package/src/scenarios.ts +0 -21
- package/src/types.ts +0 -44
- /package/{visual_tests → common}/_cookies.yaml +0 -0
- /package/{visual_tests → common}/_on-ready.js +0 -0
- /package/{visual_tests → common}/_override.css +0 -0
- /package/{visual_tests → common}/_replacement-profiles.yaml +0 -0
- /package/{visual_tests → common}/_signing-in.yaml +0 -0
- /package/{visual_tests → common}/_viewports.yaml +0 -0
|
@@ -10,7 +10,7 @@ const globalData = {
|
|
|
10
10
|
};
|
|
11
11
|
// loginAndSaveCookies.ts
|
|
12
12
|
const getSignInData = async () => {
|
|
13
|
-
const signInPath = '
|
|
13
|
+
const signInPath = 'common/_signing-in.yaml';
|
|
14
14
|
let signInConfig = [];
|
|
15
15
|
// Read Cookies from File, if exists
|
|
16
16
|
if (!!signInPath && fs.existsSync(signInPath)) {
|
|
@@ -10,7 +10,7 @@ const globalData = {
|
|
|
10
10
|
};
|
|
11
11
|
// loginAndSaveCookies.ts
|
|
12
12
|
const getSignInData = async () => {
|
|
13
|
-
const signInPath = '
|
|
13
|
+
const signInPath = 'common/_signing-in.yaml';
|
|
14
14
|
let signInConfig = [];
|
|
15
15
|
// Read Cookies from File, if exists
|
|
16
16
|
if (!!signInPath && fs.existsSync(signInPath)) {
|
package/package.json
CHANGED
package/src/config.d.ts
ADDED
package/src/config.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import { createScenario } from './scenarios.js';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { getFlagArg, getStringArg, parseDataFromFile, getLibraryPath } from './helpers.js';
|
|
5
|
+
import chalk from 'chalk';
|
|
6
|
+
import { exit } from 'process';
|
|
7
|
+
import YAML from 'js-yaml';
|
|
8
|
+
import { getTestUrl } from './replacements.js';
|
|
9
|
+
const libraryPath = getLibraryPath();
|
|
10
|
+
const engine = 'playwright';
|
|
11
|
+
function getArgConfig(args) {
|
|
12
|
+
const testSuite = getStringArg(args, '--test-suite');
|
|
13
|
+
const isRef = getFlagArg(args, '--ref');
|
|
14
|
+
const globalRequiredLogin = getFlagArg(args, '--requiredLogin');
|
|
15
|
+
if (globalRequiredLogin) {
|
|
16
|
+
console.log('force run all scenarios in login mode');
|
|
17
|
+
}
|
|
18
|
+
if (!testSuite) {
|
|
19
|
+
console.log(chalk.red('Argument `--test-suite` must be set.'));
|
|
20
|
+
console.log(chalk.red('Sample command: npm run <command> -- --test-suite <test-suite>'));
|
|
21
|
+
console.log(chalk.red('Command is either `ref`, `approve` or `test`.'));
|
|
22
|
+
exit(1);
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
testSuite,
|
|
26
|
+
isRef,
|
|
27
|
+
globalRequiredLogin,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function getScriptPath(scriptPath, engine) {
|
|
31
|
+
return path.join(libraryPath, '.engine_scripts', (engine == 'puppeteer' ? 'puppet' : 'playwright') + scriptPath);
|
|
32
|
+
}
|
|
33
|
+
function getData(testSuite) {
|
|
34
|
+
let extensions = [
|
|
35
|
+
{
|
|
36
|
+
ext: 'yaml',
|
|
37
|
+
parse: YAML.load,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
ext: 'yml',
|
|
41
|
+
parse: YAML.load,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
ext: 'json',
|
|
45
|
+
parse: JSON.parse,
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
for (let i = 0; i < extensions.length; i++) {
|
|
49
|
+
const dataPath = path.join(process.cwd(), 'visual_tests', `${testSuite}.tests.${extensions[i].ext}`);
|
|
50
|
+
if (fs.existsSync(dataPath)) {
|
|
51
|
+
console.log('Data path: ', dataPath);
|
|
52
|
+
const content = fs.readFileSync(dataPath, 'utf-8');
|
|
53
|
+
return extensions[i].parse(content);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
throw `Data file not found for test suite: ${testSuite}`;
|
|
57
|
+
}
|
|
58
|
+
function expandScenarios(model, scenarios, level) {
|
|
59
|
+
if (level > 100) {
|
|
60
|
+
throw 'Level is too large';
|
|
61
|
+
}
|
|
62
|
+
if (!model.needs) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const neededActions = [];
|
|
66
|
+
if (typeof model.needs === 'string') {
|
|
67
|
+
neededActions.push(model.needs);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
model.needs.forEach((n) => neededActions.push(n));
|
|
71
|
+
}
|
|
72
|
+
neededActions.reverse().forEach((n) => {
|
|
73
|
+
const targetScenarios = scenarios.filter((s) => !!s.id && s.id.toLowerCase() == n.toLowerCase());
|
|
74
|
+
if (targetScenarios.length !== 1) {
|
|
75
|
+
throw `The test suite must contains exactly ONE scenario with id: ${n}`;
|
|
76
|
+
}
|
|
77
|
+
var targetScenario = targetScenarios[0];
|
|
78
|
+
expandScenarios(targetScenario, scenarios, level + 1);
|
|
79
|
+
if (!!targetScenario.actions) {
|
|
80
|
+
if (!model.actions) {
|
|
81
|
+
model.actions = [];
|
|
82
|
+
}
|
|
83
|
+
model.actions = [...targetScenario.actions, ...model.actions];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
model.needs = undefined;
|
|
87
|
+
}
|
|
88
|
+
function getScenarios(args, testSuite, isRef, globalRequiredLogin) {
|
|
89
|
+
const scenarios = [];
|
|
90
|
+
const data = getData(testSuite);
|
|
91
|
+
const viewports = parseDataFromFile(data?.viewportsPath ?? 'common/_viewports.yaml');
|
|
92
|
+
if (data) {
|
|
93
|
+
[].forEach.call(data.scenarios, (s) => {
|
|
94
|
+
expandScenarios(s, data.scenarios, 0);
|
|
95
|
+
});
|
|
96
|
+
const getTestUrlLocal = (url) => getTestUrl(args, url, isRef);
|
|
97
|
+
const pad = String(data?.scenarios.length).length;
|
|
98
|
+
data.scenarios.forEach((s, index) => {
|
|
99
|
+
const opts = {
|
|
100
|
+
...s,
|
|
101
|
+
requiredLogin: globalRequiredLogin || s.requiredLogin,
|
|
102
|
+
getTestUrl: getTestUrlLocal,
|
|
103
|
+
url: isRef ? s.url : getTestUrl(args, s.url, isRef),
|
|
104
|
+
index: String(index + 1).padStart(pad, ' '),
|
|
105
|
+
total: data.scenarios.length,
|
|
106
|
+
delay: s.delay ?? 1000,
|
|
107
|
+
hideSelectors: s.hideSelectors ?? data.hideSelectors,
|
|
108
|
+
removeSelectors: s.removeSelectors ?? data.removeSelectors,
|
|
109
|
+
useCssOverride: s.useCssOverride ?? data.useCssOverride,
|
|
110
|
+
jsOnReadyPath: s.jsOnReadyPath,
|
|
111
|
+
viewports: !!s.viewportNames
|
|
112
|
+
? typeof s.viewportNames === 'string'
|
|
113
|
+
? viewports.filter((v) => v.label.toLowerCase() == s.viewportNames.trim().toLowerCase())
|
|
114
|
+
: viewports.filter((v) => s.viewportNames?.includes(v.label))
|
|
115
|
+
: !!data.viewportNames
|
|
116
|
+
? typeof data.viewportNames === 'string'
|
|
117
|
+
? viewports.filter((v) => v.label.toLowerCase() == data.viewportNames.trim().toLowerCase())
|
|
118
|
+
: viewports.filter((v) => data.viewportNames?.includes(v.label))
|
|
119
|
+
: undefined,
|
|
120
|
+
referenceUrl: !isRef ? s.url : undefined,
|
|
121
|
+
misMatchThreshold: s.misMatchThreshold ?? data.misMatchThreshold ?? 0.1,
|
|
122
|
+
postInteractionWait: s.postInteractionWait ?? data.postInteractionWait ?? 1,
|
|
123
|
+
};
|
|
124
|
+
const scenario = createScenario(opts);
|
|
125
|
+
scenarios.push(scenario);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return { scenarios, data, viewports };
|
|
129
|
+
}
|
|
130
|
+
export function getConfig(args) {
|
|
131
|
+
const { testSuite, isRef, globalRequiredLogin } = getArgConfig(args);
|
|
132
|
+
const { scenarios, data, viewports } = getScenarios(args, testSuite, isRef, globalRequiredLogin);
|
|
133
|
+
return {
|
|
134
|
+
id: testSuite,
|
|
135
|
+
viewports,
|
|
136
|
+
onBeforeScript: getScriptPath('/onBefore.js', engine),
|
|
137
|
+
onReadyScript: getScriptPath('/onReady.js', engine),
|
|
138
|
+
scenarios,
|
|
139
|
+
paths: {
|
|
140
|
+
bitmaps_reference: '.backstop/' + testSuite + '/bitmaps_reference',
|
|
141
|
+
bitmaps_test: '.backstop/' + testSuite + '/bitmaps_test',
|
|
142
|
+
engine_scripts: `${getLibraryPath()}/.engine_scripts`,
|
|
143
|
+
html_report: '.backstop/' + testSuite + '/html_report',
|
|
144
|
+
ci_report: '.backstop/' + testSuite + '/ci_report',
|
|
145
|
+
},
|
|
146
|
+
report: [isRef ? 'CI' : 'browser'],
|
|
147
|
+
engine,
|
|
148
|
+
engineOptions: {
|
|
149
|
+
args: [
|
|
150
|
+
'--disable-infobars',
|
|
151
|
+
'--disable-setuid-sandbox',
|
|
152
|
+
'--ignore-certifcate-errors',
|
|
153
|
+
'--ignore-certifcate-errors-spki-list',
|
|
154
|
+
'--no-sandbox',
|
|
155
|
+
'--window-position=0,0',
|
|
156
|
+
],
|
|
157
|
+
browser: data?.browser ?? 'chromium',
|
|
158
|
+
},
|
|
159
|
+
asyncCaptureLimit: data?.asyncCaptureLimit ?? 5,
|
|
160
|
+
asyncCompareLimit: data?.asyncCompareLimit ?? 50,
|
|
161
|
+
debug: false,
|
|
162
|
+
debugWindow: data?.debug,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE3F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;AACrC,MAAM,MAAM,GAA+B,YAAY,CAAC;AA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,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC;IAEjG,OAAO;QACL,EAAE,EAAE,SAAS;QACb,SAAS;QACT,cAAc,EAAE,aAAa,CAAC,cAAc,EAAE,MAAM,CAAC;QACrD,aAAa,EAAE,aAAa,CAAC,aAAa,EAAE,MAAM,CAAC;QACnD,SAAS;QACT,KAAK,EAAE;YACL,iBAAiB,EAAE,YAAY,GAAG,SAAS,GAAG,oBAAoB;YAClE,YAAY,EAAE,YAAY,GAAG,SAAS,GAAG,eAAe;YACxD,cAAc,EAAE,GAAG,cAAc,EAAE,kBAAkB;YACrD,WAAW,EAAE,YAAY,GAAG,SAAS,GAAG,cAAc;YACtD,SAAS,EAAE,YAAY,GAAG,SAAS,GAAG,YAAY;SACnD;QACD,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;QAClC,MAAM;QACN,aAAa,EAAE;YACb,IAAI,EAAE;gBACJ,oBAAoB;gBACpB,0BAA0B;gBAC1B,4BAA4B;gBAC5B,sCAAsC;gBACtC,cAAc;gBACd,uBAAuB;aACxB;YACD,OAAO,EAAE,IAAI,EAAE,OAAO,IAAI,UAAU;SACrC;QACD,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,IAAI,CAAC;QAC/C,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,IAAI,EAAE;QAChD,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,IAAI,EAAE,KAAK;KACf,CAAC;AACd,CAAC"}
|
package/src/helpers.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const getStringArg: (args: string[], key: string) => string | undefined;
|
|
2
|
+
export declare const getFlagArg: (args: string[], key: string) => boolean;
|
|
3
|
+
export declare const parseDataFromFile: (dataPath: string, type?: "yaml" | "json") => unknown | undefined;
|
|
4
|
+
export declare function getLibraryPath(): string;
|
package/src/helpers.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import YAML from 'js-yaml';
|
|
3
|
+
import { dirname } from 'path';
|
|
4
|
+
import slash from 'slash';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
export const getStringArg = (args, key) => {
|
|
7
|
+
const index = args.indexOf(key);
|
|
8
|
+
return index >= 0 && index < args.length - 1 && !args[index + 1].startsWith('-') ? args[index + 1] : undefined;
|
|
9
|
+
};
|
|
10
|
+
export const getFlagArg = (args, key) => {
|
|
11
|
+
return args.indexOf(key) >= 0;
|
|
12
|
+
};
|
|
13
|
+
export const parseDataFromFile = (dataPath, type = 'yaml') => {
|
|
14
|
+
if (!!dataPath && fs.existsSync(dataPath)) {
|
|
15
|
+
let content = fs.readFileSync(dataPath, 'utf-8');
|
|
16
|
+
if (type === 'json') {
|
|
17
|
+
return JSON.parse(content);
|
|
18
|
+
}
|
|
19
|
+
else if (type === 'yaml') {
|
|
20
|
+
return YAML.load(content);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
export function getLibraryPath() {
|
|
25
|
+
const fileName = fileURLToPath(import.meta.url);
|
|
26
|
+
return slash(dirname(dirname(fileName)));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAc,EAAE,GAAW,EAAsB,EAAE;IAC9E,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC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;IACL,CAAC;IAED,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QAC/B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,4BAA4B,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAEtC,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;IACvB,MAAM,cAAc,EAAE,CAAC;AACzB,CAAC;KAAM,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;IAC7B,MAAM,iBAAiB,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC;KAAM,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;IACjC,MAAM,iBAAiB,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;KAAM,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;IAC9B,MAAM,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,yHAAyH,CAAC,CAAC,CAAC;IAClJ,IAAI,CAAC,CAAC,CAAC,CAAC;AACV,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import pkg from 'ncp';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { getLibraryPath } from '../helpers.js';
|
|
6
|
+
import slash from 'slash';
|
|
7
|
+
const { ncp } = pkg;
|
|
8
|
+
export async function initCommonFolder() {
|
|
9
|
+
try {
|
|
10
|
+
const sourceFolder = slash(path.join(getLibraryPath(), 'common'));
|
|
11
|
+
const destinationFolder = path.join(process.cwd(), 'common');
|
|
12
|
+
if (!fs.existsSync(destinationFolder)) {
|
|
13
|
+
ncp(sourceFolder, destinationFolder, function (err) {
|
|
14
|
+
if (err) {
|
|
15
|
+
console.log(chalk.red('Error copying folder:'), err);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
console.log(chalk.green('Folder "common" has been copied to your project!'));
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
console.log(chalk.yellow('Folder "common" already exists.'));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.log(chalk.red(error));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export async function initVisualTestsFolder() {
|
|
31
|
+
try {
|
|
32
|
+
const sourceFolder = slash(path.join(getLibraryPath(), 'visual_tests'));
|
|
33
|
+
const destinationFolder = path.join(process.cwd(), 'visual_tests');
|
|
34
|
+
if (!fs.existsSync(destinationFolder)) {
|
|
35
|
+
ncp(sourceFolder, destinationFolder, function (err) {
|
|
36
|
+
if (err) {
|
|
37
|
+
console.log(chalk.red('Error copying folder:'), err);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
console.log(chalk.green('Folder "visual_tests" has been copied to your project!'));
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
console.log(chalk.yellow('Folder "visual_tests" already exists.'));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
console.log(chalk.red(error));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=generate-tests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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AAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB;IACzC,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;QACxE,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;QAEnE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;YACtC,GAAG,CAAC,YAAY,EAAE,iBAAiB,EAAE,UAAU,GAAG;gBAChD,IAAI,GAAG,EAAE,CAAC;oBACR,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,uBAAuB,CAAC,EAAE,GAAG,CAAC,CAAC;gBACvD,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC,CAAC;gBACrF,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,uCAAuC,CAAC,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAChC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function initRegressify(): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { initCommonFolder, initVisualTestsFolder } from './generate-tests.js';
|
|
2
|
+
import { updatePackageJson } from './update-package.js';
|
|
3
|
+
export async function initRegressify() {
|
|
4
|
+
await initCommonFolder();
|
|
5
|
+
await initVisualTestsFolder();
|
|
6
|
+
await updatePackageJson();
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,MAAM,gBAAgB,EAAE,CAAC;IACzB,MAAM,qBAAqB,EAAE,CAAC;IAC9B,MAAM,iBAAiB,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function updatePackageJson(): Promise<void>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
export async function updatePackageJson() {
|
|
5
|
+
try {
|
|
6
|
+
const packageJsonPath = path.join(process.cwd(), 'package.json');
|
|
7
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
8
|
+
console.log(chalk.red("package.json file doesn't exists"));
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const packageJsonText = fs.readFileSync(packageJsonPath, 'utf8');
|
|
12
|
+
const packageJson = JSON.parse(packageJsonText);
|
|
13
|
+
packageJson.scripts = packageJson.scripts || {};
|
|
14
|
+
packageJson.scripts.ref = 'regressify ref';
|
|
15
|
+
packageJson.scripts.approve = 'regressify approve';
|
|
16
|
+
packageJson.scripts.test = 'regressify test';
|
|
17
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
console.log(chalk.red(error));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=update-package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-package.js","sourceRoot":"","sources":["update-package.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,IAAI,CAAC;QACH,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;QACjE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;YACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC,CAAC;YAC3D,OAAO;QACT,CAAC;QAED,MAAM,eAAe,GAAG,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QACjE,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAEhD,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,IAAI,EAAE,CAAC;QAChD,WAAW,CAAC,OAAO,CAAC,GAAG,GAAG,gBAAgB,CAAC;QAC3C,WAAW,CAAC,OAAO,CAAC,OAAO,GAAG,oBAAoB,CAAC;QACnD,WAAW,CAAC,OAAO,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAE7C,EAAE,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAChC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function regressifyProcess(command: 'approve' | 'reference' | 'test', args: string[]): Promise<void>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import backstop from 'backstopjs';
|
|
3
|
+
import { getLibraryPath } from './helpers.js';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import { getConfig } from './config.js';
|
|
7
|
+
const PATCH_START = '<!-- PATCH START -->';
|
|
8
|
+
const PATCH_END = '<!-- PATCH END -->';
|
|
9
|
+
const customStyle = `
|
|
10
|
+
${PATCH_START}
|
|
11
|
+
<style>
|
|
12
|
+
[id^="test"] > div[display="true"] > p[display] {
|
|
13
|
+
white-space: pre;
|
|
14
|
+
overflow-x: auto;
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
${PATCH_END}
|
|
18
|
+
`;
|
|
19
|
+
export async function regressifyProcess(command, args) {
|
|
20
|
+
packCompare();
|
|
21
|
+
const config = getConfig(args);
|
|
22
|
+
backstop(command, { config })
|
|
23
|
+
.then(() => {
|
|
24
|
+
console.log(chalk.green(command.toUpperCase() + ' FINISHED SUCCESSFULLY'));
|
|
25
|
+
})
|
|
26
|
+
.catch(() => {
|
|
27
|
+
console.log(chalk.red(command.toUpperCase() + ' FAILED'));
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function packCompare() {
|
|
31
|
+
const reportIndex = path.resolve(getLibraryPath(), 'node_modules/backstopjs/compare/output/index.html');
|
|
32
|
+
if (fs.existsSync(reportIndex)) {
|
|
33
|
+
let html = fs.readFileSync(reportIndex, 'utf-8');
|
|
34
|
+
const patchStartIndex = html.indexOf(PATCH_START);
|
|
35
|
+
const patchEndIndex = html.indexOf(PATCH_END);
|
|
36
|
+
if (patchStartIndex > 0 && patchEndIndex > patchStartIndex) {
|
|
37
|
+
html = html.replace(new RegExp(PATCH_START + '.*' + patchEndIndex, 'gi'), customStyle);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
html = html.replace('</head>', customStyle + '</head>');
|
|
41
|
+
}
|
|
42
|
+
fs.writeFileSync(reportIndex, html);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
console.log(chalk.red('File does not exist: ' + reportIndex));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=regressify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regressify.js","sourceRoot":"","sources":["regressify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAC3C,MAAM,SAAS,GAAG,oBAAoB,CAAC;AAEvC,MAAM,WAAW,GAAG;EAClB,WAAW;;;;;;;EAOX,SAAS;CACV,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAAyC,EAAE,IAAc;IAC/F,WAAW,EAAE,CAAC;IAEd,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAE/B,QAAQ,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC;SAC1B,IAAI,CAAC,GAAG,EAAE;QACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,wBAAwB,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC;SACD,KAAK,CAAC,GAAG,EAAE;QACV,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,WAAW;IAClB,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,mDAAmD,CAAC,CAAC;IACxG,IAAI,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,IAAI,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACjD,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAClD,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC9C,IAAI,eAAe,GAAG,CAAC,IAAI,aAAa,GAAG,eAAe,EAAE,CAAC;YAC3D,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,WAAW,GAAG,IAAI,GAAG,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC;QACzF,CAAC;aAAM,CAAC;YACN,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,WAAW,GAAG,SAAS,CAAC,CAAC;QAC1D,CAAC;QACD,EAAE,CAAC,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,uBAAuB,GAAG,WAAW,CAAC,CAAC,CAAC;IAChE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getTestUrl: (args: string[], url: string, isRef: boolean) => string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import YAML from 'js-yaml';
|
|
4
|
+
import { getLibraryPath, getStringArg } from './helpers.js';
|
|
5
|
+
import slash from 'slash';
|
|
6
|
+
function getReplacementProfile(args) {
|
|
7
|
+
const replacementProfileName = getStringArg(args, 'replacement-profile') ?? process.env.REPLACEMENT_PROFILE;
|
|
8
|
+
if (!!replacementProfileName) {
|
|
9
|
+
const replacementProfilePath = slash(path.join(getLibraryPath(), 'common', '_replacement-profiles.yaml'));
|
|
10
|
+
if (!fs.existsSync(replacementProfilePath)) {
|
|
11
|
+
throw "Replacement profile doesn't exist: " + replacementProfilePath;
|
|
12
|
+
}
|
|
13
|
+
const profiles = YAML.load(fs.readFileSync(replacementProfilePath, 'utf-8'));
|
|
14
|
+
return profiles.profiles[replacementProfileName];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export const getTestUrl = (args, url, isRef) => {
|
|
18
|
+
const replacementProfile = getReplacementProfile(args);
|
|
19
|
+
if (isRef || !replacementProfile) {
|
|
20
|
+
return url;
|
|
21
|
+
}
|
|
22
|
+
let testUrl = url;
|
|
23
|
+
replacementProfile.forEach((e) => (testUrl = testUrl.replace(e.ref, e.test)));
|
|
24
|
+
return testUrl;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=replacements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replacements.js","sourceRoot":"","sources":["replacements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,SAAS,qBAAqB,CAAC,IAAc;IAC3C,MAAM,sBAAsB,GAAG,YAAY,CAAC,IAAI,EAAE,qBAAqB,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IAC5G,IAAI,CAAC,CAAC,sBAAsB,EAAE,CAAC;QAC7B,MAAM,sBAAsB,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,4BAA4B,CAAC,CAAC,CAAC;QAC1G,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,sBAAsB,CAAC,EAAE,CAAC;YAC3C,MAAM,qCAAqC,GAAG,sBAAsB,CAAC;QACvE,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAsB,CAAC;QAClG,OAAO,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;IACnD,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAc,EAAE,GAAW,EAAE,KAAc,EAAE,EAAE;IACxE,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAEvD,IAAI,KAAK,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACjC,OAAO,GAAG,CAAC;IACb,CAAC;IAED,IAAI,OAAO,GAAG,GAAG,CAAC;IAClB,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAE9E,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
package/src/scenarios.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const createScenario = (opts) => {
|
|
2
|
+
const parsedUrl = new URL(opts.url);
|
|
3
|
+
return {
|
|
4
|
+
...opts,
|
|
5
|
+
label: opts.label ?? `${opts.index} of ${opts.total}: ${parsedUrl.pathname}`,
|
|
6
|
+
cookiePath: opts.cookiePath ?? 'common/_cookies.yaml',
|
|
7
|
+
cssOverridePath: opts.cssOverridePath ?? 'common/_override.css',
|
|
8
|
+
jsOnReadyPath: opts.jsOnReadyPath ?? 'common/_on-ready.js',
|
|
9
|
+
referenceUrl: opts.referenceUrl ?? '',
|
|
10
|
+
readyEvent: '',
|
|
11
|
+
hideSelectors: opts.hideSelectors ?? [],
|
|
12
|
+
removeSelectors: opts.removeSelectors ?? [],
|
|
13
|
+
selectors: [],
|
|
14
|
+
selectorExpansion: true,
|
|
15
|
+
expect: 0,
|
|
16
|
+
requireSameDimensions: true,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=scenarios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenarios.js","sourceRoot":"","sources":["scenarios.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAmB,EAAiB,EAAE;IACnE,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEpC,OAAO;QACL,GAAG,IAAI;QACP,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,QAAQ,EAAE;QAC5E,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,sBAAsB;QACrD,eAAe,EAAE,IAAI,CAAC,eAAe,IAAI,sBAAsB;QAC/D,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,qBAAqB;QAC1D,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,EAAE;QACrC,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,EAAE;QACvC,eAAe,EAAE,IAAI,CAAC,eAAe,IAAI,EAAE;QAC3C,SAAS,EAAE,EAAE;QACb,iBAAiB,EAAE,IAAI;QACvB,MAAM,EAAE,CAAC;QACT,qBAAqB,EAAE,IAAI;KAC5B,CAAC;AACJ,CAAC,CAAC"}
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Scenario } from 'backstopjs';
|
|
2
|
+
export interface ReplacementModel {
|
|
3
|
+
ref: string;
|
|
4
|
+
test: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ReplacementsModel {
|
|
7
|
+
profiles: {
|
|
8
|
+
[name: string]: ReplacementModel[];
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface TestSuiteModel {
|
|
12
|
+
urlReplacements?: ReplacementModel[];
|
|
13
|
+
scenarios: ScenarioModel[];
|
|
14
|
+
hideSelectors?: string[];
|
|
15
|
+
removeSelectors?: string[];
|
|
16
|
+
useCssOverride?: boolean;
|
|
17
|
+
cssOverridePath?: string;
|
|
18
|
+
viewportsPath?: string;
|
|
19
|
+
debug?: boolean;
|
|
20
|
+
asyncCaptureLimit?: number;
|
|
21
|
+
asyncCompareLimit?: number;
|
|
22
|
+
browser?: 'chromium' | 'firefox' | 'webkit';
|
|
23
|
+
misMatchThreshold?: number;
|
|
24
|
+
postInteractionWait?: number;
|
|
25
|
+
viewportNames?: string | string[];
|
|
26
|
+
}
|
|
27
|
+
export interface ScenarioModel extends Scenario {
|
|
28
|
+
requiredLogin?: boolean;
|
|
29
|
+
id?: string;
|
|
30
|
+
needs?: string | string[];
|
|
31
|
+
actions?: unknown[];
|
|
32
|
+
description: string;
|
|
33
|
+
cssOverridePath?: string;
|
|
34
|
+
index: string;
|
|
35
|
+
jsOnReadyPath?: string;
|
|
36
|
+
total: number;
|
|
37
|
+
viewportNames?: string | string[];
|
|
38
|
+
useCssOverride?: boolean;
|
|
39
|
+
noScrollTop?: boolean;
|
|
40
|
+
misMatchThreshold?: number;
|
|
41
|
+
postInteractionWait?: number;
|
|
42
|
+
}
|
package/src/types.js
ADDED
package/src/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["./node_modules/typescript/lib/lib.es5.d.ts","./node_modules/typescript/lib/lib.es2015.d.ts","./node_modules/typescript/lib/lib.es2016.d.ts","./node_modules/typescript/lib/lib.es2017.d.ts","./node_modules/typescript/lib/lib.es2018.d.ts","./node_modules/typescript/lib/lib.es2019.d.ts","./node_modules/typescript/lib/lib.es2020.d.ts","./node_modules/typescript/lib/lib.es2021.d.ts","./node_modules/typescript/lib/lib.es2022.d.ts","./node_modules/typescript/lib/lib.es2023.d.ts","./node_modules/typescript/lib/lib.es2024.d.ts","./node_modules/typescript/lib/lib.esnext.d.ts","./node_modules/typescript/lib/lib.dom.d.ts","./node_modules/typescript/lib/lib.dom.iterable.d.ts","./node_modules/typescript/lib/lib.es2015.core.d.ts","./node_modules/typescript/lib/lib.es2015.collection.d.ts","./node_modules/typescript/lib/lib.es2015.generator.d.ts","./node_modules/typescript/lib/lib.es2015.iterable.d.ts","./node_modules/typescript/lib/lib.es2015.promise.d.ts","./node_modules/typescript/lib/lib.es2015.proxy.d.ts","./node_modules/typescript/lib/lib.es2015.reflect.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2016.array.include.d.ts","./node_modules/typescript/lib/lib.es2016.intl.d.ts","./node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","./node_modules/typescript/lib/lib.es2017.date.d.ts","./node_modules/typescript/lib/lib.es2017.object.d.ts","./node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2017.string.d.ts","./node_modules/typescript/lib/lib.es2017.intl.d.ts","./node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","./node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","./node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","./node_modules/typescript/lib/lib.es2018.intl.d.ts","./node_modules/typescript/lib/lib.es2018.promise.d.ts","./node_modules/typescript/lib/lib.es2018.regexp.d.ts","./node_modules/typescript/lib/lib.es2019.array.d.ts","./node_modules/typescript/lib/lib.es2019.object.d.ts","./node_modules/typescript/lib/lib.es2019.string.d.ts","./node_modules/typescript/lib/lib.es2019.symbol.d.ts","./node_modules/typescript/lib/lib.es2019.intl.d.ts","./node_modules/typescript/lib/lib.es2020.bigint.d.ts","./node_modules/typescript/lib/lib.es2020.date.d.ts","./node_modules/typescript/lib/lib.es2020.promise.d.ts","./node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2020.string.d.ts","./node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2020.intl.d.ts","./node_modules/typescript/lib/lib.es2020.number.d.ts","./node_modules/typescript/lib/lib.es2021.promise.d.ts","./node_modules/typescript/lib/lib.es2021.string.d.ts","./node_modules/typescript/lib/lib.es2021.weakref.d.ts","./node_modules/typescript/lib/lib.es2021.intl.d.ts","./node_modules/typescript/lib/lib.es2022.array.d.ts","./node_modules/typescript/lib/lib.es2022.error.d.ts","./node_modules/typescript/lib/lib.es2022.intl.d.ts","./node_modules/typescript/lib/lib.es2022.object.d.ts","./node_modules/typescript/lib/lib.es2022.string.d.ts","./node_modules/typescript/lib/lib.es2022.regexp.d.ts","./node_modules/typescript/lib/lib.es2023.array.d.ts","./node_modules/typescript/lib/lib.es2023.collection.d.ts","./node_modules/typescript/lib/lib.es2023.intl.d.ts","./node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","./node_modules/typescript/lib/lib.es2024.collection.d.ts","./node_modules/typescript/lib/lib.es2024.object.d.ts","./node_modules/typescript/lib/lib.es2024.promise.d.ts","./node_modules/typescript/lib/lib.es2024.regexp.d.ts","./node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2024.string.d.ts","./node_modules/typescript/lib/lib.esnext.array.d.ts","./node_modules/typescript/lib/lib.esnext.collection.d.ts","./node_modules/typescript/lib/lib.esnext.intl.d.ts","./node_modules/typescript/lib/lib.esnext.disposable.d.ts","./node_modules/typescript/lib/lib.esnext.decorators.d.ts","./node_modules/typescript/lib/lib.esnext.iterator.d.ts","./node_modules/typescript/lib/lib.decorators.d.ts","./node_modules/typescript/lib/lib.decorators.legacy.d.ts","./node_modules/@types/backstopjs/index.d.ts","./src/types.ts","./src/scenarios.ts","./node_modules/@types/js-yaml/index.d.ts","./node_modules/slash/index.d.ts","./src/helpers.ts","./node_modules/chalk/source/vendor/ansi-styles/index.d.ts","./node_modules/chalk/source/vendor/supports-color/index.d.ts","./node_modules/chalk/source/index.d.ts","./src/replacements.ts","./src/config.ts","./node_modules/@types/node/compatibility/disposable.d.ts","./node_modules/@types/node/compatibility/indexable.d.ts","./node_modules/@types/node/compatibility/iterators.d.ts","./node_modules/@types/node/compatibility/index.d.ts","./node_modules/@types/node/globals.typedarray.d.ts","./node_modules/@types/node/buffer.buffer.d.ts","./node_modules/buffer/index.d.ts","./node_modules/undici-types/header.d.ts","./node_modules/undici-types/readable.d.ts","./node_modules/undici-types/file.d.ts","./node_modules/undici-types/fetch.d.ts","./node_modules/undici-types/formdata.d.ts","./node_modules/undici-types/connector.d.ts","./node_modules/undici-types/client.d.ts","./node_modules/undici-types/errors.d.ts","./node_modules/undici-types/dispatcher.d.ts","./node_modules/undici-types/global-dispatcher.d.ts","./node_modules/undici-types/global-origin.d.ts","./node_modules/undici-types/pool-stats.d.ts","./node_modules/undici-types/pool.d.ts","./node_modules/undici-types/handlers.d.ts","./node_modules/undici-types/balanced-pool.d.ts","./node_modules/undici-types/agent.d.ts","./node_modules/undici-types/mock-interceptor.d.ts","./node_modules/undici-types/mock-agent.d.ts","./node_modules/undici-types/mock-client.d.ts","./node_modules/undici-types/mock-pool.d.ts","./node_modules/undici-types/mock-errors.d.ts","./node_modules/undici-types/proxy-agent.d.ts","./node_modules/undici-types/env-http-proxy-agent.d.ts","./node_modules/undici-types/retry-handler.d.ts","./node_modules/undici-types/retry-agent.d.ts","./node_modules/undici-types/api.d.ts","./node_modules/undici-types/interceptors.d.ts","./node_modules/undici-types/util.d.ts","./node_modules/undici-types/cookies.d.ts","./node_modules/undici-types/patch.d.ts","./node_modules/undici-types/websocket.d.ts","./node_modules/undici-types/eventsource.d.ts","./node_modules/undici-types/filereader.d.ts","./node_modules/undici-types/diagnostics-channel.d.ts","./node_modules/undici-types/content-type.d.ts","./node_modules/undici-types/cache.d.ts","./node_modules/undici-types/index.d.ts","./node_modules/@types/node/globals.d.ts","./node_modules/@types/node/assert.d.ts","./node_modules/@types/node/assert/strict.d.ts","./node_modules/@types/node/async_hooks.d.ts","./node_modules/@types/node/buffer.d.ts","./node_modules/@types/node/child_process.d.ts","./node_modules/@types/node/cluster.d.ts","./node_modules/@types/node/console.d.ts","./node_modules/@types/node/constants.d.ts","./node_modules/@types/node/crypto.d.ts","./node_modules/@types/node/dgram.d.ts","./node_modules/@types/node/diagnostics_channel.d.ts","./node_modules/@types/node/dns.d.ts","./node_modules/@types/node/dns/promises.d.ts","./node_modules/@types/node/domain.d.ts","./node_modules/@types/node/dom-events.d.ts","./node_modules/@types/node/events.d.ts","./node_modules/@types/node/fs.d.ts","./node_modules/@types/node/fs/promises.d.ts","./node_modules/@types/node/http.d.ts","./node_modules/@types/node/http2.d.ts","./node_modules/@types/node/https.d.ts","./node_modules/@types/node/inspector.d.ts","./node_modules/@types/node/module.d.ts","./node_modules/@types/node/net.d.ts","./node_modules/@types/node/os.d.ts","./node_modules/@types/node/path.d.ts","./node_modules/@types/node/perf_hooks.d.ts","./node_modules/@types/node/process.d.ts","./node_modules/@types/node/punycode.d.ts","./node_modules/@types/node/querystring.d.ts","./node_modules/@types/node/readline.d.ts","./node_modules/@types/node/readline/promises.d.ts","./node_modules/@types/node/repl.d.ts","./node_modules/@types/node/sea.d.ts","./node_modules/@types/node/stream.d.ts","./node_modules/@types/node/stream/promises.d.ts","./node_modules/@types/node/stream/consumers.d.ts","./node_modules/@types/node/stream/web.d.ts","./node_modules/@types/node/string_decoder.d.ts","./node_modules/@types/node/test.d.ts","./node_modules/@types/node/timers.d.ts","./node_modules/@types/node/timers/promises.d.ts","./node_modules/@types/node/tls.d.ts","./node_modules/@types/node/trace_events.d.ts","./node_modules/@types/node/tty.d.ts","./node_modules/@types/node/url.d.ts","./node_modules/@types/node/util.d.ts","./node_modules/@types/node/v8.d.ts","./node_modules/@types/node/vm.d.ts","./node_modules/@types/node/wasi.d.ts","./node_modules/@types/node/worker_threads.d.ts","./node_modules/@types/node/zlib.d.ts","./node_modules/@types/node/index.d.ts","./node_modules/@types/ncp/index.d.ts","./src/initialization/generate-tests.ts","./src/initialization/update-package.ts","./src/initialization/init.ts","./src/regressify.ts","./src/index.ts","./node_modules/@types/yauzl/index.d.ts"],"fileIdsList":[[95,138],[95,138,151,187],[95,135,138],[95,137,138],[138],[95,138,143,172],[95,138,139,144,150,151,158,169,180],[95,138,139,140,150,158],[90,91,92,95,138],[95,138,141,181],[95,138,142,143,151,159],[95,138,143,169,177],[95,138,144,146,150,158],[95,137,138,145],[95,138,146,147],[95,138,150],[95,138,148,150],[95,137,138,150],[95,138,150,151,152,169,180],[95,138,150,151,152,165,169,172],[95,133,138,185],[95,138,146,150,153,158,169,180],[95,138,150,151,153,154,158,169,177,180],[95,138,153,155,169,177,180],[93,94,95,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186],[95,138,150,156],[95,138,157,180,185],[95,138,146,150,158,169],[95,138,159],[95,138,160],[95,137,138,161],[95,135,136,137,138,139,140,141,142,143,144,145,146,147,148,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186],[95,138,163],[95,138,164],[95,138,150,165,166],[95,138,165,167,181,183],[95,138,150,169,170,171,172],[95,138,169,171],[95,138,169,170],[95,138,172],[95,138,173],[95,135,138,169],[95,138,150,175,176],[95,138,175,176],[95,138,143,158,169,177],[95,138,178],[95,138,158,179],[95,138,153,164,180],[95,138,143,181],[95,138,169,182],[95,138,157,183],[95,138,184],[95,138,143,150,152,161,169,180,183,185],[95,138,169,186],[95,138,150,169,187],[85,86,95,138],[95,138,179],[95,105,109,138,180],[95,105,138,169,180],[95,100,138],[95,102,105,138,177,180],[95,138,158,177],[95,138,187],[95,100,138,187],[95,102,105,138,158,180],[95,97,98,101,104,138,150,169,180],[95,105,112,138],[95,97,103,138],[95,105,126,127,138],[95,101,105,138,172,180,187],[95,126,138,187],[95,99,100,138,187],[95,105,138],[95,99,100,101,102,103,104,105,106,107,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,127,128,129,130,131,132,138],[95,105,120,138],[95,105,112,113,138],[95,103,105,113,114,138],[95,104,138],[95,97,100,105,138],[95,105,109,113,114,138],[95,109,138],[95,103,105,108,138,180],[95,97,102,105,112,138],[95,138,169],[95,100,105,126,138,185,187],[79,80,81,82,84,87,88,95,138,151,160,162],[82,83,95,138,151,160,180],[84,87,95,138,139,162,191,192],[83,84,87,95,138,151,160,188],[95,138,189,190],[87,95,138,151,160],[79,84,87,89,95,138,151,160],[80,82,83,84,95,138,151,160],[80,95,138],[79,95,138]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"e12a46ce14b817d4c9e6b2b478956452330bf00c9801b79de46f7a1815b5bd40","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"69e65d976bf166ce4a9e6f6c18f94d2424bf116e90837ace179610dbccad9b42","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"bab26767638ab3557de12c900f0b91f710c7dc40ee9793d5a27d32c04f0bf646","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"61d6a2092f48af66dbfb220e31eea8b10bc02b6932d6e529005fd2d7b3281290","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"97b40f02a2e8e1df49affc07772aa00c83d17f1416b4bb97989a05877034540b","impliedFormat":1},{"version":"b60376e567ce0820bb73242be82f09028e0bac75687842bcfa4ed8ae4d644046","signature":"ad53f406485ec05c206b3f0391036f87e9fb0f099229c2708c16a960ef5b9aa5"},{"version":"1982963440f6725937b2debbaf3c1f046dfd5d612e8533651ccd31486c9b3291","signature":"013a96cf269d3c13d5e1c43e8d29dcee52d102baddfa3c54dd08aa2de08efd73"},{"version":"7a1dd1e9c8bf5e23129495b10718b280340c7500570e0cfe5cffcdee51e13e48","impliedFormat":1},{"version":"b864219db8884b972cdeb6f2a73502740e9b6e3a6f71ce4b1cf76d6bc1c33eac","impliedFormat":99},{"version":"a7a0d4fccb89fd8a0aa4681261117b9c80f2218918d8a34456ccfd89b07ac768","signature":"eccc5b4aab3d7f49179fa18983fd368f28f032aa1a89756f59f40b87893adc36"},{"version":"acfed6cc001e7f7f26d2ba42222a180ba669bb966d4dd9cb4ad5596516061b13","impliedFormat":99},{"version":"f61a4dc92450609c353738f0a2daebf8cae71b24716dbd952456d80b1e1a48b6","impliedFormat":99},{"version":"f3f76db6e76bc76d13cc4bfa10e1f74390b8ebe279535f62243e8d8acd919314","impliedFormat":99},{"version":"d0769aa439a555bc7d0a088c0f8565c2bf02701a38835d30e7827f5fb1d4e96b","signature":"e0f935b54c30461f410eb47398959d67681260aab2f9279a65194153bd4a2a22"},{"version":"518ba28adfbf7f4fcb4a622cd0b31846d4b6208fd6ca0b250139b7e1b44e2d6a","signature":"8847973c3a6dc66a177b0f3f0f29b084e06827a473c12917518172a0ea01d602"},{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"a79e62f1e20467e11a904399b8b18b18c0c6eea6b50c1168bf215356d5bebfaf","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fd06258805d26c72f5997e07a23155d322d5f05387adb3744a791fe6a0b042d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","impliedFormat":1},{"version":"24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","impliedFormat":1},{"version":"93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","impliedFormat":1},{"version":"339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"ca6d304b929748ea15c33f28c1f159df18a94470b424ab78c52d68d40a41e1e9","affectsGlobalScope":true,"impliedFormat":1},{"version":"a72ffc815104fb5c075106ebca459b2d55d07862a773768fce89efc621b3964b","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36","impliedFormat":1},{"version":"d674383111e06b6741c4ad2db962131b5b0fa4d0294b998566c635e86195a453","affectsGlobalScope":true,"impliedFormat":1},{"version":"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","impliedFormat":1},{"version":"a3e8bafb2af8e850c644f4be7f5156cf7d23b7bfdc3b786bd4d10ed40329649c","impliedFormat":1},{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true,"impliedFormat":1},{"version":"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","impliedFormat":1},{"version":"f77d9188e41291acf14f476e931972460a303e1952538f9546e7b370cb8d0d20","affectsGlobalScope":true,"impliedFormat":1},{"version":"b0c0d1d13be149f790a75b381b413490f98558649428bb916fd2d71a3f47a134","impliedFormat":1},{"version":"3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","impliedFormat":1},{"version":"5a369483ac4cfbdf0331c248deeb36140e6907db5e1daed241546b4a2055f82c","impliedFormat":1},{"version":"e8f5b5cc36615c17d330eaf8eebbc0d6bdd942c25991f96ef122f246f4ff722f","impliedFormat":1},{"version":"f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45","impliedFormat":1},{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true,"impliedFormat":1},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true,"impliedFormat":1},{"version":"a4bdde4e601e9554a844e1e0d0ccfa05e183ef9d82ab3ac25f17c1709033d360","impliedFormat":1},{"version":"ad23fd126ff06e72728dd7bfc84326a8ca8cec2b9d2dac0193d42a777df0e7d8","impliedFormat":1},{"version":"c60db41f7bee80fb80c0b12819f5e465c8c8b465578da43e36d04f4a4646f57d","impliedFormat":1},{"version":"93bd413918fa921c8729cef45302b24d8b6c7855d72d5bf82d3972595ae8dcbf","impliedFormat":1},{"version":"4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","impliedFormat":1},{"version":"dccdf1677e531e33f8ac961a68bc537418c9a414797c1ea7e91307501cdc3f5e","impliedFormat":1},{"version":"1f4fc6905c4c3ae701838f89484f477b8d9b3ef39270e016b5488600d247d9a5","affectsGlobalScope":true,"impliedFormat":1},{"version":"d206b4baf4ddcc15d9d69a9a2f4999a72a2c6adeaa8af20fa7a9960816287555","impliedFormat":1},{"version":"93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","impliedFormat":1},{"version":"afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5","impliedFormat":1},{"version":"70731d10d5311bd4cf710ef7f6539b62660f4b0bfdbb3f9fbe1d25fe6366a7fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"a20f1e119615bf7632729fd89b6c0b5ffdc2df3b512d6304146294528e3ebe19","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","impliedFormat":1},{"version":"137c2894e8f3e9672d401cc0a305dc7b1db7c69511cf6d3970fb53302f9eae09","impliedFormat":1},{"version":"3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","impliedFormat":1},{"version":"8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","impliedFormat":1},{"version":"f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","impliedFormat":1},{"version":"9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","impliedFormat":1},{"version":"235bfb54b4869c26f7e98e3d1f68dbfc85acf4cf5c38a4444a006fbf74a8a43d","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","impliedFormat":1},{"version":"bb715efb4857eb94539eafb420352105a0cff40746837c5140bf6b035dd220ba","affectsGlobalScope":true,"impliedFormat":1},{"version":"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb","impliedFormat":1},{"version":"fdedf82878e4c744bc2a1c1e802ae407d63474da51f14a54babe039018e53d8f","affectsGlobalScope":true,"impliedFormat":1},{"version":"08353b04a3501d84fc8d7b49de99f6c1cc26026e6d9d697a18315f3bfe92ed03","affectsGlobalScope":true,"impliedFormat":1},{"version":"578d8bb6dcb2a1c03c4c3f8eb71abc9677e1a5c788b7f24848e3138ce17f3400","impliedFormat":1},{"version":"4f029899f9bae07e225c43aef893590541b2b43267383bf5e32e3a884d219ed5","impliedFormat":1},{"version":"ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","impliedFormat":1},{"version":"a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9","impliedFormat":1},{"version":"5b566927cad2ed2139655d55d690ffa87df378b956e7fe1c96024c4d9f75c4cf","affectsGlobalScope":true,"impliedFormat":1},{"version":"bce947017cb7a2deebcc4f5ba04cead891ce6ad1602a4438ae45ed9aa1f39104","affectsGlobalScope":true,"impliedFormat":1},{"version":"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","impliedFormat":1},{"version":"e2c72c065a36bc9ab2a00ac6a6f51e71501619a72c0609defd304d46610487a4","impliedFormat":1},{"version":"d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c","impliedFormat":1},{"version":"616075a6ac578cf5a013ee12964188b4412823796ce0b202c6f1d2e4ca8480d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","impliedFormat":1},{"version":"cac793cc47c29e26e4ac3601dcb00b4435ebed26203485790e44f2ad8b6ad847","impliedFormat":1},{"version":"f72dcf529ac09545fa1767f484eca97ab0862b4bd77f3aee1391e7d75483cb04","impliedFormat":1},{"version":"fd831bdb50e2a9d9a8748537f852676a75369bb4793f0d8f8f46be41e22ad3f4","signature":"e24cd7bf6a171a6d28da3c3f55a25eb7f7afd3e2767850789efc177e661383d1"},{"version":"e6b975207754492bdb964f1ed81aea495c77fbcb27fd847a5134d2ceb8fb3f44","signature":"44cb8d39df03dfad88b7a84893546586c24f44cbcd4b23c06ecc3de406a62314"},{"version":"8269755b6c8db7cc4778743783ff921bb46e32162a7de60f82d8b4e56209d919","signature":"b8966a9f4229a90bb50fc600e75b65807346e8943ac74400e3a0f6d102bcca98"},{"version":"c757feb12be14b20824e9aa6651283a8ffd1170ef2c36790f18a04be56b6cd15","signature":"585e5822d632146c49a8a7f985a3d3bb7225c14ff2f3f1df632fc6101553a53c"},{"version":"d62635a899b41565b49490573fe72b947b796fbac770454c32587eecf9b16553","signature":"43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012"},{"version":"74d5a87c3616cd5d8691059d531504403aa857e09cbaecb1c64dfb9ace0db185","impliedFormat":1}],"root":[80,81,84,88,89,[189,193]],"options":{"allowJs":false,"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":7,"skipLibCheck":true,"sourceMap":true,"strict":true,"target":9,"useDefineForClassFields":true},"referencedMap":[[79,1],[82,1],[188,2],[135,3],[136,3],[137,4],[95,5],[138,6],[139,7],[140,8],[90,1],[93,9],[91,1],[92,1],[141,10],[142,11],[143,12],[144,13],[145,14],[146,15],[147,15],[149,16],[148,17],[150,18],[151,19],[152,20],[134,21],[94,1],[153,22],[154,23],[155,24],[187,25],[156,26],[157,27],[158,28],[159,29],[160,30],[161,31],[162,32],[163,33],[164,34],[165,35],[166,35],[167,36],[168,1],[169,37],[171,38],[170,39],[172,40],[173,41],[174,42],[175,43],[176,44],[177,45],[178,46],[179,47],[180,48],[181,49],[182,50],[183,51],[184,52],[185,53],[186,54],[194,55],[96,1],[87,56],[85,1],[86,57],[83,1],[77,1],[78,1],[13,1],[14,1],[16,1],[15,1],[2,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[23,1],[24,1],[3,1],[25,1],[26,1],[4,1],[27,1],[31,1],[28,1],[29,1],[30,1],[32,1],[33,1],[34,1],[5,1],[35,1],[36,1],[37,1],[38,1],[6,1],[42,1],[39,1],[40,1],[41,1],[43,1],[7,1],[44,1],[49,1],[50,1],[45,1],[46,1],[47,1],[48,1],[8,1],[54,1],[51,1],[52,1],[53,1],[55,1],[9,1],[56,1],[57,1],[58,1],[60,1],[59,1],[61,1],[62,1],[10,1],[63,1],[64,1],[65,1],[11,1],[66,1],[67,1],[68,1],[69,1],[70,1],[1,1],[71,1],[72,1],[12,1],[75,1],[74,1],[73,1],[76,1],[112,58],[122,59],[111,58],[132,60],[103,61],[102,62],[131,63],[125,64],[130,65],[105,66],[119,67],[104,68],[128,69],[100,70],[99,63],[129,71],[101,72],[106,73],[107,1],[110,73],[97,1],[133,74],[123,75],[114,76],[115,77],[117,78],[113,79],[116,80],[126,63],[108,81],[109,82],[118,83],[98,84],[121,75],[120,73],[124,1],[127,85],[89,86],[84,87],[193,88],[189,89],[191,90],[190,91],[192,92],[88,93],[81,94],[80,95]],"latestChangedDtsFile":"./src/index.d.ts","version":"5.7.2"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
name: Regression test Deploy
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- release
|
|
7
|
-
paths:
|
|
8
|
-
- package.json
|
|
9
|
-
|
|
10
|
-
workflow_dispatch:
|
|
11
|
-
|
|
12
|
-
concurrency:
|
|
13
|
-
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
-
cancel-in-progress: true
|
|
15
|
-
|
|
16
|
-
jobs:
|
|
17
|
-
build:
|
|
18
|
-
timeout-minutes: 5
|
|
19
|
-
runs-on: ubuntu-latest
|
|
20
|
-
steps:
|
|
21
|
-
- name: Checkout code
|
|
22
|
-
uses: actions/checkout@v4
|
|
23
|
-
|
|
24
|
-
- name: Set up Node.js
|
|
25
|
-
uses: actions/setup-node@v4
|
|
26
|
-
with:
|
|
27
|
-
node-version: '20.x'
|
|
28
|
-
registry-url: 'https://registry.npmjs.org'
|
|
29
|
-
|
|
30
|
-
- name: Install dependencies
|
|
31
|
-
run: npm ci
|
|
32
|
-
|
|
33
|
-
- name: Build
|
|
34
|
-
run: npm run build
|
|
35
|
-
|
|
36
|
-
- name: Publish to NPM
|
|
37
|
-
run: npm publish --access public
|
|
38
|
-
env:
|
|
39
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.vscode/settings.json
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"files.exclude": {
|
|
3
|
-
".idea": true,
|
|
4
|
-
"**/tsconfig.tsbuildinfo": true,
|
|
5
|
-
"**/package-lock.json": true,
|
|
6
|
-
"**/*.css.map": true,
|
|
7
|
-
"**/node_modules": true,
|
|
8
|
-
"**/.turbo": true,
|
|
9
|
-
".vscode": true
|
|
10
|
-
},
|
|
11
|
-
"markdown.extension.tableFormatter.normalizeIndentation": true,
|
|
12
|
-
"markdown.extension.orderedList.marker": "one",
|
|
13
|
-
"markdownlint.ignore": [
|
|
14
|
-
"**/SUMMARY.md"
|
|
15
|
-
],
|
|
16
|
-
"compile-hero.typescriptx-output-toggle": false,
|
|
17
|
-
"compile-hero.sass-output-toggle": false,
|
|
18
|
-
"compile-hero.pug-output-toggle": false,
|
|
19
|
-
"compile-hero.less-output-toggle": false,
|
|
20
|
-
"compile-hero.javascript-output-toggle": false,
|
|
21
|
-
"compile-hero.jade-output-toggle": false,
|
|
22
|
-
"compile-hero.disable-compile-files-on-did-save-code": false,
|
|
23
|
-
"compile-hero.typescript-output-toggle": false,
|
|
24
|
-
"compile-hero.scss-output-directory": ".",
|
|
25
|
-
"path-intellisense.showHiddenFiles": true,
|
|
26
|
-
"editor.formatOnSave": true,
|
|
27
|
-
"editor.formatOnPaste": true,
|
|
28
|
-
"markdown.extension.list.indentationSize": "inherit",
|
|
29
|
-
"editor.tabSize": 2,
|
|
30
|
-
"editor.rulers": [
|
|
31
|
-
80,
|
|
32
|
-
120
|
|
33
|
-
],
|
|
34
|
-
"editor.minimap.enabled": false,
|
|
35
|
-
"markdown.extension.print.absoluteImgPath": false,
|
|
36
|
-
"markdown.extension.print.imgToBase64": true,
|
|
37
|
-
"markdown.extension.print.theme": "dark",
|
|
38
|
-
"liveSassCompile.settings.generateMap": false,
|
|
39
|
-
"search.exclude": {
|
|
40
|
-
"**/public/assets/css": true,
|
|
41
|
-
"**/public/assets/js": true,
|
|
42
|
-
"**/public/assets/vendor": true
|
|
43
|
-
},
|
|
44
|
-
"json.schemas": [
|
|
45
|
-
{
|
|
46
|
-
"fileMatch": [
|
|
47
|
-
"/*.tests.json"
|
|
48
|
-
],
|
|
49
|
-
"url": "./.engine_scripts/test-schema.json"
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
|
-
"yaml.schemas": {
|
|
53
|
-
"./.engine_scripts/test-schema.json": "/*.tests.{yaml,yml}",
|
|
54
|
-
"./.engine_scripts/replacement-profiles-schema.json": "/_replacement-profiles.{yaml,yml}"
|
|
55
|
-
},
|
|
56
|
-
"git.branchValidationRegex": "^(main|master|develop|stage|fe-develop|fe-release|(features|bugfixes|infra|refactor)\\/.+)$"
|
|
57
|
-
}
|
package/src/config.ts
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import { Config, Scenario, ViewportNext } from 'backstopjs';
|
|
3
|
-
import { createScenario } from './scenarios.js';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
import { getFlagArg, getStringArg, parseDataFromFile, getLibraryPath } from './helpers.js';
|
|
6
|
-
import { TestSuiteModel, ScenarioModel } from './types.js';
|
|
7
|
-
import chalk from 'chalk';
|
|
8
|
-
import { exit } from 'process';
|
|
9
|
-
import YAML from 'js-yaml';
|
|
10
|
-
import { getTestUrl } from './replacements.js';
|
|
11
|
-
|
|
12
|
-
const libraryPath = getLibraryPath();
|
|
13
|
-
const engine: 'puppeteer' | 'playwright' = 'playwright';
|
|
14
|
-
|
|
15
|
-
function getArgConfig(args: string[]) {
|
|
16
|
-
const testSuite = getStringArg(args, '--test-suite');
|
|
17
|
-
const isRef = getFlagArg(args, '--ref');
|
|
18
|
-
const globalRequiredLogin = getFlagArg(args, '--requiredLogin');
|
|
19
|
-
if (globalRequiredLogin) {
|
|
20
|
-
console.log('force run all scenarios in login mode');
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (!testSuite) {
|
|
24
|
-
console.log(chalk.red('Argument `--test-suite` must be set.'));
|
|
25
|
-
console.log(chalk.red('Sample command: npm run <command> -- --test-suite <test-suite>'));
|
|
26
|
-
console.log(chalk.red('Command is either `ref`, `approve` or `test`.'));
|
|
27
|
-
exit(1);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
testSuite,
|
|
32
|
-
isRef,
|
|
33
|
-
globalRequiredLogin,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function getScriptPath(scriptPath: string, engine: 'puppeteer' | 'playwright') {
|
|
38
|
-
return path.join(libraryPath, '.engine_scripts', (engine == 'puppeteer' ? 'puppet' : 'playwright') + scriptPath);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function getData(testSuite: String): TestSuiteModel | undefined {
|
|
42
|
-
let extensions: { ext: string; parse: (content: string) => unknown }[] = [
|
|
43
|
-
{
|
|
44
|
-
ext: 'yaml',
|
|
45
|
-
parse: YAML.load,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
ext: 'yml',
|
|
49
|
-
parse: YAML.load,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
ext: 'json',
|
|
53
|
-
parse: JSON.parse,
|
|
54
|
-
},
|
|
55
|
-
];
|
|
56
|
-
|
|
57
|
-
for (let i = 0; i < extensions.length; i++) {
|
|
58
|
-
const dataPath = path.join(process.cwd(), 'visual_tests', `${testSuite}.tests.${extensions[i].ext}`);
|
|
59
|
-
|
|
60
|
-
if (fs.existsSync(dataPath)) {
|
|
61
|
-
console.log('Data path: ', dataPath);
|
|
62
|
-
const content = fs.readFileSync(dataPath, 'utf-8');
|
|
63
|
-
return extensions[i].parse(content) as TestSuiteModel;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
throw `Data file not found for test suite: ${testSuite}`;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function expandScenarios(model: ScenarioModel, scenarios: ScenarioModel[], level: number) {
|
|
71
|
-
if (level > 100) {
|
|
72
|
-
throw 'Level is too large';
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (!model.needs) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const neededActions: string[] = [];
|
|
80
|
-
if (typeof model.needs === 'string') {
|
|
81
|
-
neededActions.push(model.needs);
|
|
82
|
-
} else {
|
|
83
|
-
model.needs.forEach((n) => neededActions.push(n));
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
neededActions.reverse().forEach((n) => {
|
|
87
|
-
const targetScenarios = scenarios.filter((s) => !!s.id && s.id.toLowerCase() == n.toLowerCase());
|
|
88
|
-
if (targetScenarios.length !== 1) {
|
|
89
|
-
throw `The test suite must contains exactly ONE scenario with id: ${n}`;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
var targetScenario = targetScenarios[0];
|
|
93
|
-
expandScenarios(targetScenario, scenarios, level + 1);
|
|
94
|
-
if (!!targetScenario.actions) {
|
|
95
|
-
if (!model.actions) {
|
|
96
|
-
model.actions = [];
|
|
97
|
-
}
|
|
98
|
-
model.actions = [...targetScenario.actions, ...model.actions];
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
model.needs = undefined;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function getScenarios(args: string[], testSuite: string, isRef: boolean, globalRequiredLogin: boolean) {
|
|
106
|
-
const scenarios: Scenario[] = [];
|
|
107
|
-
|
|
108
|
-
const data = getData(testSuite);
|
|
109
|
-
|
|
110
|
-
const viewports = parseDataFromFile(data?.viewportsPath ?? 'visual_tests/_viewports.yaml') as ViewportNext[];
|
|
111
|
-
if (data) {
|
|
112
|
-
[].forEach.call(data.scenarios, (s: ScenarioModel) => {
|
|
113
|
-
expandScenarios(s, data.scenarios, 0);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
const getTestUrlLocal = (url: string) => getTestUrl(args, url, isRef);
|
|
117
|
-
|
|
118
|
-
const pad = String(data?.scenarios.length).length;
|
|
119
|
-
data.scenarios.forEach((s, index) => {
|
|
120
|
-
const opts: ScenarioModel = {
|
|
121
|
-
...s,
|
|
122
|
-
requiredLogin: globalRequiredLogin || s.requiredLogin,
|
|
123
|
-
getTestUrl: getTestUrlLocal,
|
|
124
|
-
url: isRef ? s.url : getTestUrl(args, s.url, isRef),
|
|
125
|
-
index: String(index + 1).padStart(pad, ' '),
|
|
126
|
-
total: data.scenarios.length,
|
|
127
|
-
delay: s.delay ?? 1000,
|
|
128
|
-
hideSelectors: s.hideSelectors ?? data.hideSelectors,
|
|
129
|
-
removeSelectors: s.removeSelectors ?? data.removeSelectors,
|
|
130
|
-
useCssOverride: s.useCssOverride ?? data.useCssOverride,
|
|
131
|
-
jsOnReadyPath: s.jsOnReadyPath,
|
|
132
|
-
viewports: !!s.viewportNames
|
|
133
|
-
? typeof s.viewportNames === 'string'
|
|
134
|
-
? viewports.filter((v) => v.label.toLowerCase() == (s.viewportNames as string).trim().toLowerCase())
|
|
135
|
-
: viewports.filter((v) => s.viewportNames?.includes(v.label))
|
|
136
|
-
: !!data.viewportNames
|
|
137
|
-
? typeof data.viewportNames === 'string'
|
|
138
|
-
? viewports.filter((v) => v.label.toLowerCase() == (data.viewportNames as string).trim().toLowerCase())
|
|
139
|
-
: viewports.filter((v) => data.viewportNames?.includes(v.label))
|
|
140
|
-
: undefined,
|
|
141
|
-
referenceUrl: !isRef ? s.url : undefined,
|
|
142
|
-
misMatchThreshold: s.misMatchThreshold ?? data.misMatchThreshold ?? 0.1,
|
|
143
|
-
postInteractionWait: s.postInteractionWait ?? data.postInteractionWait ?? 1,
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const scenario = createScenario(opts);
|
|
147
|
-
scenarios.push(scenario);
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
return { scenarios, data, viewports };
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export function getConfig(args: string[]): Config {
|
|
155
|
-
const { testSuite, isRef, globalRequiredLogin } = getArgConfig(args);
|
|
156
|
-
const { scenarios, data, viewports } = getScenarios(args, testSuite, isRef, globalRequiredLogin);
|
|
157
|
-
|
|
158
|
-
return {
|
|
159
|
-
id: testSuite,
|
|
160
|
-
viewports,
|
|
161
|
-
onBeforeScript: getScriptPath('/onBefore.js', engine),
|
|
162
|
-
onReadyScript: getScriptPath('/onReady.js', engine),
|
|
163
|
-
scenarios,
|
|
164
|
-
paths: {
|
|
165
|
-
bitmaps_reference: '.backstop/' + testSuite + '/bitmaps_reference',
|
|
166
|
-
bitmaps_test: '.backstop/' + testSuite + '/bitmaps_test',
|
|
167
|
-
engine_scripts: `${getLibraryPath()}/.engine_scripts`,
|
|
168
|
-
html_report: '.backstop/' + testSuite + '/html_report',
|
|
169
|
-
ci_report: '.backstop/' + testSuite + '/ci_report',
|
|
170
|
-
},
|
|
171
|
-
report: [isRef ? 'CI' : 'browser'],
|
|
172
|
-
engine,
|
|
173
|
-
engineOptions: {
|
|
174
|
-
args: [
|
|
175
|
-
'--disable-infobars',
|
|
176
|
-
'--disable-setuid-sandbox',
|
|
177
|
-
'--ignore-certifcate-errors',
|
|
178
|
-
'--ignore-certifcate-errors-spki-list',
|
|
179
|
-
'--no-sandbox',
|
|
180
|
-
'--window-position=0,0',
|
|
181
|
-
],
|
|
182
|
-
browser: data?.browser ?? 'chromium',
|
|
183
|
-
},
|
|
184
|
-
asyncCaptureLimit: data?.asyncCaptureLimit ?? 5,
|
|
185
|
-
asyncCompareLimit: data?.asyncCompareLimit ?? 50,
|
|
186
|
-
debug: false,
|
|
187
|
-
debugWindow: data?.debug,
|
|
188
|
-
} as Config;
|
|
189
|
-
}
|
package/src/helpers.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import YAML from 'js-yaml';
|
|
3
|
-
import { dirname } from 'path';
|
|
4
|
-
import slash from 'slash';
|
|
5
|
-
import { fileURLToPath } from 'url';
|
|
6
|
-
|
|
7
|
-
export const getStringArg = (args: string[], key: string): string | undefined => {
|
|
8
|
-
const index = args.indexOf(key);
|
|
9
|
-
return index >= 0 && index < args.length - 1 && !args[index + 1].startsWith('-') ? args[index + 1] : undefined;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const getFlagArg = (args: string[], key: string): boolean => {
|
|
13
|
-
return args.indexOf(key) >= 0;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const parseDataFromFile = (dataPath: string, type: 'yaml' | 'json' = 'yaml'): unknown | undefined => {
|
|
17
|
-
if (!!dataPath && fs.existsSync(dataPath)) {
|
|
18
|
-
let content = fs.readFileSync(dataPath, 'utf-8');
|
|
19
|
-
if (type === 'json') {
|
|
20
|
-
return JSON.parse(content);
|
|
21
|
-
} else if (type === 'yaml') {
|
|
22
|
-
return YAML.load(content);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export function getLibraryPath() {
|
|
28
|
-
const fileName = fileURLToPath(import.meta.url);
|
|
29
|
-
return slash(dirname(dirname(fileName)));
|
|
30
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import pkg from 'ncp';
|
|
4
|
-
import chalk from 'chalk';
|
|
5
|
-
import { getLibraryPath } from '../helpers.js';
|
|
6
|
-
import slash from 'slash';
|
|
7
|
-
|
|
8
|
-
const { ncp } = pkg;
|
|
9
|
-
|
|
10
|
-
export async function initVisualTestsFolder() {
|
|
11
|
-
try {
|
|
12
|
-
const sourceFolder = slash(path.join(getLibraryPath(), 'visual_tests'));
|
|
13
|
-
const destinationFolder = path.join(process.cwd(), 'visual_tests');
|
|
14
|
-
|
|
15
|
-
if (!fs.existsSync(destinationFolder)) {
|
|
16
|
-
ncp(sourceFolder, destinationFolder, function (err) {
|
|
17
|
-
if (err) {
|
|
18
|
-
console.log(chalk.red('Error copying folder:'), err);
|
|
19
|
-
} else {
|
|
20
|
-
console.log(chalk.green('Folder "visual_tests" has been copied to your project!'));
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
} else {
|
|
24
|
-
console.log(chalk.yellow('Folder "visual_tests" already exists.'));
|
|
25
|
-
}
|
|
26
|
-
} catch (error) {
|
|
27
|
-
console.log(chalk.red(error));
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
|
|
5
|
-
export async function updatePackageJson() {
|
|
6
|
-
try {
|
|
7
|
-
const packageJsonPath = path.join(process.cwd(), 'package.json');
|
|
8
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
9
|
-
console.log(chalk.red("package.json file doesn't exists"));
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const packageJsonText = fs.readFileSync(packageJsonPath, 'utf8');
|
|
14
|
-
const packageJson = JSON.parse(packageJsonText);
|
|
15
|
-
|
|
16
|
-
packageJson.scripts = packageJson.scripts || {};
|
|
17
|
-
packageJson.scripts.ref = 'regressify ref';
|
|
18
|
-
packageJson.scripts.approve = 'regressify approve';
|
|
19
|
-
packageJson.scripts.test = 'regressify test';
|
|
20
|
-
|
|
21
|
-
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
22
|
-
} catch (error) {
|
|
23
|
-
console.log(chalk.red(error));
|
|
24
|
-
}
|
|
25
|
-
}
|
package/src/regressify.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import backstop from 'backstopjs';
|
|
3
|
-
import { getLibraryPath } from './helpers.js';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
import fs from 'fs';
|
|
6
|
-
import { getConfig } from './config.js';
|
|
7
|
-
|
|
8
|
-
const PATCH_START = '<!-- PATCH START -->';
|
|
9
|
-
const PATCH_END = '<!-- PATCH END -->';
|
|
10
|
-
|
|
11
|
-
const customStyle = `
|
|
12
|
-
${PATCH_START}
|
|
13
|
-
<style>
|
|
14
|
-
[id^="test"] > div[display="true"] > p[display] {
|
|
15
|
-
white-space: pre;
|
|
16
|
-
overflow-x: auto;
|
|
17
|
-
}
|
|
18
|
-
</style>
|
|
19
|
-
${PATCH_END}
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
export async function regressifyProcess(command: 'approve' | 'reference' | 'test', args: string[]) {
|
|
23
|
-
packCompare();
|
|
24
|
-
|
|
25
|
-
const config = getConfig(args);
|
|
26
|
-
|
|
27
|
-
backstop(command, { config })
|
|
28
|
-
.then(() => {
|
|
29
|
-
console.log(chalk.green(command.toUpperCase() + ' FINISHED SUCCESSFULLY'));
|
|
30
|
-
})
|
|
31
|
-
.catch(() => {
|
|
32
|
-
console.log(chalk.red(command.toUpperCase() + ' FAILED'));
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function packCompare() {
|
|
37
|
-
const reportIndex = path.resolve(getLibraryPath(), 'node_modules/backstopjs/compare/output/index.html');
|
|
38
|
-
if (fs.existsSync(reportIndex)) {
|
|
39
|
-
let html = fs.readFileSync(reportIndex, 'utf-8');
|
|
40
|
-
const patchStartIndex = html.indexOf(PATCH_START);
|
|
41
|
-
const patchEndIndex = html.indexOf(PATCH_END);
|
|
42
|
-
if (patchStartIndex > 0 && patchEndIndex > patchStartIndex) {
|
|
43
|
-
html = html.replace(new RegExp(PATCH_START + '.*' + patchEndIndex, 'gi'), customStyle);
|
|
44
|
-
} else {
|
|
45
|
-
html = html.replace('</head>', customStyle + '</head>');
|
|
46
|
-
}
|
|
47
|
-
fs.writeFileSync(reportIndex, html);
|
|
48
|
-
} else {
|
|
49
|
-
console.log(chalk.red('File does not exist: ' + reportIndex));
|
|
50
|
-
}
|
|
51
|
-
}
|
package/src/replacements.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { ReplacementModel, ReplacementsModel } from './types.js';
|
|
4
|
-
import YAML from 'js-yaml';
|
|
5
|
-
import { getLibraryPath, getStringArg } from './helpers.js';
|
|
6
|
-
import slash from 'slash';
|
|
7
|
-
|
|
8
|
-
function getReplacementProfile(args: string[]): ReplacementModel[] | undefined {
|
|
9
|
-
const replacementProfileName = getStringArg(args, 'replacement-profile') ?? process.env.REPLACEMENT_PROFILE;
|
|
10
|
-
if (!!replacementProfileName) {
|
|
11
|
-
const replacementProfilePath = slash(path.join(getLibraryPath(), 'visual_tests', '_replacement-profiles.yaml'));
|
|
12
|
-
if (!fs.existsSync(replacementProfilePath)) {
|
|
13
|
-
throw "Replacement profile doesn't exist: " + replacementProfilePath;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const profiles = YAML.load(fs.readFileSync(replacementProfilePath, 'utf-8')) as ReplacementsModel;
|
|
17
|
-
return profiles.profiles[replacementProfileName];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const getTestUrl = (args: string[], url: string, isRef: boolean) => {
|
|
22
|
-
const replacementProfile = getReplacementProfile(args);
|
|
23
|
-
|
|
24
|
-
if (isRef || !replacementProfile) {
|
|
25
|
-
return url;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
let testUrl = url;
|
|
29
|
-
replacementProfile.forEach((e) => (testUrl = testUrl.replace(e.ref, e.test)));
|
|
30
|
-
|
|
31
|
-
return testUrl;
|
|
32
|
-
};
|
package/src/scenarios.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ScenarioModel } from './types.js';
|
|
2
|
-
|
|
3
|
-
export const createScenario = (opts: ScenarioModel): ScenarioModel => {
|
|
4
|
-
const parsedUrl = new URL(opts.url);
|
|
5
|
-
|
|
6
|
-
return {
|
|
7
|
-
...opts,
|
|
8
|
-
label: opts.label ?? `${opts.index} of ${opts.total}: ${parsedUrl.pathname}`,
|
|
9
|
-
cookiePath: opts.cookiePath ?? 'visual_tests/_cookies.yaml',
|
|
10
|
-
cssOverridePath: opts.cssOverridePath ?? 'visual_tests/_override.css',
|
|
11
|
-
jsOnReadyPath: opts.jsOnReadyPath ?? 'visual_tests/_on-ready.js',
|
|
12
|
-
referenceUrl: opts.referenceUrl ?? '',
|
|
13
|
-
readyEvent: '',
|
|
14
|
-
hideSelectors: opts.hideSelectors ?? [],
|
|
15
|
-
removeSelectors: opts.removeSelectors ?? [],
|
|
16
|
-
selectors: [],
|
|
17
|
-
selectorExpansion: true,
|
|
18
|
-
expect: 0,
|
|
19
|
-
requireSameDimensions: true,
|
|
20
|
-
};
|
|
21
|
-
};
|
package/src/types.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Scenario } from 'backstopjs';
|
|
2
|
-
|
|
3
|
-
export interface ReplacementModel {
|
|
4
|
-
ref: string;
|
|
5
|
-
test: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface ReplacementsModel {
|
|
9
|
-
profiles: { [name: string]: ReplacementModel[] };
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface TestSuiteModel {
|
|
13
|
-
urlReplacements?: ReplacementModel[];
|
|
14
|
-
scenarios: ScenarioModel[];
|
|
15
|
-
hideSelectors?: string[];
|
|
16
|
-
removeSelectors?: string[];
|
|
17
|
-
useCssOverride?: boolean;
|
|
18
|
-
cssOverridePath?: string;
|
|
19
|
-
viewportsPath?: string;
|
|
20
|
-
debug?: boolean;
|
|
21
|
-
asyncCaptureLimit?: number;
|
|
22
|
-
asyncCompareLimit?: number;
|
|
23
|
-
browser?: 'chromium' | 'firefox' | 'webkit';
|
|
24
|
-
misMatchThreshold?: number;
|
|
25
|
-
postInteractionWait?: number;
|
|
26
|
-
viewportNames?: string | string[];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface ScenarioModel extends Scenario {
|
|
30
|
-
requiredLogin?: boolean;
|
|
31
|
-
id?: string;
|
|
32
|
-
needs?: string | string[];
|
|
33
|
-
actions?: unknown[];
|
|
34
|
-
description: string;
|
|
35
|
-
cssOverridePath?: string;
|
|
36
|
-
index: string;
|
|
37
|
-
jsOnReadyPath?: string;
|
|
38
|
-
total: number;
|
|
39
|
-
viewportNames?: string | string[];
|
|
40
|
-
useCssOverride?: boolean;
|
|
41
|
-
noScrollTop?: boolean;
|
|
42
|
-
misMatchThreshold?: number;
|
|
43
|
-
postInteractionWait?: number;
|
|
44
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|