cbrowser 7.3.0 ā 7.4.0
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/dist/analysis/bug-hunter.d.ts +32 -0
- package/dist/analysis/bug-hunter.d.ts.map +1 -0
- package/dist/analysis/bug-hunter.js +106 -0
- package/dist/analysis/bug-hunter.js.map +1 -0
- package/dist/analysis/chaos-testing.d.ts +41 -0
- package/dist/analysis/chaos-testing.d.ts.map +1 -0
- package/dist/analysis/chaos-testing.js +87 -0
- package/dist/analysis/chaos-testing.js.map +1 -0
- package/dist/analysis/index.d.ts +10 -0
- package/dist/analysis/index.d.ts.map +1 -0
- package/dist/analysis/index.js +26 -0
- package/dist/analysis/index.js.map +1 -0
- package/dist/analysis/natural-language.d.ts +43 -0
- package/dist/analysis/natural-language.d.ts.map +1 -0
- package/dist/analysis/natural-language.js +205 -0
- package/dist/analysis/natural-language.js.map +1 -0
- package/dist/analysis/persona-comparison.d.ts +31 -0
- package/dist/analysis/persona-comparison.d.ts.map +1 -0
- package/dist/analysis/persona-comparison.js +217 -0
- package/dist/analysis/persona-comparison.js.map +1 -0
- package/dist/browser.d.ts +1 -411
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +0 -4745
- package/dist/browser.js.map +1 -1
- package/dist/cli.js +64 -56
- package/dist/cli.js.map +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +2 -1
- package/dist/daemon.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/performance/index.d.ts +7 -0
- package/dist/performance/index.d.ts.map +1 -0
- package/dist/performance/index.js +23 -0
- package/dist/performance/index.js.map +1 -0
- package/dist/performance/metrics.d.ts +49 -0
- package/dist/performance/metrics.d.ts.map +1 -0
- package/dist/performance/metrics.js +386 -0
- package/dist/performance/metrics.js.map +1 -0
- package/dist/testing/coverage.d.ts +39 -0
- package/dist/testing/coverage.d.ts.map +1 -0
- package/dist/testing/coverage.js +713 -0
- package/dist/testing/coverage.js.map +1 -0
- package/dist/testing/flaky-detection.d.ts +28 -0
- package/dist/testing/flaky-detection.d.ts.map +1 -0
- package/dist/testing/flaky-detection.js +332 -0
- package/dist/testing/flaky-detection.js.map +1 -0
- package/dist/testing/index.d.ts +10 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +26 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/nl-test-suite.d.ts +70 -0
- package/dist/testing/nl-test-suite.d.ts.map +1 -0
- package/dist/testing/nl-test-suite.js +427 -0
- package/dist/testing/nl-test-suite.js.map +1 -0
- package/dist/testing/test-repair.d.ts +36 -0
- package/dist/testing/test-repair.d.ts.map +1 -0
- package/dist/testing/test-repair.js +528 -0
- package/dist/testing/test-repair.js.map +1 -0
- package/dist/visual/ab-comparison.d.ts +23 -0
- package/dist/visual/ab-comparison.d.ts.map +1 -0
- package/dist/visual/ab-comparison.js +366 -0
- package/dist/visual/ab-comparison.js.map +1 -0
- package/dist/visual/cross-browser.d.ts +41 -0
- package/dist/visual/cross-browser.d.ts.map +1 -0
- package/dist/visual/cross-browser.js +442 -0
- package/dist/visual/cross-browser.js.map +1 -0
- package/dist/visual/index.d.ts +10 -0
- package/dist/visual/index.d.ts.map +1 -0
- package/dist/visual/index.js +26 -0
- package/dist/visual/index.js.map +1 -0
- package/dist/visual/regression.d.ts +55 -0
- package/dist/visual/regression.d.ts.map +1 -0
- package/dist/visual/regression.js +616 -0
- package/dist/visual/regression.js.map +1 -0
- package/dist/visual/responsive.d.ts +27 -0
- package/dist/visual/responsive.d.ts.map +1 -0
- package/dist/visual/responsive.js +450 -0
- package/dist/visual/responsive.js.map +1 -0
- package/package.json +32 -3
package/dist/cli.js
CHANGED
|
@@ -7,6 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const browser_js_1 = require("./browser.js");
|
|
10
|
+
// Analysis module imports
|
|
11
|
+
const index_js_1 = require("./analysis/index.js");
|
|
12
|
+
// Testing module imports
|
|
13
|
+
const index_js_2 = require("./testing/index.js");
|
|
14
|
+
// Performance module imports
|
|
15
|
+
const index_js_3 = require("./performance/index.js");
|
|
16
|
+
// Visual module imports
|
|
17
|
+
const index_js_4 = require("./visual/index.js");
|
|
10
18
|
const personas_js_1 = require("./personas.js");
|
|
11
19
|
const types_js_1 = require("./types.js");
|
|
12
20
|
const mcp_server_js_1 = require("./mcp-server.js");
|
|
@@ -14,7 +22,7 @@ const daemon_js_1 = require("./daemon.js");
|
|
|
14
22
|
function showHelp() {
|
|
15
23
|
console.log(`
|
|
16
24
|
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
17
|
-
ā CBrowser CLI v7.
|
|
25
|
+
ā CBrowser CLI v7.4.0 ā
|
|
18
26
|
ā AI-powered browser automation with cross-browser visual testing ā
|
|
19
27
|
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
20
28
|
|
|
@@ -1304,7 +1312,7 @@ async function main() {
|
|
|
1304
1312
|
const concurrency = options.concurrency
|
|
1305
1313
|
? parseInt(options.concurrency)
|
|
1306
1314
|
: 3;
|
|
1307
|
-
const comparison = await (0,
|
|
1315
|
+
const comparison = await (0, index_js_1.comparePersonas)({
|
|
1308
1316
|
startUrl,
|
|
1309
1317
|
goal,
|
|
1310
1318
|
personas: personaNames,
|
|
@@ -1312,7 +1320,7 @@ async function main() {
|
|
|
1312
1320
|
headless,
|
|
1313
1321
|
});
|
|
1314
1322
|
// Print formatted report
|
|
1315
|
-
const report = (0,
|
|
1323
|
+
const report = (0, index_js_1.formatComparisonReport)(comparison);
|
|
1316
1324
|
console.log(report);
|
|
1317
1325
|
// Save JSON output if requested
|
|
1318
1326
|
if (options.output) {
|
|
@@ -2020,7 +2028,7 @@ async function main() {
|
|
|
2020
2028
|
}
|
|
2021
2029
|
console.log(`šø Capturing visual baseline: ${options.name}`);
|
|
2022
2030
|
console.log(` URL: ${url}`);
|
|
2023
|
-
const baseline = await (0,
|
|
2031
|
+
const baseline = await (0, index_js_4.captureVisualBaseline)(url, options.name, {
|
|
2024
2032
|
selector: options.selector,
|
|
2025
2033
|
device: options.device,
|
|
2026
2034
|
viewport: options.width || options.height ? {
|
|
@@ -2051,13 +2059,13 @@ async function main() {
|
|
|
2051
2059
|
console.log(`\nš Running AI visual regression test...`);
|
|
2052
2060
|
console.log(` URL: ${url}`);
|
|
2053
2061
|
console.log(` Baseline: ${baselineName}\n`);
|
|
2054
|
-
const result = await (0,
|
|
2062
|
+
const result = await (0, index_js_4.runVisualRegression)(url, baselineName, {
|
|
2055
2063
|
threshold: options.threshold ? parseFloat(options.threshold) : 0.9,
|
|
2056
2064
|
sensitivity: options.sensitivity || "medium",
|
|
2057
2065
|
generateDiff: true,
|
|
2058
2066
|
});
|
|
2059
2067
|
// Print report
|
|
2060
|
-
console.log((0,
|
|
2068
|
+
console.log((0, index_js_4.formatVisualRegressionReport)(result));
|
|
2061
2069
|
// Save JSON output if requested
|
|
2062
2070
|
if (options.output && !options.html) {
|
|
2063
2071
|
const fs = await import("fs");
|
|
@@ -2082,7 +2090,7 @@ async function main() {
|
|
|
2082
2090
|
duration: result.duration,
|
|
2083
2091
|
timestamp: new Date().toISOString(),
|
|
2084
2092
|
};
|
|
2085
|
-
const htmlReport = (0,
|
|
2093
|
+
const htmlReport = (0, index_js_4.generateVisualRegressionHtmlReport)(suiteResult);
|
|
2086
2094
|
const outputPath = options.output || `visual-regression-${baselineName}-${Date.now()}.html`;
|
|
2087
2095
|
fs.writeFileSync(outputPath, htmlReport);
|
|
2088
2096
|
console.log(`\nš HTML report saved to: ${outputPath}`);
|
|
@@ -2108,7 +2116,7 @@ async function main() {
|
|
|
2108
2116
|
}
|
|
2109
2117
|
const suite = JSON.parse(fs.readFileSync(suiteFile, "utf-8"));
|
|
2110
2118
|
console.log(`\nš Running visual regression suite: ${suite.name}`);
|
|
2111
|
-
const result = await (0,
|
|
2119
|
+
const result = await (0, index_js_4.runVisualRegressionSuite)(suite, {
|
|
2112
2120
|
threshold: options.threshold ? parseFloat(options.threshold) : 0.9,
|
|
2113
2121
|
});
|
|
2114
2122
|
// Save outputs
|
|
@@ -2117,7 +2125,7 @@ async function main() {
|
|
|
2117
2125
|
console.log(`š JSON report saved to: ${options.output}`);
|
|
2118
2126
|
}
|
|
2119
2127
|
if (options.html) {
|
|
2120
|
-
const htmlReport = (0,
|
|
2128
|
+
const htmlReport = (0, index_js_4.generateVisualRegressionHtmlReport)(result);
|
|
2121
2129
|
const outputPath = options.output || `visual-suite-${Date.now()}.html`;
|
|
2122
2130
|
fs.writeFileSync(outputPath, htmlReport);
|
|
2123
2131
|
console.log(`š HTML report saved to: ${outputPath}`);
|
|
@@ -2128,7 +2136,7 @@ async function main() {
|
|
|
2128
2136
|
break;
|
|
2129
2137
|
}
|
|
2130
2138
|
case "list": {
|
|
2131
|
-
const baselines = (0,
|
|
2139
|
+
const baselines = (0, index_js_4.listVisualBaselines)();
|
|
2132
2140
|
if (baselines.length === 0) {
|
|
2133
2141
|
console.log("\nNo AI visual baselines saved.\n");
|
|
2134
2142
|
console.log("Capture one with:");
|
|
@@ -2156,7 +2164,7 @@ async function main() {
|
|
|
2156
2164
|
console.error("Usage: cbrowser ai-visual show <name>");
|
|
2157
2165
|
process.exit(1);
|
|
2158
2166
|
}
|
|
2159
|
-
const baseline = (0,
|
|
2167
|
+
const baseline = (0, index_js_4.getVisualBaseline)(name);
|
|
2160
2168
|
if (!baseline) {
|
|
2161
2169
|
console.error(`Baseline not found: ${name}`);
|
|
2162
2170
|
process.exit(1);
|
|
@@ -2183,7 +2191,7 @@ async function main() {
|
|
|
2183
2191
|
console.error("Usage: cbrowser ai-visual delete <name>");
|
|
2184
2192
|
process.exit(1);
|
|
2185
2193
|
}
|
|
2186
|
-
if ((0,
|
|
2194
|
+
if ((0, index_js_4.deleteVisualBaseline)(name)) {
|
|
2187
2195
|
console.log(`ā
Baseline deleted: ${name}`);
|
|
2188
2196
|
}
|
|
2189
2197
|
else {
|
|
@@ -2223,14 +2231,14 @@ async function main() {
|
|
|
2223
2231
|
process.exit(1);
|
|
2224
2232
|
}
|
|
2225
2233
|
const suite = JSON.parse(fs.readFileSync(suiteFile, "utf-8"));
|
|
2226
|
-
const result = await (0,
|
|
2234
|
+
const result = await (0, index_js_4.runCrossBrowserSuite)(suite);
|
|
2227
2235
|
// Save outputs
|
|
2228
2236
|
if (options.output && !options.html) {
|
|
2229
2237
|
fs.writeFileSync(options.output, JSON.stringify(result, null, 2));
|
|
2230
2238
|
console.log(`\nš JSON report saved to: ${options.output}`);
|
|
2231
2239
|
}
|
|
2232
2240
|
if (options.html) {
|
|
2233
|
-
const htmlReport = (0,
|
|
2241
|
+
const htmlReport = (0, index_js_4.generateCrossBrowserHtmlReport)(result);
|
|
2234
2242
|
const outputPath = options.output || `cross-browser-${Date.now()}.html`;
|
|
2235
2243
|
fs.writeFileSync(outputPath, htmlReport);
|
|
2236
2244
|
console.log(`\nš HTML report saved to: ${outputPath}`);
|
|
@@ -2263,7 +2271,7 @@ async function main() {
|
|
|
2263
2271
|
const browsers = options.browsers
|
|
2264
2272
|
? options.browsers.split(",")
|
|
2265
2273
|
: undefined;
|
|
2266
|
-
const result = await (0,
|
|
2274
|
+
const result = await (0, index_js_4.runCrossBrowserTest)(url, {
|
|
2267
2275
|
browsers,
|
|
2268
2276
|
viewport: options.width || options.height ? {
|
|
2269
2277
|
width: parseInt(options.width) || 1920,
|
|
@@ -2274,7 +2282,7 @@ async function main() {
|
|
|
2274
2282
|
sensitivity: options.sensitivity,
|
|
2275
2283
|
});
|
|
2276
2284
|
// Print report
|
|
2277
|
-
console.log("\n" + (0,
|
|
2285
|
+
console.log("\n" + (0, index_js_4.formatCrossBrowserReport)(result));
|
|
2278
2286
|
// Save outputs
|
|
2279
2287
|
const fs = await import("fs");
|
|
2280
2288
|
if (options.output && !options.html) {
|
|
@@ -2294,7 +2302,7 @@ async function main() {
|
|
|
2294
2302
|
duration: result.duration,
|
|
2295
2303
|
timestamp: result.timestamp,
|
|
2296
2304
|
};
|
|
2297
|
-
const htmlReport = (0,
|
|
2305
|
+
const htmlReport = (0, index_js_4.generateCrossBrowserHtmlReport)(suiteResult);
|
|
2298
2306
|
const outputPath = options.output || `cross-browser-${Date.now()}.html`;
|
|
2299
2307
|
fs.writeFileSync(outputPath, htmlReport);
|
|
2300
2308
|
console.log(`\nš HTML report saved to: ${outputPath}`);
|
|
@@ -2312,7 +2320,7 @@ async function main() {
|
|
|
2312
2320
|
const subcommand = args[0];
|
|
2313
2321
|
if (subcommand === "viewports") {
|
|
2314
2322
|
// List viewport presets
|
|
2315
|
-
const presets = (0,
|
|
2323
|
+
const presets = (0, index_js_4.listViewportPresets)();
|
|
2316
2324
|
console.log("\nš± Available Viewport Presets\n");
|
|
2317
2325
|
console.log("ā".repeat(60));
|
|
2318
2326
|
const byType = {
|
|
@@ -2348,14 +2356,14 @@ async function main() {
|
|
|
2348
2356
|
process.exit(1);
|
|
2349
2357
|
}
|
|
2350
2358
|
const suite = JSON.parse(fs.readFileSync(suiteFile, "utf-8"));
|
|
2351
|
-
const result = await (0,
|
|
2359
|
+
const result = await (0, index_js_4.runResponsiveSuite)(suite);
|
|
2352
2360
|
// Save outputs
|
|
2353
2361
|
if (options.output && !options.html) {
|
|
2354
2362
|
fs.writeFileSync(options.output, JSON.stringify(result, null, 2));
|
|
2355
2363
|
console.log(`\nš JSON report saved to: ${options.output}`);
|
|
2356
2364
|
}
|
|
2357
2365
|
if (options.html) {
|
|
2358
|
-
const htmlReport = (0,
|
|
2366
|
+
const htmlReport = (0, index_js_4.generateResponsiveHtmlReport)(result);
|
|
2359
2367
|
const outputPath = options.output || `responsive-${Date.now()}.html`;
|
|
2360
2368
|
fs.writeFileSync(outputPath, htmlReport);
|
|
2361
2369
|
console.log(`\nš HTML report saved to: ${outputPath}`);
|
|
@@ -2391,14 +2399,14 @@ async function main() {
|
|
|
2391
2399
|
const viewports = options.viewports
|
|
2392
2400
|
? options.viewports.split(",")
|
|
2393
2401
|
: undefined;
|
|
2394
|
-
const result = await (0,
|
|
2402
|
+
const result = await (0, index_js_4.runResponsiveTest)(url, {
|
|
2395
2403
|
viewports,
|
|
2396
2404
|
waitBeforeCapture: options.wait ? parseInt(options.wait) : undefined,
|
|
2397
2405
|
waitForSelector: options["wait-for"],
|
|
2398
2406
|
sensitivity: options.sensitivity,
|
|
2399
2407
|
});
|
|
2400
2408
|
// Print report
|
|
2401
|
-
console.log("\n" + (0,
|
|
2409
|
+
console.log("\n" + (0, index_js_4.formatResponsiveReport)(result));
|
|
2402
2410
|
// Save outputs
|
|
2403
2411
|
const fs = await import("fs");
|
|
2404
2412
|
if (options.output && !options.html) {
|
|
@@ -2420,7 +2428,7 @@ async function main() {
|
|
|
2420
2428
|
duration: result.duration,
|
|
2421
2429
|
timestamp: result.timestamp,
|
|
2422
2430
|
};
|
|
2423
|
-
const htmlReport = (0,
|
|
2431
|
+
const htmlReport = (0, index_js_4.generateResponsiveHtmlReport)(suiteResult);
|
|
2424
2432
|
const outputPath = options.output || `responsive-${Date.now()}.html`;
|
|
2425
2433
|
fs.writeFileSync(outputPath, htmlReport);
|
|
2426
2434
|
console.log(`\nš HTML report saved to: ${outputPath}`);
|
|
@@ -2451,14 +2459,14 @@ async function main() {
|
|
|
2451
2459
|
process.exit(1);
|
|
2452
2460
|
}
|
|
2453
2461
|
const suite = JSON.parse(fs.readFileSync(suiteFile, "utf-8"));
|
|
2454
|
-
const result = await (0,
|
|
2462
|
+
const result = await (0, index_js_4.runABSuite)(suite);
|
|
2455
2463
|
// Save outputs
|
|
2456
2464
|
if (options.output && !options.html) {
|
|
2457
2465
|
fs.writeFileSync(options.output, JSON.stringify(result, null, 2));
|
|
2458
2466
|
console.log(`\nš JSON report saved to: ${options.output}`);
|
|
2459
2467
|
}
|
|
2460
2468
|
if (options.html) {
|
|
2461
|
-
const htmlReport = (0,
|
|
2469
|
+
const htmlReport = (0, index_js_4.generateABHtmlReport)(result);
|
|
2462
2470
|
const outputPath = options.output || `ab-comparison-${Date.now()}.html`;
|
|
2463
2471
|
fs.writeFileSync(outputPath, htmlReport);
|
|
2464
2472
|
console.log(`\nš HTML report saved to: ${outputPath}`);
|
|
@@ -2490,7 +2498,7 @@ async function main() {
|
|
|
2490
2498
|
console.error(" --output <file> Save report");
|
|
2491
2499
|
process.exit(1);
|
|
2492
2500
|
}
|
|
2493
|
-
const result = await (0,
|
|
2501
|
+
const result = await (0, index_js_4.runABComparison)(urlA, urlB, {
|
|
2494
2502
|
labels: options["label-a"] || options["label-b"] ? {
|
|
2495
2503
|
a: options["label-a"] || "Version A",
|
|
2496
2504
|
b: options["label-b"] || "Version B",
|
|
@@ -2504,7 +2512,7 @@ async function main() {
|
|
|
2504
2512
|
sensitivity: options.sensitivity,
|
|
2505
2513
|
});
|
|
2506
2514
|
// Print report
|
|
2507
|
-
console.log("\n" + (0,
|
|
2515
|
+
console.log("\n" + (0, index_js_4.formatABReport)(result));
|
|
2508
2516
|
// Save outputs
|
|
2509
2517
|
const fs = await import("fs");
|
|
2510
2518
|
if (options.output && !options.html) {
|
|
@@ -2525,7 +2533,7 @@ async function main() {
|
|
|
2525
2533
|
duration: result.duration,
|
|
2526
2534
|
timestamp: result.timestamp,
|
|
2527
2535
|
};
|
|
2528
|
-
const htmlReport = (0,
|
|
2536
|
+
const htmlReport = (0, index_js_4.generateABHtmlReport)(suiteResult);
|
|
2529
2537
|
const outputPath = options.output || `ab-comparison-${Date.now()}.html`;
|
|
2530
2538
|
fs.writeFileSync(outputPath, htmlReport);
|
|
2531
2539
|
console.log(`\nš HTML report saved to: ${outputPath}`);
|
|
@@ -2916,7 +2924,7 @@ async function main() {
|
|
|
2916
2924
|
process.exit(1);
|
|
2917
2925
|
}
|
|
2918
2926
|
console.log(`\nš£ļø Executing: "${nlCommand}"\n`);
|
|
2919
|
-
const result = await (0,
|
|
2927
|
+
const result = await (0, index_js_1.executeNaturalLanguage)(browser, nlCommand);
|
|
2920
2928
|
if (result.success) {
|
|
2921
2929
|
console.log(`ā Action: ${result.action}`);
|
|
2922
2930
|
if (result.result && typeof result.result === "object") {
|
|
@@ -2952,7 +2960,7 @@ async function main() {
|
|
|
2952
2960
|
const commands = content.split("\n").filter(line => line.trim() && !line.trim().startsWith("#"));
|
|
2953
2961
|
console.log(`\nš Executing script: ${scriptFile}`);
|
|
2954
2962
|
console.log(` Commands: ${commands.length}\n`);
|
|
2955
|
-
const results = await (0,
|
|
2963
|
+
const results = await (0, index_js_1.executeNaturalLanguageScript)(browser, commands);
|
|
2956
2964
|
for (const r of results) {
|
|
2957
2965
|
if (r.success) {
|
|
2958
2966
|
console.log(`ā ${r.command}`);
|
|
@@ -2988,7 +2996,7 @@ async function main() {
|
|
|
2988
2996
|
switch (subcommand) {
|
|
2989
2997
|
case "find": {
|
|
2990
2998
|
console.log(`\nš§ Finding element: "${intent}"\n`);
|
|
2991
|
-
const result = await (0,
|
|
2999
|
+
const result = await (0, index_js_1.findElementByIntent)(browser, intent);
|
|
2992
3000
|
if (result) {
|
|
2993
3001
|
console.log(`ā Found element`);
|
|
2994
3002
|
console.log(` Selector: ${result.selector}`);
|
|
@@ -3003,7 +3011,7 @@ async function main() {
|
|
|
3003
3011
|
}
|
|
3004
3012
|
case "click": {
|
|
3005
3013
|
console.log(`\nš§ Finding and clicking: "${intent}"\n`);
|
|
3006
|
-
const result = await (0,
|
|
3014
|
+
const result = await (0, index_js_1.findElementByIntent)(browser, intent);
|
|
3007
3015
|
if (result) {
|
|
3008
3016
|
console.log(`ā Found: ${result.description}`);
|
|
3009
3017
|
await browser.click(result.selector);
|
|
@@ -3035,7 +3043,7 @@ async function main() {
|
|
|
3035
3043
|
console.log(` URL: ${url}`);
|
|
3036
3044
|
console.log(` Max pages: ${maxPages}`);
|
|
3037
3045
|
console.log(` Timeout: ${timeout}ms\n`);
|
|
3038
|
-
const result = await (0,
|
|
3046
|
+
const result = await (0, index_js_1.huntBugs)(browser, url, { maxPages, timeout });
|
|
3039
3047
|
console.log(`š Bug Hunt Results:\n`);
|
|
3040
3048
|
console.log(` Pages visited: ${result.pagesVisited}`);
|
|
3041
3049
|
console.log(` Duration: ${result.duration}ms`);
|
|
@@ -3072,7 +3080,7 @@ async function main() {
|
|
|
3072
3080
|
console.log(`\nš Cross-Browser Diff`);
|
|
3073
3081
|
console.log(` URL: ${url}`);
|
|
3074
3082
|
console.log(` Browsers: ${browserList.join(", ")}\n`);
|
|
3075
|
-
const result = await (0,
|
|
3083
|
+
const result = await (0, index_js_4.crossBrowserDiff)(url, [...browserList]);
|
|
3076
3084
|
console.log(`š Results:\n`);
|
|
3077
3085
|
console.log(` Metrics:`);
|
|
3078
3086
|
for (const [browser, metrics] of Object.entries(result.metrics)) {
|
|
@@ -3120,7 +3128,7 @@ async function main() {
|
|
|
3120
3128
|
console.log(` URL: ${url}`);
|
|
3121
3129
|
console.log(` Chaos config:`, chaosConfig);
|
|
3122
3130
|
console.log("");
|
|
3123
|
-
const result = await (0,
|
|
3131
|
+
const result = await (0, index_js_1.runChaosTest)(browser, url, chaosConfig);
|
|
3124
3132
|
console.log(`š Results:\n`);
|
|
3125
3133
|
console.log(` Passed: ${result.passed ? "ā
Yes" : "ā No"}`);
|
|
3126
3134
|
console.log(` Duration: ${result.duration}ms`);
|
|
@@ -3174,7 +3182,7 @@ async function main() {
|
|
|
3174
3182
|
const steps = inlineTest.split(";").map(s => s.trim()).filter(s => s);
|
|
3175
3183
|
const testCase = {
|
|
3176
3184
|
name: "Inline Test",
|
|
3177
|
-
steps: steps.map(s => (0,
|
|
3185
|
+
steps: steps.map(s => (0, index_js_2.parseNLInstruction)(s)),
|
|
3178
3186
|
};
|
|
3179
3187
|
suite = { name: "Inline Suite", tests: [testCase] };
|
|
3180
3188
|
}
|
|
@@ -3187,7 +3195,7 @@ async function main() {
|
|
|
3187
3195
|
}
|
|
3188
3196
|
const content = fs.readFileSync(filepath, "utf-8");
|
|
3189
3197
|
const suiteName = filepath.split("/").pop()?.replace(/\.[^.]+$/, "") || "Test Suite";
|
|
3190
|
-
suite = (0,
|
|
3198
|
+
suite = (0, index_js_2.parseNLTestSuite)(content, suiteName);
|
|
3191
3199
|
}
|
|
3192
3200
|
console.log(`\nš Parsed ${suite.tests.length} test(s) from ${inlineTest ? "inline" : filepath}`);
|
|
3193
3201
|
for (const test of suite.tests) {
|
|
@@ -3199,9 +3207,9 @@ async function main() {
|
|
|
3199
3207
|
screenshotOnFailure: options["screenshot-on-failure"] !== false,
|
|
3200
3208
|
headless,
|
|
3201
3209
|
};
|
|
3202
|
-
const result = await (0,
|
|
3210
|
+
const result = await (0, index_js_2.runNLTestSuite)(suite, suiteOptions);
|
|
3203
3211
|
// Print formatted report
|
|
3204
|
-
const report = (0,
|
|
3212
|
+
const report = (0, index_js_2.formatNLTestReport)(result);
|
|
3205
3213
|
console.log(report);
|
|
3206
3214
|
// Save JSON output if requested
|
|
3207
3215
|
if (options.output) {
|
|
@@ -3250,7 +3258,7 @@ async function main() {
|
|
|
3250
3258
|
}
|
|
3251
3259
|
const content = fs.readFileSync(filepath, "utf-8");
|
|
3252
3260
|
const suiteName = filepath.split("/").pop()?.replace(/\.[^.]+$/, "") || "Test Suite";
|
|
3253
|
-
const suite = (0,
|
|
3261
|
+
const suite = (0, index_js_2.parseNLTestSuite)(content, suiteName);
|
|
3254
3262
|
console.log(`\nš Parsed ${suite.tests.length} test(s) from ${filepath}`);
|
|
3255
3263
|
for (const test of suite.tests) {
|
|
3256
3264
|
console.log(` - ${test.name}: ${test.steps.length} steps`);
|
|
@@ -3261,9 +3269,9 @@ async function main() {
|
|
|
3261
3269
|
verifyRepairs: options.verify === true,
|
|
3262
3270
|
maxRetries: options.retries ? parseInt(options.retries) : 3,
|
|
3263
3271
|
};
|
|
3264
|
-
const result = await (0,
|
|
3272
|
+
const result = await (0, index_js_2.repairTestSuite)(suite, repairOptions);
|
|
3265
3273
|
// Print formatted report
|
|
3266
|
-
const report = (0,
|
|
3274
|
+
const report = (0, index_js_2.formatRepairReport)(result);
|
|
3267
3275
|
console.log(report);
|
|
3268
3276
|
// Save JSON report if requested
|
|
3269
3277
|
if (options.json) {
|
|
@@ -3274,7 +3282,7 @@ async function main() {
|
|
|
3274
3282
|
if (options.output && repairOptions.autoApply) {
|
|
3275
3283
|
const repairedContent = [];
|
|
3276
3284
|
for (const testResult of result.testResults) {
|
|
3277
|
-
repairedContent.push((0,
|
|
3285
|
+
repairedContent.push((0, index_js_2.exportRepairedTest)(testResult));
|
|
3278
3286
|
repairedContent.push("");
|
|
3279
3287
|
}
|
|
3280
3288
|
fs.writeFileSync(options.output, repairedContent.join("\n"));
|
|
@@ -3314,7 +3322,7 @@ async function main() {
|
|
|
3314
3322
|
}
|
|
3315
3323
|
const content = fs.readFileSync(filepath, "utf-8");
|
|
3316
3324
|
const suiteName = filepath.split("/").pop()?.replace(/\.[^.]+$/, "") || "Test Suite";
|
|
3317
|
-
const suite = (0,
|
|
3325
|
+
const suite = (0, index_js_2.parseNLTestSuite)(content, suiteName);
|
|
3318
3326
|
console.log(`\nš Parsed ${suite.tests.length} test(s) from ${filepath}`);
|
|
3319
3327
|
for (const test of suite.tests) {
|
|
3320
3328
|
console.log(` - ${test.name}: ${test.steps.length} steps`);
|
|
@@ -3325,9 +3333,9 @@ async function main() {
|
|
|
3325
3333
|
flakinessThreshold: options.threshold ? parseInt(options.threshold) : 20,
|
|
3326
3334
|
delayBetweenRuns: options.delay ? parseInt(options.delay) : 500,
|
|
3327
3335
|
};
|
|
3328
|
-
const result = await (0,
|
|
3336
|
+
const result = await (0, index_js_2.detectFlakyTests)(suite, flakyOptions);
|
|
3329
3337
|
// Print formatted report
|
|
3330
|
-
const report = (0,
|
|
3338
|
+
const report = (0, index_js_2.formatFlakyTestReport)(result);
|
|
3331
3339
|
console.log(report);
|
|
3332
3340
|
// Save JSON report if requested
|
|
3333
3341
|
if (options.output) {
|
|
@@ -3360,7 +3368,7 @@ async function main() {
|
|
|
3360
3368
|
runs: options.runs ? parseInt(options.runs) : 3,
|
|
3361
3369
|
};
|
|
3362
3370
|
console.log(` Running ${baselineOptions.runs} measurement(s)...`);
|
|
3363
|
-
const baseline = await (0,
|
|
3371
|
+
const baseline = await (0, index_js_3.capturePerformanceBaseline)(url, baselineOptions);
|
|
3364
3372
|
console.log(`\nā
Baseline saved: ${baseline.name}`);
|
|
3365
3373
|
console.log(` ID: ${baseline.id}`);
|
|
3366
3374
|
console.log(` URL: ${baseline.url}`);
|
|
@@ -3387,7 +3395,7 @@ async function main() {
|
|
|
3387
3395
|
break;
|
|
3388
3396
|
}
|
|
3389
3397
|
case "list": {
|
|
3390
|
-
const baselines = (0,
|
|
3398
|
+
const baselines = (0, index_js_3.listPerformanceBaselines)();
|
|
3391
3399
|
if (baselines.length === 0) {
|
|
3392
3400
|
console.log("\nš No performance baselines saved yet.");
|
|
3393
3401
|
console.log(" Use: cbrowser perf-baseline save <url> --name <name>");
|
|
@@ -3412,7 +3420,7 @@ async function main() {
|
|
|
3412
3420
|
console.error("Usage: cbrowser perf-baseline show <name|id>");
|
|
3413
3421
|
process.exit(1);
|
|
3414
3422
|
}
|
|
3415
|
-
const baseline = (0,
|
|
3423
|
+
const baseline = (0, index_js_3.loadPerformanceBaseline)(name);
|
|
3416
3424
|
if (!baseline) {
|
|
3417
3425
|
console.error(`Baseline not found: ${name}`);
|
|
3418
3426
|
process.exit(1);
|
|
@@ -3434,7 +3442,7 @@ async function main() {
|
|
|
3434
3442
|
console.error("Usage: cbrowser perf-baseline delete <name|id>");
|
|
3435
3443
|
process.exit(1);
|
|
3436
3444
|
}
|
|
3437
|
-
const deleted = (0,
|
|
3445
|
+
const deleted = (0, index_js_3.deletePerformanceBaseline)(name);
|
|
3438
3446
|
if (deleted) {
|
|
3439
3447
|
console.log(`\nā
Deleted baseline: ${name}`);
|
|
3440
3448
|
}
|
|
@@ -3495,9 +3503,9 @@ async function main() {
|
|
|
3495
3503
|
thresholds: Object.keys(thresholds).length > 0 ? thresholds : undefined,
|
|
3496
3504
|
};
|
|
3497
3505
|
try {
|
|
3498
|
-
const result = await (0,
|
|
3506
|
+
const result = await (0, index_js_3.detectPerformanceRegression)(url, baselineName, regressionOptions);
|
|
3499
3507
|
// Print formatted report
|
|
3500
|
-
const report = (0,
|
|
3508
|
+
const report = (0, index_js_3.formatPerformanceRegressionReport)(result);
|
|
3501
3509
|
console.log("\n" + report);
|
|
3502
3510
|
// Save JSON report if requested
|
|
3503
3511
|
const fs = await import("fs");
|
|
@@ -3563,7 +3571,7 @@ async function main() {
|
|
|
3563
3571
|
maxPages: 50, // Quick mode
|
|
3564
3572
|
minCoverage: 50,
|
|
3565
3573
|
};
|
|
3566
|
-
const result = await (0,
|
|
3574
|
+
const result = await (0, index_js_2.generateCoverageMap)(url, testFiles, coverageOptions);
|
|
3567
3575
|
// Show only gaps
|
|
3568
3576
|
console.log(`\nš³ļø Coverage Gaps (${result.gaps.length} found):\n`);
|
|
3569
3577
|
const priorityEmoji = { critical: "šØ", high: "š“", medium: "š”", low: "š¢" };
|
|
@@ -3609,10 +3617,10 @@ async function main() {
|
|
|
3609
3617
|
else {
|
|
3610
3618
|
console.log(` Crawling site (max ${coverageOptions.maxPages} pages)...`);
|
|
3611
3619
|
}
|
|
3612
|
-
const result = await (0,
|
|
3620
|
+
const result = await (0, index_js_2.generateCoverageMap)(url, testFiles, coverageOptions);
|
|
3613
3621
|
// Output format
|
|
3614
3622
|
if (options.html) {
|
|
3615
|
-
const htmlReport = (0,
|
|
3623
|
+
const htmlReport = (0, index_js_2.generateCoverageHtmlReport)(result);
|
|
3616
3624
|
const outputPath = options.output || "coverage-report.html";
|
|
3617
3625
|
fs.writeFileSync(outputPath, htmlReport);
|
|
3618
3626
|
console.log(`\nā
HTML report saved: ${outputPath}`);
|
|
@@ -3623,7 +3631,7 @@ async function main() {
|
|
|
3623
3631
|
}
|
|
3624
3632
|
else {
|
|
3625
3633
|
// Print text report
|
|
3626
|
-
const report = (0,
|
|
3634
|
+
const report = (0, index_js_2.formatCoverageReport)(result);
|
|
3627
3635
|
console.log(report);
|
|
3628
3636
|
if (options.output) {
|
|
3629
3637
|
fs.writeFileSync(options.output, report);
|