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
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Multi-Persona Comparison Testing
|
|
4
|
+
*
|
|
5
|
+
* Tier 6: Run the same user journey with multiple personas in parallel
|
|
6
|
+
* to compare how different user types experience your application.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.comparePersonas = comparePersonas;
|
|
10
|
+
exports.formatComparisonReport = formatComparisonReport;
|
|
11
|
+
const browser_js_1 = require("../browser.js");
|
|
12
|
+
const personas_js_1 = require("../personas.js");
|
|
13
|
+
/**
|
|
14
|
+
* Run the same journey with multiple personas and compare results.
|
|
15
|
+
* This runs personas in parallel (up to maxConcurrency) for efficiency.
|
|
16
|
+
*/
|
|
17
|
+
async function comparePersonas(options) {
|
|
18
|
+
const { startUrl, goal, personas, maxSteps = 20, maxConcurrency = 3, headless = true, } = options;
|
|
19
|
+
const startTime = Date.now();
|
|
20
|
+
const results = [];
|
|
21
|
+
console.log(`\n Comparing ${personas.length} personas...`);
|
|
22
|
+
console.log(` URL: ${startUrl}`);
|
|
23
|
+
console.log(` Goal: ${goal}`);
|
|
24
|
+
console.log(` Concurrency: ${maxConcurrency}\n`);
|
|
25
|
+
// Process personas in batches
|
|
26
|
+
for (let i = 0; i < personas.length; i += maxConcurrency) {
|
|
27
|
+
const batch = personas.slice(i, i + maxConcurrency);
|
|
28
|
+
console.log(` Batch ${Math.floor(i / maxConcurrency) + 1}: ${batch.join(", ")}`);
|
|
29
|
+
const batchPromises = batch.map(async (personaName) => {
|
|
30
|
+
const browser = new browser_js_1.CBrowser({ headless });
|
|
31
|
+
try {
|
|
32
|
+
const persona = (0, personas_js_1.getPersona)(personaName) || personas_js_1.BUILTIN_PERSONAS["first-timer"];
|
|
33
|
+
const journeyStart = Date.now();
|
|
34
|
+
// Run the journey
|
|
35
|
+
const journey = await browser.journey({
|
|
36
|
+
persona: personaName,
|
|
37
|
+
startUrl,
|
|
38
|
+
goal,
|
|
39
|
+
maxSteps,
|
|
40
|
+
});
|
|
41
|
+
// Calculate average reaction time from persona config
|
|
42
|
+
const timing = persona.humanBehavior?.timing;
|
|
43
|
+
const avgReactionTime = timing
|
|
44
|
+
? (timing.reactionTime.min + timing.reactionTime.max) / 2
|
|
45
|
+
: 500;
|
|
46
|
+
// Calculate error rate from persona config
|
|
47
|
+
const errors = persona.humanBehavior?.errors;
|
|
48
|
+
const errorRate = errors
|
|
49
|
+
? (errors.misClickRate + errors.typoRate) / 2
|
|
50
|
+
: 0.05;
|
|
51
|
+
const result = {
|
|
52
|
+
persona: personaName,
|
|
53
|
+
description: persona.description,
|
|
54
|
+
techLevel: persona.demographics.tech_level || "intermediate",
|
|
55
|
+
device: persona.demographics.device || "desktop",
|
|
56
|
+
success: journey.success,
|
|
57
|
+
totalTime: journey.totalTime,
|
|
58
|
+
stepCount: journey.steps.length,
|
|
59
|
+
frictionCount: journey.frictionPoints.length,
|
|
60
|
+
frictionPoints: journey.frictionPoints,
|
|
61
|
+
avgReactionTime,
|
|
62
|
+
errorRate,
|
|
63
|
+
screenshots: {
|
|
64
|
+
start: journey.steps[0]?.screenshot || "",
|
|
65
|
+
end: journey.steps[journey.steps.length - 1]?.screenshot || "",
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
console.log(` ${personaName}: ${journey.success ? "SUCCESS" : "FAILED"} (${journey.totalTime}ms, ${journey.frictionPoints.length} friction)`);
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
console.log(` ${personaName}: ERROR - ${e.message}`);
|
|
73
|
+
return {
|
|
74
|
+
persona: personaName,
|
|
75
|
+
description: "Unknown",
|
|
76
|
+
techLevel: "unknown",
|
|
77
|
+
device: "unknown",
|
|
78
|
+
success: false,
|
|
79
|
+
totalTime: 0,
|
|
80
|
+
stepCount: 0,
|
|
81
|
+
frictionCount: 1,
|
|
82
|
+
frictionPoints: [`Error: ${e.message}`],
|
|
83
|
+
avgReactionTime: 0,
|
|
84
|
+
errorRate: 0,
|
|
85
|
+
screenshots: { start: "", end: "" },
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
await browser.close();
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
const batchResults = await Promise.all(batchPromises);
|
|
93
|
+
results.push(...batchResults);
|
|
94
|
+
}
|
|
95
|
+
// Generate summary
|
|
96
|
+
const successfulResults = results.filter((r) => r.success);
|
|
97
|
+
const failedResults = results.filter((r) => !r.success);
|
|
98
|
+
const sortedByTime = [...successfulResults].sort((a, b) => a.totalTime - b.totalTime);
|
|
99
|
+
const sortedByFriction = [...results].sort((a, b) => b.frictionCount - a.frictionCount);
|
|
100
|
+
// Collect all friction points
|
|
101
|
+
const allFrictionPoints = results.flatMap((r) => r.frictionPoints);
|
|
102
|
+
const frictionCounts = allFrictionPoints.reduce((acc, fp) => {
|
|
103
|
+
acc[fp] = (acc[fp] || 0) + 1;
|
|
104
|
+
return acc;
|
|
105
|
+
}, {});
|
|
106
|
+
const commonFriction = Object.entries(frictionCounts)
|
|
107
|
+
.filter(([_, count]) => count > 1)
|
|
108
|
+
.sort((a, b) => b[1] - a[1])
|
|
109
|
+
.slice(0, 5)
|
|
110
|
+
.map(([fp]) => fp);
|
|
111
|
+
// Generate recommendations
|
|
112
|
+
const recommendations = [];
|
|
113
|
+
if (failedResults.length > 0) {
|
|
114
|
+
recommendations.push(`${failedResults.length} persona(s) failed to complete the journey: ${failedResults.map((r) => r.persona).join(", ")}`);
|
|
115
|
+
}
|
|
116
|
+
if (sortedByFriction[0]?.frictionCount > 0) {
|
|
117
|
+
recommendations.push(`"${sortedByFriction[0].persona}" experienced the most friction (${sortedByFriction[0].frictionCount} points) - review for accessibility improvements`);
|
|
118
|
+
}
|
|
119
|
+
const beginnerPersonas = results.filter((r) => r.techLevel === "beginner");
|
|
120
|
+
const expertPersonas = results.filter((r) => r.techLevel === "expert");
|
|
121
|
+
if (beginnerPersonas.length > 0 && expertPersonas.length > 0) {
|
|
122
|
+
const avgBeginnerTime = beginnerPersonas.reduce((sum, r) => sum + r.totalTime, 0) / beginnerPersonas.length;
|
|
123
|
+
const avgExpertTime = expertPersonas.reduce((sum, r) => sum + r.totalTime, 0) / expertPersonas.length;
|
|
124
|
+
if (avgBeginnerTime > avgExpertTime * 3) {
|
|
125
|
+
recommendations.push(`Beginners take ${(avgBeginnerTime / avgExpertTime).toFixed(1)}x longer than experts - consider adding more guidance`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const mobilePersonas = results.filter((r) => r.device === "mobile");
|
|
129
|
+
const desktopPersonas = results.filter((r) => r.device === "desktop");
|
|
130
|
+
if (mobilePersonas.length > 0 && desktopPersonas.length > 0) {
|
|
131
|
+
const mobileFriction = mobilePersonas.reduce((sum, r) => sum + r.frictionCount, 0) / mobilePersonas.length;
|
|
132
|
+
const desktopFriction = desktopPersonas.reduce((sum, r) => sum + r.frictionCount, 0) / desktopPersonas.length;
|
|
133
|
+
if (mobileFriction > desktopFriction * 2) {
|
|
134
|
+
recommendations.push(`Mobile users experience ${(mobileFriction / desktopFriction).toFixed(1)}x more friction - review mobile UX`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (commonFriction.length > 0) {
|
|
138
|
+
recommendations.push(`Common friction points across personas: ${commonFriction.slice(0, 3).join("; ")}`);
|
|
139
|
+
}
|
|
140
|
+
if (recommendations.length === 0) {
|
|
141
|
+
recommendations.push("All personas completed the journey without significant issues");
|
|
142
|
+
}
|
|
143
|
+
const avgTime = successfulResults.length > 0
|
|
144
|
+
? successfulResults.reduce((sum, r) => sum + r.totalTime, 0) / successfulResults.length
|
|
145
|
+
: 0;
|
|
146
|
+
const comparison = {
|
|
147
|
+
url: startUrl,
|
|
148
|
+
goal,
|
|
149
|
+
timestamp: new Date().toISOString(),
|
|
150
|
+
duration: Date.now() - startTime,
|
|
151
|
+
personas: results,
|
|
152
|
+
summary: {
|
|
153
|
+
totalPersonas: personas.length,
|
|
154
|
+
successCount: successfulResults.length,
|
|
155
|
+
failureCount: failedResults.length,
|
|
156
|
+
fastestPersona: sortedByTime[0]?.persona || "N/A",
|
|
157
|
+
slowestPersona: sortedByTime[sortedByTime.length - 1]?.persona || "N/A",
|
|
158
|
+
mostFriction: sortedByFriction[0]?.persona || "N/A",
|
|
159
|
+
leastFriction: sortedByFriction[sortedByFriction.length - 1]?.persona || "N/A",
|
|
160
|
+
avgCompletionTime: Math.round(avgTime),
|
|
161
|
+
commonFrictionPoints: commonFriction,
|
|
162
|
+
},
|
|
163
|
+
recommendations,
|
|
164
|
+
};
|
|
165
|
+
return comparison;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Generate a formatted comparison report.
|
|
169
|
+
*/
|
|
170
|
+
function formatComparisonReport(comparison) {
|
|
171
|
+
const lines = [];
|
|
172
|
+
lines.push("");
|
|
173
|
+
lines.push("================================================================================");
|
|
174
|
+
lines.push(" MULTI-PERSONA COMPARISON REPORT ");
|
|
175
|
+
lines.push("================================================================================");
|
|
176
|
+
lines.push("");
|
|
177
|
+
lines.push(`URL: ${comparison.url}`);
|
|
178
|
+
lines.push(`Goal: ${comparison.goal}`);
|
|
179
|
+
lines.push(`Total Duration: ${(comparison.duration / 1000).toFixed(1)}s`);
|
|
180
|
+
lines.push(`Timestamp: ${comparison.timestamp}`);
|
|
181
|
+
lines.push("");
|
|
182
|
+
// Results table
|
|
183
|
+
lines.push("+---------------------+----------+----------+----------+----------+-----------------------------+");
|
|
184
|
+
lines.push("| Persona | Success | Time | Steps | Friction | Key Issues |");
|
|
185
|
+
lines.push("+---------------------+----------+----------+----------+----------+-----------------------------+");
|
|
186
|
+
for (const result of comparison.personas) {
|
|
187
|
+
const name = result.persona.padEnd(19).slice(0, 19);
|
|
188
|
+
const success = result.success ? "Y".padEnd(8) : "N".padEnd(8);
|
|
189
|
+
const time = `${(result.totalTime / 1000).toFixed(1)}s`.padEnd(8);
|
|
190
|
+
const steps = `${result.stepCount}`.padEnd(8);
|
|
191
|
+
const friction = `${result.frictionCount}`.padEnd(8);
|
|
192
|
+
const issues = (result.frictionPoints[0] || "-").slice(0, 27).padEnd(27);
|
|
193
|
+
lines.push(`| ${name} | ${success} | ${time} | ${steps} | ${friction} | ${issues} |`);
|
|
194
|
+
}
|
|
195
|
+
lines.push("+---------------------+----------+----------+----------+----------+-----------------------------+");
|
|
196
|
+
lines.push("");
|
|
197
|
+
// Summary
|
|
198
|
+
lines.push("SUMMARY");
|
|
199
|
+
lines.push("-".repeat(60));
|
|
200
|
+
lines.push(` Total Personas: ${comparison.summary.totalPersonas}`);
|
|
201
|
+
lines.push(` Success Rate: ${comparison.summary.successCount}/${comparison.summary.totalPersonas} (${Math.round((comparison.summary.successCount / comparison.summary.totalPersonas) * 100)}%)`);
|
|
202
|
+
lines.push(` Avg Completion Time: ${(comparison.summary.avgCompletionTime / 1000).toFixed(1)}s`);
|
|
203
|
+
lines.push(` Fastest: ${comparison.summary.fastestPersona}`);
|
|
204
|
+
lines.push(` Slowest: ${comparison.summary.slowestPersona}`);
|
|
205
|
+
lines.push(` Most Friction: ${comparison.summary.mostFriction}`);
|
|
206
|
+
lines.push(` Least Friction: ${comparison.summary.leastFriction}`);
|
|
207
|
+
lines.push("");
|
|
208
|
+
// Recommendations
|
|
209
|
+
lines.push("RECOMMENDATIONS");
|
|
210
|
+
lines.push("-".repeat(60));
|
|
211
|
+
for (const rec of comparison.recommendations) {
|
|
212
|
+
lines.push(` ${rec}`);
|
|
213
|
+
}
|
|
214
|
+
lines.push("");
|
|
215
|
+
return lines.join("\n");
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=persona-comparison.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona-comparison.js","sourceRoot":"","sources":["../../src/analysis/persona-comparison.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAyBH,0CAsMC;AAKD,wDAsDC;AAxRD,8CAAyC;AACzC,gDAA8D;AAkB9D;;;GAGG;AACI,KAAK,UAAU,eAAe,CACnC,OAA+B;IAE/B,MAAM,EACJ,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,QAAQ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AC,cAAc,EAAE,CAAC,CAAC;IAC9D,KAAK,CAAC,IAAI,CAAC,cAAc,UAAU,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAC9D,KAAK,CAAC,IAAI,CAAC,oBAAoB,UAAU,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAClE,KAAK,CAAC,IAAI,CAAC,qBAAqB,UAAU,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IACpE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,kBAAkB;IAClB,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC9B,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3B,KAAK,MAAM,GAAG,IAAI,UAAU,CAAC,eAAe,EAAE,CAAC;QAC7C,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;IACzB,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/browser.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { type Page } from "playwright";
|
|
7
7
|
import { type CBrowserConfig } from "./config.js";
|
|
8
|
-
import type { SavedSession, NavigationResult, ClickResult, ExtractResult, JourneyResult, CleanupOptions, CleanupResult, JourneyOptions, NetworkMock, NetworkRequest, PerformanceMetrics, PerformanceAuditResult, SmartRetryResult, AssertionResult, SelectorCacheEntry, SelectorCacheStats, PageAnalysis, TestGenerationResult
|
|
8
|
+
import type { SavedSession, NavigationResult, ClickResult, ExtractResult, JourneyResult, CleanupOptions, CleanupResult, JourneyOptions, NetworkMock, NetworkRequest, PerformanceMetrics, PerformanceAuditResult, SmartRetryResult, AssertionResult, SelectorCacheEntry, SelectorCacheStats, PageAnalysis, TestGenerationResult } from "./types.js";
|
|
9
9
|
export declare class CBrowser {
|
|
10
10
|
private config;
|
|
11
11
|
private paths;
|
|
@@ -440,414 +440,4 @@ export declare class FluentCBrowser {
|
|
|
440
440
|
close(): Promise<void>;
|
|
441
441
|
get instance(): CBrowser;
|
|
442
442
|
}
|
|
443
|
-
/**
|
|
444
|
-
* Parse natural language into browser action.
|
|
445
|
-
*/
|
|
446
|
-
export declare function parseNaturalLanguage(command: string): {
|
|
447
|
-
action: string;
|
|
448
|
-
params: Record<string, string>;
|
|
449
|
-
} | null;
|
|
450
|
-
/**
|
|
451
|
-
* Execute a natural language command.
|
|
452
|
-
*/
|
|
453
|
-
export declare function executeNaturalLanguage(browser: CBrowser, command: string): Promise<{
|
|
454
|
-
success: boolean;
|
|
455
|
-
action: string;
|
|
456
|
-
result?: unknown;
|
|
457
|
-
error?: string;
|
|
458
|
-
}>;
|
|
459
|
-
/**
|
|
460
|
-
* Execute multiple natural language commands in sequence.
|
|
461
|
-
*/
|
|
462
|
-
export declare function executeNaturalLanguageScript(browser: CBrowser, commands: string[]): Promise<Array<{
|
|
463
|
-
command: string;
|
|
464
|
-
success: boolean;
|
|
465
|
-
action: string;
|
|
466
|
-
result?: unknown;
|
|
467
|
-
error?: string;
|
|
468
|
-
}>>;
|
|
469
|
-
/**
|
|
470
|
-
* AI-powered semantic element finding.
|
|
471
|
-
* Examples: "the cheapest product", "login form", "main navigation"
|
|
472
|
-
*/
|
|
473
|
-
export declare function findElementByIntent(browser: CBrowser, intent: string): Promise<{
|
|
474
|
-
selector: string;
|
|
475
|
-
confidence: number;
|
|
476
|
-
description: string;
|
|
477
|
-
} | null>;
|
|
478
|
-
export interface BugReport {
|
|
479
|
-
type: "broken-link" | "console-error" | "a11y-violation" | "slow-resource" | "missing-image" | "form-error";
|
|
480
|
-
severity: "critical" | "high" | "medium" | "low";
|
|
481
|
-
description: string;
|
|
482
|
-
url: string;
|
|
483
|
-
selector?: string;
|
|
484
|
-
screenshot?: string;
|
|
485
|
-
}
|
|
486
|
-
/**
|
|
487
|
-
* Autonomously explore a page and find bugs.
|
|
488
|
-
*/
|
|
489
|
-
export declare function huntBugs(browser: CBrowser, url: string, options?: {
|
|
490
|
-
maxDepth?: number;
|
|
491
|
-
maxPages?: number;
|
|
492
|
-
timeout?: number;
|
|
493
|
-
}): Promise<{
|
|
494
|
-
bugs: BugReport[];
|
|
495
|
-
pagesVisited: number;
|
|
496
|
-
duration: number;
|
|
497
|
-
}>;
|
|
498
|
-
export interface BrowserDiffResult {
|
|
499
|
-
url: string;
|
|
500
|
-
browsers: string[];
|
|
501
|
-
differences: Array<{
|
|
502
|
-
type: "visual" | "timing" | "content" | "error";
|
|
503
|
-
description: string;
|
|
504
|
-
browsers: string[];
|
|
505
|
-
}>;
|
|
506
|
-
screenshots: Record<string, string>;
|
|
507
|
-
metrics: Record<string, {
|
|
508
|
-
loadTime: number;
|
|
509
|
-
resourceCount: number;
|
|
510
|
-
}>;
|
|
511
|
-
}
|
|
512
|
-
/**
|
|
513
|
-
* Compare page behavior across multiple browsers.
|
|
514
|
-
*/
|
|
515
|
-
export declare function crossBrowserDiff(url: string, browsers?: Array<"chromium" | "firefox" | "webkit">): Promise<BrowserDiffResult>;
|
|
516
|
-
export interface ChaosConfig {
|
|
517
|
-
/** Simulate slow network (ms latency) */
|
|
518
|
-
networkLatency?: number;
|
|
519
|
-
/** Simulate offline mode */
|
|
520
|
-
offline?: boolean;
|
|
521
|
-
/** Block specific URL patterns */
|
|
522
|
-
blockUrls?: string[];
|
|
523
|
-
/** Inject random delays (0-1 probability) */
|
|
524
|
-
randomDelays?: number;
|
|
525
|
-
/** Fail specific API calls */
|
|
526
|
-
failApis?: Array<{
|
|
527
|
-
pattern: string;
|
|
528
|
-
status: number;
|
|
529
|
-
body?: string;
|
|
530
|
-
}>;
|
|
531
|
-
/** CPU throttling (1-20x slowdown) */
|
|
532
|
-
cpuThrottle?: number;
|
|
533
|
-
}
|
|
534
|
-
/**
|
|
535
|
-
* Apply chaos engineering conditions to browser.
|
|
536
|
-
*/
|
|
537
|
-
export declare function applyChaos(browser: CBrowser, config: ChaosConfig): Promise<void>;
|
|
538
|
-
/**
|
|
539
|
-
* Run chaos test - apply conditions and verify app resilience.
|
|
540
|
-
*/
|
|
541
|
-
export declare function runChaosTest(browser: CBrowser, url: string, chaos: ChaosConfig, actions?: string[]): Promise<{
|
|
542
|
-
passed: boolean;
|
|
543
|
-
errors: string[];
|
|
544
|
-
duration: number;
|
|
545
|
-
screenshot: string;
|
|
546
|
-
}>;
|
|
547
|
-
export interface ComparePersonasOptions {
|
|
548
|
-
/** Starting URL for the journey */
|
|
549
|
-
startUrl: string;
|
|
550
|
-
/** Goal to accomplish */
|
|
551
|
-
goal: string;
|
|
552
|
-
/** Personas to compare (names) */
|
|
553
|
-
personas: string[];
|
|
554
|
-
/** Maximum steps per journey */
|
|
555
|
-
maxSteps?: number;
|
|
556
|
-
/** Maximum concurrent browsers */
|
|
557
|
-
maxConcurrency?: number;
|
|
558
|
-
/** Headless mode */
|
|
559
|
-
headless?: boolean;
|
|
560
|
-
}
|
|
561
|
-
/**
|
|
562
|
-
* Run the same journey with multiple personas and compare results.
|
|
563
|
-
* This runs personas in parallel (up to maxConcurrency) for efficiency.
|
|
564
|
-
*/
|
|
565
|
-
export declare function comparePersonas(options: ComparePersonasOptions): Promise<PersonaComparisonResult>;
|
|
566
|
-
/**
|
|
567
|
-
* Generate a formatted comparison report.
|
|
568
|
-
*/
|
|
569
|
-
export declare function formatComparisonReport(comparison: PersonaComparisonResult): string;
|
|
570
|
-
/**
|
|
571
|
-
* Parse a single natural language instruction into an NLTestStep.
|
|
572
|
-
*
|
|
573
|
-
* Supported patterns:
|
|
574
|
-
* - "go to https://..." / "navigate to https://..." / "open https://..."
|
|
575
|
-
* - "click [the] <target>" / "press <target>"
|
|
576
|
-
* - "type '<value>' in[to] <target>" / "fill <target> with '<value>'"
|
|
577
|
-
* - "select '<option>' from <dropdown>"
|
|
578
|
-
* - "scroll down/up"
|
|
579
|
-
* - "wait [for] <seconds> seconds"
|
|
580
|
-
* - "verify <assertion>" / "assert <assertion>" / "check <assertion>"
|
|
581
|
-
* - "take screenshot"
|
|
582
|
-
*/
|
|
583
|
-
export declare function parseNLInstruction(instruction: string): NLTestStep;
|
|
584
|
-
/**
|
|
585
|
-
* Parse a natural language test suite from text.
|
|
586
|
-
*
|
|
587
|
-
* Format:
|
|
588
|
-
* ```
|
|
589
|
-
* # Test: Login Flow
|
|
590
|
-
* go to https://example.com
|
|
591
|
-
* click the login button
|
|
592
|
-
* type "user@example.com" in email field
|
|
593
|
-
* type "password123" in password field
|
|
594
|
-
* click submit
|
|
595
|
-
* verify url contains "/dashboard"
|
|
596
|
-
*
|
|
597
|
-
* # Test: Search Functionality
|
|
598
|
-
* go to https://example.com
|
|
599
|
-
* type "test query" in search box
|
|
600
|
-
* click search button
|
|
601
|
-
* verify page contains "results"
|
|
602
|
-
* ```
|
|
603
|
-
*/
|
|
604
|
-
export declare function parseNLTestSuite(text: string, suiteName?: string): {
|
|
605
|
-
name: string;
|
|
606
|
-
tests: NLTestCase[];
|
|
607
|
-
};
|
|
608
|
-
export interface NLTestSuiteOptions {
|
|
609
|
-
/** Maximum time per step in ms */
|
|
610
|
-
stepTimeout?: number;
|
|
611
|
-
/** Continue running after a test fails */
|
|
612
|
-
continueOnFailure?: boolean;
|
|
613
|
-
/** Take screenshots on failure */
|
|
614
|
-
screenshotOnFailure?: boolean;
|
|
615
|
-
/** Run headless */
|
|
616
|
-
headless?: boolean;
|
|
617
|
-
}
|
|
618
|
-
/**
|
|
619
|
-
* Run a natural language test suite.
|
|
620
|
-
*/
|
|
621
|
-
export declare function runNLTestSuite(suite: {
|
|
622
|
-
name: string;
|
|
623
|
-
tests: NLTestCase[];
|
|
624
|
-
}, options?: NLTestSuiteOptions): Promise<NLTestSuiteResult>;
|
|
625
|
-
/**
|
|
626
|
-
* Format a test suite result as a report.
|
|
627
|
-
*/
|
|
628
|
-
export declare function formatNLTestReport(result: NLTestSuiteResult): string;
|
|
629
|
-
/**
|
|
630
|
-
* Run a natural language test suite from a file.
|
|
631
|
-
*/
|
|
632
|
-
export declare function runNLTestFile(filepath: string, options?: NLTestSuiteOptions): Promise<NLTestSuiteResult>;
|
|
633
|
-
export interface RepairTestOptions {
|
|
634
|
-
/** Run headless */
|
|
635
|
-
headless?: boolean;
|
|
636
|
-
/** Automatically apply the best repair */
|
|
637
|
-
autoApply?: boolean;
|
|
638
|
-
/** Verify repairs by re-running the test */
|
|
639
|
-
verifyRepairs?: boolean;
|
|
640
|
-
/** Maximum retries per step */
|
|
641
|
-
maxRetries?: number;
|
|
642
|
-
}
|
|
643
|
-
/**
|
|
644
|
-
* Run a test, analyze failures, and suggest/apply repairs.
|
|
645
|
-
*/
|
|
646
|
-
export declare function repairTest(test: NLTestCase, options?: RepairTestOptions): Promise<TestRepairResult>;
|
|
647
|
-
/**
|
|
648
|
-
* Run test repair on a full suite.
|
|
649
|
-
*/
|
|
650
|
-
export declare function repairTestSuite(suite: {
|
|
651
|
-
name: string;
|
|
652
|
-
tests: NLTestCase[];
|
|
653
|
-
}, options?: RepairTestOptions): Promise<TestRepairSuiteResult>;
|
|
654
|
-
/**
|
|
655
|
-
* Format a repair result as a report.
|
|
656
|
-
*/
|
|
657
|
-
export declare function formatRepairReport(result: TestRepairSuiteResult): string;
|
|
658
|
-
/**
|
|
659
|
-
* Export repaired test to file.
|
|
660
|
-
*/
|
|
661
|
-
export declare function exportRepairedTest(result: TestRepairResult): string;
|
|
662
|
-
export interface FlakyTestOptions {
|
|
663
|
-
/** Number of times to run each test (default: 5) */
|
|
664
|
-
runs?: number;
|
|
665
|
-
/** Run headless */
|
|
666
|
-
headless?: boolean;
|
|
667
|
-
/** Flakiness threshold to flag a test (default: 20) */
|
|
668
|
-
flakinessThreshold?: number;
|
|
669
|
-
/** Delay between runs in ms (default: 500) */
|
|
670
|
-
delayBetweenRuns?: number;
|
|
671
|
-
}
|
|
672
|
-
/**
|
|
673
|
-
* Run flaky test detection on a test suite.
|
|
674
|
-
*/
|
|
675
|
-
export declare function detectFlakyTests(suite: {
|
|
676
|
-
name: string;
|
|
677
|
-
tests: NLTestCase[];
|
|
678
|
-
}, options?: FlakyTestOptions): Promise<FlakyTestSuiteResult>;
|
|
679
|
-
/**
|
|
680
|
-
* Format a flaky test report.
|
|
681
|
-
*/
|
|
682
|
-
export declare function formatFlakyTestReport(result: FlakyTestSuiteResult): string;
|
|
683
|
-
export interface PerformanceBaselineOptions {
|
|
684
|
-
/** Number of runs to average (default: 3) */
|
|
685
|
-
runs?: number;
|
|
686
|
-
/** Human-readable name for baseline */
|
|
687
|
-
name?: string;
|
|
688
|
-
/** Headless mode */
|
|
689
|
-
headless?: boolean;
|
|
690
|
-
/** Device to emulate */
|
|
691
|
-
device?: string;
|
|
692
|
-
/** Network throttling */
|
|
693
|
-
throttle?: "3g" | "4g" | "wifi";
|
|
694
|
-
}
|
|
695
|
-
export interface PerformanceRegressionOptions {
|
|
696
|
-
/** Regression thresholds */
|
|
697
|
-
thresholds?: PerformanceRegressionThresholds;
|
|
698
|
-
/** Headless mode */
|
|
699
|
-
headless?: boolean;
|
|
700
|
-
}
|
|
701
|
-
/**
|
|
702
|
-
* Capture a performance baseline for a URL
|
|
703
|
-
*/
|
|
704
|
-
export declare function capturePerformanceBaseline(url: string, options?: PerformanceBaselineOptions): Promise<PerformanceBaseline>;
|
|
705
|
-
/**
|
|
706
|
-
* List all saved performance baselines
|
|
707
|
-
*/
|
|
708
|
-
export declare function listPerformanceBaselines(): PerformanceBaseline[];
|
|
709
|
-
/**
|
|
710
|
-
* Load a specific baseline by ID or name
|
|
711
|
-
*/
|
|
712
|
-
export declare function loadPerformanceBaseline(idOrName: string): PerformanceBaseline | null;
|
|
713
|
-
/**
|
|
714
|
-
* Delete a performance baseline
|
|
715
|
-
*/
|
|
716
|
-
export declare function deletePerformanceBaseline(idOrName: string): boolean;
|
|
717
|
-
/**
|
|
718
|
-
* Compare current performance against a baseline
|
|
719
|
-
*/
|
|
720
|
-
export declare function detectPerformanceRegression(url: string, baselineIdOrName: string, options?: PerformanceRegressionOptions): Promise<PerformanceRegressionResult>;
|
|
721
|
-
/**
|
|
722
|
-
* Format a performance regression report
|
|
723
|
-
*/
|
|
724
|
-
export declare function formatPerformanceRegressionReport(result: PerformanceRegressionResult): string;
|
|
725
|
-
/**
|
|
726
|
-
* Parse test files to extract tested URLs and actions
|
|
727
|
-
*/
|
|
728
|
-
export declare function parseTestFilesForCoverage(testFiles: string[]): TestedPage[];
|
|
729
|
-
/**
|
|
730
|
-
* Fetch and parse sitemap.xml
|
|
731
|
-
*/
|
|
732
|
-
export declare function parseSitemap(sitemapUrl: string): Promise<SitePage[]>;
|
|
733
|
-
/**
|
|
734
|
-
* Crawl a site to discover pages
|
|
735
|
-
*/
|
|
736
|
-
export declare function crawlSiteForCoverage(startUrl: string, maxPages?: number, includePattern?: string, excludePattern?: string): Promise<SitePage[]>;
|
|
737
|
-
/**
|
|
738
|
-
* Identify coverage gaps
|
|
739
|
-
*/
|
|
740
|
-
export declare function identifyCoverageGaps(sitePages: SitePage[], testedPages: TestedPage[], minCoverage?: number): CoverageGap[];
|
|
741
|
-
/**
|
|
742
|
-
* Calculate overall coverage analysis
|
|
743
|
-
*/
|
|
744
|
-
export declare function calculateCoverageAnalysis(sitePages: SitePage[], testedPages: TestedPage[]): TestCoverageAnalysis;
|
|
745
|
-
/**
|
|
746
|
-
* Generate complete coverage map
|
|
747
|
-
*/
|
|
748
|
-
export declare function generateCoverageMap(baseUrl: string, testFiles: string[], options?: CoverageMapOptions): Promise<CoverageMapResult>;
|
|
749
|
-
/**
|
|
750
|
-
* Format coverage map as text report
|
|
751
|
-
*/
|
|
752
|
-
export declare function formatCoverageReport(result: CoverageMapResult): string;
|
|
753
|
-
/**
|
|
754
|
-
* Generate HTML coverage report
|
|
755
|
-
*/
|
|
756
|
-
export declare function generateCoverageHtmlReport(result: CoverageMapResult): string;
|
|
757
|
-
/**
|
|
758
|
-
* Load all visual baselines from storage
|
|
759
|
-
*/
|
|
760
|
-
export declare function loadVisualBaselines(): VisualBaseline[];
|
|
761
|
-
/**
|
|
762
|
-
* Capture a visual baseline screenshot
|
|
763
|
-
*/
|
|
764
|
-
export declare function captureVisualBaseline(url: string, name: string, options?: {
|
|
765
|
-
selector?: string;
|
|
766
|
-
device?: string;
|
|
767
|
-
viewport?: {
|
|
768
|
-
width: number;
|
|
769
|
-
height: number;
|
|
770
|
-
};
|
|
771
|
-
waitFor?: string | number;
|
|
772
|
-
}): Promise<VisualBaseline>;
|
|
773
|
-
/**
|
|
774
|
-
* List all visual baselines
|
|
775
|
-
*/
|
|
776
|
-
export declare function listVisualBaselines(): VisualBaseline[];
|
|
777
|
-
/**
|
|
778
|
-
* Get a visual baseline by name
|
|
779
|
-
*/
|
|
780
|
-
export declare function getVisualBaseline(name: string): VisualBaseline | undefined;
|
|
781
|
-
/**
|
|
782
|
-
* Delete a visual baseline
|
|
783
|
-
*/
|
|
784
|
-
export declare function deleteVisualBaseline(name: string): boolean;
|
|
785
|
-
/**
|
|
786
|
-
* Run visual regression test against a baseline
|
|
787
|
-
*/
|
|
788
|
-
export declare function runVisualRegression(url: string, baselineName: string, options?: VisualRegressionOptions): Promise<VisualRegressionResult>;
|
|
789
|
-
/**
|
|
790
|
-
* Run visual regression on multiple pages
|
|
791
|
-
*/
|
|
792
|
-
export declare function runVisualRegressionSuite(suite: VisualTestSuite, options?: VisualRegressionOptions): Promise<VisualTestSuiteResult>;
|
|
793
|
-
/**
|
|
794
|
-
* Format visual regression result as text report
|
|
795
|
-
*/
|
|
796
|
-
export declare function formatVisualRegressionReport(result: VisualRegressionResult): string;
|
|
797
|
-
/**
|
|
798
|
-
* Generate HTML report for visual regression suite
|
|
799
|
-
*/
|
|
800
|
-
export declare function generateVisualRegressionHtmlReport(suiteResult: VisualTestSuiteResult): string;
|
|
801
|
-
/**
|
|
802
|
-
* Run cross-browser visual test for a single URL
|
|
803
|
-
*/
|
|
804
|
-
export declare function runCrossBrowserTest(url: string, options?: CrossBrowserOptions): Promise<CrossBrowserResult>;
|
|
805
|
-
/**
|
|
806
|
-
* Run cross-browser test suite
|
|
807
|
-
*/
|
|
808
|
-
export declare function runCrossBrowserSuite(suite: CrossBrowserSuite): Promise<CrossBrowserSuiteResult>;
|
|
809
|
-
/**
|
|
810
|
-
* Format cross-browser result as text report
|
|
811
|
-
*/
|
|
812
|
-
export declare function formatCrossBrowserReport(result: CrossBrowserResult): string;
|
|
813
|
-
/**
|
|
814
|
-
* Generate HTML report for cross-browser test suite
|
|
815
|
-
*/
|
|
816
|
-
export declare function generateCrossBrowserHtmlReport(suiteResult: CrossBrowserSuiteResult): string;
|
|
817
|
-
/**
|
|
818
|
-
* Run responsive visual test for a single URL
|
|
819
|
-
*/
|
|
820
|
-
export declare function runResponsiveTest(url: string, options?: ResponsiveTestOptions): Promise<ResponsiveTestResult>;
|
|
821
|
-
/**
|
|
822
|
-
* Run responsive test suite for multiple URLs
|
|
823
|
-
*/
|
|
824
|
-
export declare function runResponsiveSuite(suite: ResponsiveSuite): Promise<ResponsiveSuiteResult>;
|
|
825
|
-
/**
|
|
826
|
-
* Format responsive test result as console report
|
|
827
|
-
*/
|
|
828
|
-
export declare function formatResponsiveReport(result: ResponsiveTestResult): string;
|
|
829
|
-
/**
|
|
830
|
-
* Generate HTML report for responsive test suite
|
|
831
|
-
*/
|
|
832
|
-
export declare function generateResponsiveHtmlReport(suiteResult: ResponsiveSuiteResult): string;
|
|
833
|
-
/**
|
|
834
|
-
* List available viewport presets
|
|
835
|
-
*/
|
|
836
|
-
export declare function listViewportPresets(): ViewportPreset[];
|
|
837
|
-
/**
|
|
838
|
-
* Run A/B visual comparison between two URLs
|
|
839
|
-
*/
|
|
840
|
-
export declare function runABComparison(urlA: string, urlB: string, options?: ABComparisonOptions): Promise<ABComparisonResult>;
|
|
841
|
-
/**
|
|
842
|
-
* Run A/B comparison suite for multiple page pairs
|
|
843
|
-
*/
|
|
844
|
-
export declare function runABSuite(suite: ABSuite): Promise<ABSuiteResult>;
|
|
845
|
-
/**
|
|
846
|
-
* Format A/B comparison result as console report
|
|
847
|
-
*/
|
|
848
|
-
export declare function formatABReport(result: ABComparisonResult): string;
|
|
849
|
-
/**
|
|
850
|
-
* Generate HTML report for A/B comparison suite
|
|
851
|
-
*/
|
|
852
|
-
export declare function generateABHtmlReport(suiteResult: ABSuiteResult): string;
|
|
853
443
|
//# sourceMappingURL=browser.d.ts.map
|