qualiow-exploratory-testing 1.0.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/LICENSE +21 -0
- package/README.md +214 -0
- package/data/domains/_default.yml +167 -0
- package/data/domains/ecommerce.yml +198 -0
- package/data/domains/fintech.yml +207 -0
- package/data/domains/marketing.yml +202 -0
- package/data/domains/saas.yml +206 -0
- package/data/knowledge/changelog.yml +75 -0
- package/data/knowledge/custom/.gitkeep +0 -0
- package/data/knowledge/learned-patterns.md +40 -0
- package/data/knowledge/manifest.yml +141 -0
- package/data/knowledge/releases/v0.1.0/entries/checklist-accessibility-wcag.yml +326 -0
- package/data/knowledge/releases/v0.1.0/entries/heuristic-few-hiccupps.yml +194 -0
- package/data/knowledge/releases/v0.1.0/entries/heuristic-goldilocks.yml +143 -0
- package/data/knowledge/releases/v0.1.0/entries/heuristic-rcrcrc.yml +207 -0
- package/data/knowledge/releases/v0.1.0/entries/heuristic-sfdipot.yml +171 -0
- package/data/knowledge/releases/v0.1.0/entries/heuristic-test-tours.yml +253 -0
- package/data/knowledge/releases/v0.1.0/entries/reference-exploratory-testing-types.yml +84 -0
- package/data/knowledge/releases/v0.1.0/entries/reference-heuristic-praxis.yml +95 -0
- package/data/knowledge/releases/v0.1.0/entries/technique-boundary-testing.yml +203 -0
- package/data/knowledge/releases/v0.1.0/entries/technique-business-logic-race-conditions.yml +146 -0
- package/data/knowledge/releases/v0.1.0/entries/technique-data-integrity-testing.yml +269 -0
- package/data/knowledge/releases/v0.1.0/entries/technique-error-guessing.yml +216 -0
- package/data/knowledge/releases/v0.1.0/entries/technique-risk-based-testing.yml +298 -0
- package/data/knowledge/releases/v0.1.0/release.yml +22 -0
- package/data/targets/_default.yml +11 -0
- package/data/targets/testers-ai.yml +14 -0
- package/data/templates/bug-report.md +178 -0
- package/data/templates/coverage-map.md +70 -0
- package/data/templates/session-charter.md +77 -0
- package/data/templates/session-report.md +112 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +1757 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +899 -0
- package/dist/index.js +1133 -0
- package/dist/index.js.map +1 -0
- package/docs/GETTING-STARTED.md +265 -0
- package/package.json +70 -0
- package/skills/qa-explore/SKILL.md +70 -0
- package/skills/qa-explore/phases/00-setup.md +96 -0
- package/skills/qa-explore/phases/01-auth.md +34 -0
- package/skills/qa-explore/phases/02-charter.md +112 -0
- package/skills/qa-explore/phases/03-discovery.md +49 -0
- package/skills/qa-explore/phases/04-journeys.md +51 -0
- package/skills/qa-explore/phases/05-features.md +55 -0
- package/skills/qa-explore/phases/06-edge-cases.md +69 -0
- package/skills/qa-explore/phases/07-reporting.md +162 -0
- package/skills/qa-explore/references/context-integration.md +44 -0
- package/skills/qa-explore/references/security-rules.md +43 -0
- package/skills/qa-explore/references/session-rules.md +33 -0
- package/skills/qa-explore/references/severity-guide.md +14 -0
- package/skills/qa-explore-cleanup/SKILL.md +39 -0
- package/skills/qa-explore-feedback/SKILL.md +73 -0
- package/skills/qa-explore-quick/SKILL.md +80 -0
- package/skills/qa-explore-report/SKILL.md +62 -0
- package/skills/qa-gather/SKILL.md +198 -0
- package/skills/qa-knowledge-add/SKILL.md +91 -0
- package/skills/qa-knowledge-list/SKILL.md +54 -0
- package/skills/qa-target-setup/SKILL.md +106 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1133 @@
|
|
|
1
|
+
// src/schemas/target.schema.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var AuthConfigSchema = z.object({
|
|
4
|
+
strategy: z.enum(["none", "storage_state", "credentials", "token"]),
|
|
5
|
+
state_file: z.string().optional(),
|
|
6
|
+
login_url: z.string().url().optional(),
|
|
7
|
+
credentials: z.object({
|
|
8
|
+
username: z.string(),
|
|
9
|
+
password: z.string()
|
|
10
|
+
}).optional(),
|
|
11
|
+
token: z.string().optional()
|
|
12
|
+
});
|
|
13
|
+
var BrowserConfigSchema = z.object({
|
|
14
|
+
headless: z.boolean(),
|
|
15
|
+
viewport: z.object({
|
|
16
|
+
width: z.number().int().positive(),
|
|
17
|
+
height: z.number().int().positive()
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
var ScopeConfigSchema = z.object({
|
|
21
|
+
start_pages: z.array(z.string()).optional(),
|
|
22
|
+
max_depth: z.number().int().min(0),
|
|
23
|
+
include_patterns: z.array(z.string()).optional(),
|
|
24
|
+
exclude_patterns: z.array(z.string()).optional()
|
|
25
|
+
});
|
|
26
|
+
var SafetyConfigSchema = z.object({
|
|
27
|
+
read_only: z.boolean(),
|
|
28
|
+
no_form_submit: z.boolean(),
|
|
29
|
+
no_file_upload: z.boolean().optional(),
|
|
30
|
+
no_delete_actions: z.boolean().optional()
|
|
31
|
+
});
|
|
32
|
+
var TargetConfigSchema = z.object({
|
|
33
|
+
id: z.string().min(1),
|
|
34
|
+
name: z.string().min(1),
|
|
35
|
+
base_url: z.string().url(),
|
|
36
|
+
domain: z.string().min(1),
|
|
37
|
+
auth: AuthConfigSchema,
|
|
38
|
+
browser: BrowserConfigSchema,
|
|
39
|
+
scope: ScopeConfigSchema,
|
|
40
|
+
safety: SafetyConfigSchema.optional(),
|
|
41
|
+
notes: z.string().optional()
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// src/schemas/knowledge-entry.schema.ts
|
|
45
|
+
import { z as z2 } from "zod";
|
|
46
|
+
var KnowledgeEntryContentSchema = z2.object({
|
|
47
|
+
summary: z2.string().min(1)
|
|
48
|
+
}).passthrough();
|
|
49
|
+
var KnowledgeEntrySchema = z2.object({
|
|
50
|
+
id: z2.string().min(1),
|
|
51
|
+
version: z2.string().min(1),
|
|
52
|
+
type: z2.enum(["heuristic", "technique", "checklist", "reference"]),
|
|
53
|
+
name: z2.string().min(1),
|
|
54
|
+
description: z2.string().min(1),
|
|
55
|
+
author: z2.string().optional(),
|
|
56
|
+
source: z2.string().optional(),
|
|
57
|
+
tags: z2.array(z2.string()).min(1),
|
|
58
|
+
domains: z2.array(z2.string()).min(1),
|
|
59
|
+
priority: z2.enum(["high", "medium", "low"]),
|
|
60
|
+
added: z2.string().min(1),
|
|
61
|
+
content: KnowledgeEntryContentSchema
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// src/schemas/knowledge-manifest.schema.ts
|
|
65
|
+
import { z as z3 } from "zod";
|
|
66
|
+
var KnowledgeManifestStatsSchema = z3.object({
|
|
67
|
+
total_entries: z3.number().int().min(0),
|
|
68
|
+
heuristics: z3.number().int().min(0),
|
|
69
|
+
techniques: z3.number().int().min(0),
|
|
70
|
+
checklists: z3.number().int().min(0),
|
|
71
|
+
references: z3.number().int().min(0),
|
|
72
|
+
domain_profiles: z3.number().int().min(0),
|
|
73
|
+
custom_entries: z3.number().int().min(0)
|
|
74
|
+
});
|
|
75
|
+
var KnowledgeManifestEntrySchema = z3.object({
|
|
76
|
+
id: z3.string().min(1),
|
|
77
|
+
file: z3.string().min(1),
|
|
78
|
+
type: z3.string().min(1),
|
|
79
|
+
priority: z3.enum(["high", "medium", "low"]),
|
|
80
|
+
tags: z3.array(z3.string()),
|
|
81
|
+
domains: z3.array(z3.string())
|
|
82
|
+
});
|
|
83
|
+
var LoadingStrategySchema = z3.object({
|
|
84
|
+
always: z3.array(z3.string()),
|
|
85
|
+
by_domain: z3.record(z3.string(), z3.array(z3.string())),
|
|
86
|
+
by_tag: z3.record(z3.string(), z3.array(z3.string()))
|
|
87
|
+
});
|
|
88
|
+
var KnowledgeManifestSchema = z3.object({
|
|
89
|
+
version: z3.string().min(1),
|
|
90
|
+
last_updated: z3.string().min(1),
|
|
91
|
+
active_releases: z3.array(z3.string()).min(1),
|
|
92
|
+
stats: KnowledgeManifestStatsSchema,
|
|
93
|
+
loading_strategy: LoadingStrategySchema,
|
|
94
|
+
entries: z3.array(KnowledgeManifestEntrySchema).min(1)
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// src/schemas/domain-config.schema.ts
|
|
98
|
+
import { z as z4 } from "zod";
|
|
99
|
+
var JourneySchema = z4.object({
|
|
100
|
+
id: z4.string().min(1),
|
|
101
|
+
name: z4.string().min(1),
|
|
102
|
+
description: z4.string().min(1),
|
|
103
|
+
steps: z4.array(z4.string()).min(1),
|
|
104
|
+
risk: z4.enum(["high", "medium", "low"])
|
|
105
|
+
});
|
|
106
|
+
var DomainConfigSchema = z4.object({
|
|
107
|
+
id: z4.string().min(1),
|
|
108
|
+
name: z4.string().min(1),
|
|
109
|
+
risk_ranking: z4.array(z4.string()).min(1),
|
|
110
|
+
completeness_checklist: z4.array(z4.string()).min(1),
|
|
111
|
+
data_integrity_checks: z4.array(z4.string()).min(1),
|
|
112
|
+
journeys: z4.array(JourneySchema).min(1),
|
|
113
|
+
guidance: z4.array(z4.string()).min(1)
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// src/schemas/session-metrics.schema.ts
|
|
117
|
+
import { z as z5 } from "zod";
|
|
118
|
+
var SeverityCountsSchema = z5.object({
|
|
119
|
+
critical: z5.number().int().min(0),
|
|
120
|
+
high: z5.number().int().min(0),
|
|
121
|
+
medium: z5.number().int().min(0),
|
|
122
|
+
low: z5.number().int().min(0)
|
|
123
|
+
});
|
|
124
|
+
var SessionMetricsSchema = z5.object({
|
|
125
|
+
session_id: z5.string().min(1),
|
|
126
|
+
target: z5.string().min(1),
|
|
127
|
+
date: z5.string().min(1),
|
|
128
|
+
duration_min: z5.number().min(0),
|
|
129
|
+
bugs_found: z5.number().int().min(0),
|
|
130
|
+
severity_counts: SeverityCountsSchema,
|
|
131
|
+
pages_explored: z5.number().int().min(0)
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// src/utils/redact.ts
|
|
135
|
+
var REDACTION_PATTERNS = [
|
|
136
|
+
{
|
|
137
|
+
name: "JWT token",
|
|
138
|
+
pattern: /Bearer\s+eyJ[A-Za-z0-9\-_]+\.[A-Za-z0-9\-_]+\.[A-Za-z0-9\-_]+/g,
|
|
139
|
+
replacement: "Bearer [JWT_REDACTED]"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "API key",
|
|
143
|
+
pattern: /api[_\-]?key[=:\s]+[A-Za-z0-9\-_]{16,}/gi,
|
|
144
|
+
replacement: "api_key=[API_KEY_REDACTED]"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: "Password",
|
|
148
|
+
pattern: /password[=:\s]+[^\s,}"']+/gi,
|
|
149
|
+
replacement: "password=[REDACTED]"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: "Token",
|
|
153
|
+
pattern: /token[=:\s]+[A-Za-z0-9\-_]{16,}/gi,
|
|
154
|
+
replacement: "token=[TOKEN_REDACTED]"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "Secret",
|
|
158
|
+
pattern: /secret[=:\s]+[^\s,}"']+/gi,
|
|
159
|
+
replacement: "secret=[REDACTED]"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "SSN",
|
|
163
|
+
pattern: /\b\d{3}-\d{2}-\d{4}\b/g,
|
|
164
|
+
replacement: "[SSN_REDACTED]"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: "Credit card number",
|
|
168
|
+
pattern: /\b\d{13,19}\b/g,
|
|
169
|
+
replacement: "[CARD_NUMBER_REDACTED]"
|
|
170
|
+
}
|
|
171
|
+
];
|
|
172
|
+
function redact(text) {
|
|
173
|
+
const redactions = [];
|
|
174
|
+
let result = text;
|
|
175
|
+
for (const { name, pattern, replacement } of REDACTION_PATTERNS) {
|
|
176
|
+
pattern.lastIndex = 0;
|
|
177
|
+
if (pattern.test(result)) {
|
|
178
|
+
redactions.push(name);
|
|
179
|
+
pattern.lastIndex = 0;
|
|
180
|
+
result = result.replace(pattern, replacement);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return { text: result, redactions };
|
|
184
|
+
}
|
|
185
|
+
function containsSecrets(text) {
|
|
186
|
+
for (const { pattern } of REDACTION_PATTERNS) {
|
|
187
|
+
pattern.lastIndex = 0;
|
|
188
|
+
if (pattern.test(text)) {
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// src/utils/validate.ts
|
|
196
|
+
import { readFileSync } from "fs";
|
|
197
|
+
import { resolve, join } from "path";
|
|
198
|
+
import { parse as parseYaml } from "yaml";
|
|
199
|
+
import { ZodError } from "zod";
|
|
200
|
+
import { globSync } from "glob";
|
|
201
|
+
function validateYamlFile(filePath, schema) {
|
|
202
|
+
const absPath = resolve(filePath);
|
|
203
|
+
try {
|
|
204
|
+
const raw = readFileSync(absPath, "utf-8");
|
|
205
|
+
const data = parseYaml(raw);
|
|
206
|
+
schema.parse(data);
|
|
207
|
+
return { file: absPath, valid: true };
|
|
208
|
+
} catch (err) {
|
|
209
|
+
if (err instanceof ZodError) {
|
|
210
|
+
return {
|
|
211
|
+
file: absPath,
|
|
212
|
+
valid: false,
|
|
213
|
+
errors: err.issues.map((issue) => ({
|
|
214
|
+
path: issue.path.join("."),
|
|
215
|
+
message: issue.message
|
|
216
|
+
}))
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
file: absPath,
|
|
221
|
+
valid: false,
|
|
222
|
+
errors: [
|
|
223
|
+
{
|
|
224
|
+
path: "",
|
|
225
|
+
message: err instanceof Error ? err.message : "Unknown parsing error"
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
function validateTargetConfig(filePath) {
|
|
232
|
+
return validateYamlFile(filePath, TargetConfigSchema);
|
|
233
|
+
}
|
|
234
|
+
function validateKnowledgeEntry(filePath) {
|
|
235
|
+
return validateYamlFile(filePath, KnowledgeEntrySchema);
|
|
236
|
+
}
|
|
237
|
+
function validateDomainConfig(filePath) {
|
|
238
|
+
return validateYamlFile(filePath, DomainConfigSchema);
|
|
239
|
+
}
|
|
240
|
+
function validateAllConfigs(dataDir) {
|
|
241
|
+
const results = [];
|
|
242
|
+
const absDir = resolve(dataDir);
|
|
243
|
+
const targetFiles = globSync(join(absDir, "targets", "*.yml"));
|
|
244
|
+
for (const file of targetFiles) {
|
|
245
|
+
results.push(validateTargetConfig(file));
|
|
246
|
+
}
|
|
247
|
+
const entryFiles = globSync(
|
|
248
|
+
join(absDir, "knowledge", "releases", "**", "entries", "*.yml")
|
|
249
|
+
);
|
|
250
|
+
for (const file of entryFiles) {
|
|
251
|
+
results.push(validateKnowledgeEntry(file));
|
|
252
|
+
}
|
|
253
|
+
return results;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// src/utils/metrics.ts
|
|
257
|
+
import { readFileSync as readFileSync2, appendFileSync, existsSync, mkdirSync } from "fs";
|
|
258
|
+
import { join as join2, dirname } from "path";
|
|
259
|
+
var METRICS_FILENAME = "metrics.jsonl";
|
|
260
|
+
function appendSessionMetrics(outputDir, metrics) {
|
|
261
|
+
SessionMetricsSchema.parse(metrics);
|
|
262
|
+
const filePath = join2(outputDir, METRICS_FILENAME);
|
|
263
|
+
const dir = dirname(filePath);
|
|
264
|
+
if (!existsSync(dir)) {
|
|
265
|
+
mkdirSync(dir, { recursive: true });
|
|
266
|
+
}
|
|
267
|
+
const line = JSON.stringify(metrics) + "\n";
|
|
268
|
+
appendFileSync(filePath, line, "utf-8");
|
|
269
|
+
}
|
|
270
|
+
function readAllMetrics(outputDir) {
|
|
271
|
+
const filePath = join2(outputDir, METRICS_FILENAME);
|
|
272
|
+
if (!existsSync(filePath)) {
|
|
273
|
+
return [];
|
|
274
|
+
}
|
|
275
|
+
const content = readFileSync2(filePath, "utf-8").trim();
|
|
276
|
+
if (!content) {
|
|
277
|
+
return [];
|
|
278
|
+
}
|
|
279
|
+
const lines = content.split("\n");
|
|
280
|
+
const results = [];
|
|
281
|
+
for (const line of lines) {
|
|
282
|
+
if (line.trim()) {
|
|
283
|
+
const parsed = JSON.parse(line);
|
|
284
|
+
results.push(SessionMetricsSchema.parse(parsed));
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return results;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// src/utils/parse-session.ts
|
|
291
|
+
import { readFileSync as readFileSync3, readdirSync, existsSync as existsSync2 } from "fs";
|
|
292
|
+
import { join as join3, basename } from "path";
|
|
293
|
+
var SEVERITY_ORDER = {
|
|
294
|
+
critical: 0,
|
|
295
|
+
high: 1,
|
|
296
|
+
medium: 2,
|
|
297
|
+
low: 3
|
|
298
|
+
};
|
|
299
|
+
function normalizeSeverity(raw) {
|
|
300
|
+
const lower = raw.toLowerCase().trim();
|
|
301
|
+
if (lower === "critical" || lower === "high" || lower === "medium" || lower === "low") {
|
|
302
|
+
return lower;
|
|
303
|
+
}
|
|
304
|
+
if (lower.startsWith("critical")) return "critical";
|
|
305
|
+
if (lower.startsWith("high")) return "high";
|
|
306
|
+
if (lower.startsWith("medium")) return "medium";
|
|
307
|
+
if (lower.startsWith("low")) return "low";
|
|
308
|
+
return "medium";
|
|
309
|
+
}
|
|
310
|
+
function extractSection(content, headingPrefix) {
|
|
311
|
+
const lines = content.split("\n");
|
|
312
|
+
let capturing = false;
|
|
313
|
+
let capturedLevel = 0;
|
|
314
|
+
const captured = [];
|
|
315
|
+
for (const line of lines) {
|
|
316
|
+
const headingMatch = line.match(/^(#{1,6})\s+(.*)$/);
|
|
317
|
+
if (headingMatch) {
|
|
318
|
+
const level = headingMatch[1].length;
|
|
319
|
+
const text = headingMatch[2].trim();
|
|
320
|
+
if (text.toLowerCase().startsWith(headingPrefix.toLowerCase())) {
|
|
321
|
+
capturing = true;
|
|
322
|
+
capturedLevel = level;
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
if (capturing && level <= capturedLevel) {
|
|
326
|
+
break;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
if (capturing) {
|
|
330
|
+
captured.push(line);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return captured.join("\n").trim();
|
|
334
|
+
}
|
|
335
|
+
function extractNumberedList(text) {
|
|
336
|
+
const steps = [];
|
|
337
|
+
const lines = text.split("\n");
|
|
338
|
+
for (const line of lines) {
|
|
339
|
+
const match = line.match(/^\d+\.\s+(.+)$/);
|
|
340
|
+
if (match) {
|
|
341
|
+
steps.push(match[1].trim());
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return steps;
|
|
345
|
+
}
|
|
346
|
+
function extractEvidence(content) {
|
|
347
|
+
const screenshots = [];
|
|
348
|
+
const console_errors = [];
|
|
349
|
+
const evidenceText = extractSection(content, "Evidence");
|
|
350
|
+
if (!evidenceText) {
|
|
351
|
+
return { screenshots, console_errors };
|
|
352
|
+
}
|
|
353
|
+
for (const line of evidenceText.split("\n")) {
|
|
354
|
+
const trimmed = line.replace(/^[-*]\s*/, "").trim();
|
|
355
|
+
if (/screenshot/i.test(trimmed)) {
|
|
356
|
+
const pathMatch = trimmed.match(/:\s*(.+)/);
|
|
357
|
+
if (pathMatch) {
|
|
358
|
+
screenshots.push(pathMatch[1].trim());
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
if (/console\s*(error|log)/i.test(trimmed)) {
|
|
362
|
+
const msgMatch = trimmed.match(/:\s*(.+)/);
|
|
363
|
+
if (msgMatch && !/none/i.test(msgMatch[1])) {
|
|
364
|
+
console_errors.push(msgMatch[1].trim());
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return { screenshots, console_errors };
|
|
369
|
+
}
|
|
370
|
+
async function parseBugReport(filePath) {
|
|
371
|
+
const content = readFileSync3(filePath, "utf-8");
|
|
372
|
+
const filename = basename(filePath, ".md");
|
|
373
|
+
const id = filename;
|
|
374
|
+
let title = "";
|
|
375
|
+
let component = "";
|
|
376
|
+
const titleMatch = content.match(/^#\s+(?:BUG[-\w]*:\s*)?(.+)$/m) ?? content.match(/^##\s+(?:BUG[-\w]*:\s*)?(.+)$/m);
|
|
377
|
+
if (titleMatch) {
|
|
378
|
+
title = titleMatch[1].trim();
|
|
379
|
+
}
|
|
380
|
+
const componentMatch = title.match(/^\[([^\]]+)\]\s*/);
|
|
381
|
+
if (componentMatch) {
|
|
382
|
+
component = componentMatch[1];
|
|
383
|
+
title = title.replace(/^\[[^\]]+\]\s*/, "").trim();
|
|
384
|
+
}
|
|
385
|
+
if (!component) {
|
|
386
|
+
const categoryMatch = content.match(/\|\s*Category\s*\|\s*(.+?)\s*\|/i);
|
|
387
|
+
if (categoryMatch) {
|
|
388
|
+
component = categoryMatch[1].trim();
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
let severity = "medium";
|
|
392
|
+
const severityMatch = content.match(/\*\*Severity:\*\*\s*(.+)/i) ?? content.match(/^##\s+Severity:\s*(.+)/mi);
|
|
393
|
+
if (severityMatch) {
|
|
394
|
+
severity = normalizeSeverity(severityMatch[1]);
|
|
395
|
+
}
|
|
396
|
+
let url = "";
|
|
397
|
+
const urlMatch = content.match(/\*\*URL:\*\*\s*(.+)/i) ?? content.match(/URL:\s*(https?:\/\/[^\s]+)/i);
|
|
398
|
+
if (urlMatch) {
|
|
399
|
+
url = urlMatch[1].trim();
|
|
400
|
+
}
|
|
401
|
+
const expected = extractSection(content, "Expected").replace(/^_.*_\n?/, "").replace(/^>\s*/gm, "").trim();
|
|
402
|
+
const actual = extractSection(content, "Actual").replace(/^_.*_\n?/, "").replace(/^>\s*/gm, "").trim();
|
|
403
|
+
const stepsSection = extractSection(content, "Steps to Reproduce");
|
|
404
|
+
const steps = extractNumberedList(stepsSection);
|
|
405
|
+
const business_impact = extractSection(content, "Business Impact");
|
|
406
|
+
const evidence = extractEvidence(content);
|
|
407
|
+
return {
|
|
408
|
+
id,
|
|
409
|
+
title,
|
|
410
|
+
severity,
|
|
411
|
+
component,
|
|
412
|
+
url,
|
|
413
|
+
expected,
|
|
414
|
+
actual,
|
|
415
|
+
steps,
|
|
416
|
+
business_impact,
|
|
417
|
+
evidence
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
async function parseSession(sessionDir) {
|
|
421
|
+
const id = basename(sessionDir);
|
|
422
|
+
let charter;
|
|
423
|
+
const charterPath = join3(sessionDir, "charter.md");
|
|
424
|
+
if (existsSync2(charterPath)) {
|
|
425
|
+
charter = readFileSync3(charterPath, "utf-8");
|
|
426
|
+
}
|
|
427
|
+
let report;
|
|
428
|
+
const reportPath = join3(sessionDir, "session-report.md");
|
|
429
|
+
if (existsSync2(reportPath)) {
|
|
430
|
+
report = readFileSync3(reportPath, "utf-8");
|
|
431
|
+
}
|
|
432
|
+
const phases = [];
|
|
433
|
+
if (existsSync2(sessionDir)) {
|
|
434
|
+
const files = readdirSync(sessionDir);
|
|
435
|
+
const phaseFiles = files.filter((f) => /^phase-\d+/i.test(f)).sort();
|
|
436
|
+
for (const file of phaseFiles) {
|
|
437
|
+
const content = readFileSync3(join3(sessionDir, file), "utf-8");
|
|
438
|
+
const name = file.replace(/\.md$/, "");
|
|
439
|
+
phases.push({ name, content });
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
const bugsDir = join3(sessionDir, "bugs");
|
|
443
|
+
const bugs = [];
|
|
444
|
+
if (existsSync2(bugsDir)) {
|
|
445
|
+
const bugFiles = readdirSync(bugsDir).filter((f) => /^BUG-.*\.md$/i.test(f)).sort();
|
|
446
|
+
for (const file of bugFiles) {
|
|
447
|
+
const bug = await parseBugReport(join3(bugsDir, file));
|
|
448
|
+
bugs.push(bug);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
bugs.sort((a, b) => SEVERITY_ORDER[a.severity] - SEVERITY_ORDER[b.severity]);
|
|
452
|
+
return {
|
|
453
|
+
id,
|
|
454
|
+
charter,
|
|
455
|
+
bugs,
|
|
456
|
+
report,
|
|
457
|
+
phases
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
// src/formatters/html-report.ts
|
|
462
|
+
import Handlebars from "handlebars";
|
|
463
|
+
function extractReportMeta(report, sessionId) {
|
|
464
|
+
const meta = {
|
|
465
|
+
target: sessionId,
|
|
466
|
+
date: "",
|
|
467
|
+
duration: "",
|
|
468
|
+
sessionId,
|
|
469
|
+
summary: ""
|
|
470
|
+
};
|
|
471
|
+
const dateMatch = report.match(/\*\*Date:\*\*\s*(.+)/i) ?? report.match(/\|\s*Date\s*\|\s*(.+?)\s*\|/i);
|
|
472
|
+
if (dateMatch) meta.date = dateMatch[1].trim();
|
|
473
|
+
const durationMatch = report.match(/\*\*Duration:\*\*\s*(.+)/i) ?? report.match(/\|\s*Duration\s*\|\s*(.+?)\s*\|/i);
|
|
474
|
+
if (durationMatch) meta.duration = durationMatch[1].trim();
|
|
475
|
+
const targetMatch = report.match(/\*\*Application:\*\*\s*(.+)/i) ?? report.match(/\*\*Target:\*\*\s*(.+)/i) ?? report.match(/\|\s*Target\s*\|\s*(.+?)\s*\|/i);
|
|
476
|
+
if (targetMatch) meta.target = targetMatch[1].trim();
|
|
477
|
+
const summaryMatch = report.match(/##\s+Executive Summary\s*\n+([\s\S]*?)(?=\n##\s|\n---)/i);
|
|
478
|
+
if (summaryMatch) meta.summary = summaryMatch[1].trim();
|
|
479
|
+
return meta;
|
|
480
|
+
}
|
|
481
|
+
function extractCoverage(report) {
|
|
482
|
+
const entries = [];
|
|
483
|
+
const tableMatch = report.match(
|
|
484
|
+
/\|\s*Area\s*\|\s*Status\s*\|[\s\S]*?\n((?:\|.+\|.+\n?)+)/i
|
|
485
|
+
);
|
|
486
|
+
if (!tableMatch) return entries;
|
|
487
|
+
const rows = tableMatch[1].split("\n").filter((r) => r.trim().startsWith("|"));
|
|
488
|
+
for (const row of rows) {
|
|
489
|
+
const cells = row.split("|").map((c) => c.trim()).filter(Boolean);
|
|
490
|
+
if (cells.length >= 2 && !cells[0].startsWith("---")) {
|
|
491
|
+
entries.push({
|
|
492
|
+
area: cells[0] || "",
|
|
493
|
+
status: cells[1] || "",
|
|
494
|
+
bugsFound: cells[3] || "0",
|
|
495
|
+
notes: cells[4] || ""
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
return entries;
|
|
500
|
+
}
|
|
501
|
+
function extractListSection(report, heading) {
|
|
502
|
+
const items = [];
|
|
503
|
+
const regex = new RegExp(`##\\s+${heading}\\s*\\n+([\\s\\S]*?)(?=\\n##\\s|\\n---|$)`, "i");
|
|
504
|
+
const match = report.match(regex);
|
|
505
|
+
if (!match) return items;
|
|
506
|
+
for (const line of match[1].split("\n")) {
|
|
507
|
+
const itemMatch = line.match(/^[-*]\s+(?:\[.\]\s+)?(.+)/);
|
|
508
|
+
if (itemMatch) {
|
|
509
|
+
items.push(itemMatch[1].trim());
|
|
510
|
+
}
|
|
511
|
+
const numberedMatch = line.match(/^\d+\.\s+\*\*(.+?)\*\*\s*(.+)?/);
|
|
512
|
+
if (numberedMatch) {
|
|
513
|
+
const text = numberedMatch[2] ? `${numberedMatch[1]} ${numberedMatch[2]}` : numberedMatch[1];
|
|
514
|
+
items.push(text.replace(/\s*--\s*/, " -- "));
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
return items;
|
|
518
|
+
}
|
|
519
|
+
var HTML_TEMPLATE = `<!DOCTYPE html>
|
|
520
|
+
<html lang="en">
|
|
521
|
+
<head>
|
|
522
|
+
<meta charset="UTF-8">
|
|
523
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
524
|
+
<title>Qualiow Report \u2014 {{meta.target}}</title>
|
|
525
|
+
<style>
|
|
526
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
527
|
+
|
|
528
|
+
body {
|
|
529
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
530
|
+
background: #0a0f1a;
|
|
531
|
+
color: #e0e6ed;
|
|
532
|
+
line-height: 1.6;
|
|
533
|
+
padding: 2rem;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
a { color: #3498db; text-decoration: none; }
|
|
537
|
+
a:hover { text-decoration: underline; }
|
|
538
|
+
|
|
539
|
+
.container { max-width: 960px; margin: 0 auto; }
|
|
540
|
+
|
|
541
|
+
/* Header */
|
|
542
|
+
.header {
|
|
543
|
+
border-bottom: 2px solid #1e2a3a;
|
|
544
|
+
padding-bottom: 1.5rem;
|
|
545
|
+
margin-bottom: 2rem;
|
|
546
|
+
}
|
|
547
|
+
.header h1 {
|
|
548
|
+
font-size: 1.75rem;
|
|
549
|
+
font-weight: 700;
|
|
550
|
+
color: #ffffff;
|
|
551
|
+
margin-bottom: 0.25rem;
|
|
552
|
+
}
|
|
553
|
+
.header .meta {
|
|
554
|
+
display: flex;
|
|
555
|
+
flex-wrap: wrap;
|
|
556
|
+
gap: 1.5rem;
|
|
557
|
+
font-size: 0.9rem;
|
|
558
|
+
color: #8899aa;
|
|
559
|
+
margin-top: 0.5rem;
|
|
560
|
+
}
|
|
561
|
+
.header .meta span { white-space: nowrap; }
|
|
562
|
+
|
|
563
|
+
/* Stats cards */
|
|
564
|
+
.stats {
|
|
565
|
+
display: grid;
|
|
566
|
+
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
|
567
|
+
gap: 1rem;
|
|
568
|
+
margin-bottom: 2rem;
|
|
569
|
+
}
|
|
570
|
+
.stat-card {
|
|
571
|
+
background: #111927;
|
|
572
|
+
border-radius: 8px;
|
|
573
|
+
padding: 1rem 1.25rem;
|
|
574
|
+
text-align: center;
|
|
575
|
+
}
|
|
576
|
+
.stat-card .number {
|
|
577
|
+
font-size: 2rem;
|
|
578
|
+
font-weight: 700;
|
|
579
|
+
display: block;
|
|
580
|
+
}
|
|
581
|
+
.stat-card .label {
|
|
582
|
+
font-size: 0.8rem;
|
|
583
|
+
color: #8899aa;
|
|
584
|
+
text-transform: uppercase;
|
|
585
|
+
letter-spacing: 0.05em;
|
|
586
|
+
}
|
|
587
|
+
.stat-total .number { color: #e0e6ed; }
|
|
588
|
+
.stat-critical .number { color: #ff4757; }
|
|
589
|
+
.stat-high .number { color: #ffa502; }
|
|
590
|
+
.stat-medium .number { color: #ffd32a; }
|
|
591
|
+
.stat-low .number { color: #3498db; }
|
|
592
|
+
|
|
593
|
+
/* Summary */
|
|
594
|
+
.summary {
|
|
595
|
+
background: #111927;
|
|
596
|
+
border-radius: 8px;
|
|
597
|
+
padding: 1.25rem 1.5rem;
|
|
598
|
+
margin-bottom: 2rem;
|
|
599
|
+
font-size: 0.95rem;
|
|
600
|
+
color: #c0c8d0;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
/* Section headings */
|
|
604
|
+
.section-title {
|
|
605
|
+
font-size: 1.25rem;
|
|
606
|
+
font-weight: 600;
|
|
607
|
+
color: #ffffff;
|
|
608
|
+
margin: 2rem 0 1rem;
|
|
609
|
+
padding-bottom: 0.5rem;
|
|
610
|
+
border-bottom: 1px solid #1e2a3a;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/* Bug cards */
|
|
614
|
+
.bug-card {
|
|
615
|
+
background: #111927;
|
|
616
|
+
border-radius: 8px;
|
|
617
|
+
border-left: 4px solid #3498db;
|
|
618
|
+
padding: 1.25rem 1.5rem;
|
|
619
|
+
margin-bottom: 1rem;
|
|
620
|
+
}
|
|
621
|
+
.bug-card.severity-critical { border-left-color: #ff4757; }
|
|
622
|
+
.bug-card.severity-high { border-left-color: #ffa502; }
|
|
623
|
+
.bug-card.severity-medium { border-left-color: #ffd32a; }
|
|
624
|
+
.bug-card.severity-low { border-left-color: #3498db; }
|
|
625
|
+
|
|
626
|
+
.bug-card .bug-header {
|
|
627
|
+
display: flex;
|
|
628
|
+
align-items: center;
|
|
629
|
+
flex-wrap: wrap;
|
|
630
|
+
gap: 0.5rem;
|
|
631
|
+
margin-bottom: 0.75rem;
|
|
632
|
+
}
|
|
633
|
+
.bug-card .bug-title {
|
|
634
|
+
font-size: 1rem;
|
|
635
|
+
font-weight: 600;
|
|
636
|
+
color: #ffffff;
|
|
637
|
+
flex: 1;
|
|
638
|
+
min-width: 200px;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.badge {
|
|
642
|
+
display: inline-block;
|
|
643
|
+
font-size: 0.7rem;
|
|
644
|
+
font-weight: 600;
|
|
645
|
+
text-transform: uppercase;
|
|
646
|
+
letter-spacing: 0.05em;
|
|
647
|
+
padding: 0.2rem 0.5rem;
|
|
648
|
+
border-radius: 4px;
|
|
649
|
+
white-space: nowrap;
|
|
650
|
+
}
|
|
651
|
+
.badge-critical { background: #ff475733; color: #ff4757; }
|
|
652
|
+
.badge-high { background: #ffa50233; color: #ffa502; }
|
|
653
|
+
.badge-medium { background: #ffd32a33; color: #ffd32a; }
|
|
654
|
+
.badge-low { background: #3498db33; color: #3498db; }
|
|
655
|
+
.badge-component { background: #1e2a3a; color: #8899aa; }
|
|
656
|
+
|
|
657
|
+
.bug-section-label {
|
|
658
|
+
font-size: 0.8rem;
|
|
659
|
+
font-weight: 600;
|
|
660
|
+
text-transform: uppercase;
|
|
661
|
+
letter-spacing: 0.05em;
|
|
662
|
+
color: #8899aa;
|
|
663
|
+
margin: 0.75rem 0 0.25rem;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
.bug-card p,
|
|
667
|
+
.bug-card li {
|
|
668
|
+
font-size: 0.9rem;
|
|
669
|
+
color: #c0c8d0;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.bug-card ol {
|
|
673
|
+
padding-left: 1.25rem;
|
|
674
|
+
margin: 0.25rem 0;
|
|
675
|
+
}
|
|
676
|
+
.bug-card ol li {
|
|
677
|
+
margin-bottom: 0.15rem;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
.bug-card .evidence-item {
|
|
681
|
+
font-size: 0.85rem;
|
|
682
|
+
color: #8899aa;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
/* Coverage table */
|
|
686
|
+
table {
|
|
687
|
+
width: 100%;
|
|
688
|
+
border-collapse: collapse;
|
|
689
|
+
margin-bottom: 1rem;
|
|
690
|
+
font-size: 0.9rem;
|
|
691
|
+
}
|
|
692
|
+
th, td {
|
|
693
|
+
text-align: left;
|
|
694
|
+
padding: 0.5rem 0.75rem;
|
|
695
|
+
border-bottom: 1px solid #1e2a3a;
|
|
696
|
+
}
|
|
697
|
+
th {
|
|
698
|
+
font-size: 0.8rem;
|
|
699
|
+
text-transform: uppercase;
|
|
700
|
+
letter-spacing: 0.05em;
|
|
701
|
+
color: #8899aa;
|
|
702
|
+
font-weight: 600;
|
|
703
|
+
}
|
|
704
|
+
td { color: #c0c8d0; }
|
|
705
|
+
|
|
706
|
+
/* Lists */
|
|
707
|
+
.list-section ul {
|
|
708
|
+
list-style: disc;
|
|
709
|
+
padding-left: 1.25rem;
|
|
710
|
+
}
|
|
711
|
+
.list-section li {
|
|
712
|
+
font-size: 0.9rem;
|
|
713
|
+
color: #c0c8d0;
|
|
714
|
+
margin-bottom: 0.35rem;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
/* Footer */
|
|
718
|
+
.footer {
|
|
719
|
+
margin-top: 3rem;
|
|
720
|
+
padding-top: 1.5rem;
|
|
721
|
+
border-top: 1px solid #1e2a3a;
|
|
722
|
+
text-align: center;
|
|
723
|
+
font-size: 0.8rem;
|
|
724
|
+
color: #556677;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
/* Print styles */
|
|
728
|
+
@media print {
|
|
729
|
+
body {
|
|
730
|
+
background: #ffffff;
|
|
731
|
+
color: #1a1a1a;
|
|
732
|
+
padding: 1rem;
|
|
733
|
+
}
|
|
734
|
+
.stat-card, .bug-card, .summary {
|
|
735
|
+
background: #f5f5f5;
|
|
736
|
+
-webkit-print-color-adjust: exact;
|
|
737
|
+
print-color-adjust: exact;
|
|
738
|
+
}
|
|
739
|
+
.stat-total .number { color: #1a1a1a; }
|
|
740
|
+
.stat-critical .number { color: #cc0000; }
|
|
741
|
+
.stat-high .number { color: #cc7700; }
|
|
742
|
+
.stat-medium .number { color: #cc9900; }
|
|
743
|
+
.stat-low .number { color: #2266aa; }
|
|
744
|
+
.bug-card .bug-title { color: #1a1a1a; }
|
|
745
|
+
th { color: #555555; }
|
|
746
|
+
td, .bug-card p, .bug-card li, .list-section li { color: #333333; }
|
|
747
|
+
.bug-section-label { color: #555555; }
|
|
748
|
+
.footer { color: #999999; }
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/* Responsive */
|
|
752
|
+
@media (max-width: 600px) {
|
|
753
|
+
body { padding: 1rem; }
|
|
754
|
+
.header h1 { font-size: 1.35rem; }
|
|
755
|
+
.stats { grid-template-columns: repeat(2, 1fr); }
|
|
756
|
+
.bug-card .bug-header { flex-direction: column; align-items: flex-start; }
|
|
757
|
+
}
|
|
758
|
+
</style>
|
|
759
|
+
</head>
|
|
760
|
+
<body>
|
|
761
|
+
<div class="container">
|
|
762
|
+
|
|
763
|
+
<div class="header">
|
|
764
|
+
<h1>Exploratory Testing Report</h1>
|
|
765
|
+
<div class="meta">
|
|
766
|
+
<span>Target: <strong>{{meta.target}}</strong></span>
|
|
767
|
+
{{#if meta.date}}<span>Date: <strong>{{meta.date}}</strong></span>{{/if}}
|
|
768
|
+
{{#if meta.duration}}<span>Duration: <strong>{{meta.duration}}</strong></span>{{/if}}
|
|
769
|
+
<span>Session: <strong>{{meta.sessionId}}</strong></span>
|
|
770
|
+
</div>
|
|
771
|
+
</div>
|
|
772
|
+
|
|
773
|
+
<div class="stats">
|
|
774
|
+
<div class="stat-card stat-total">
|
|
775
|
+
<span class="number">{{totalBugs}}</span>
|
|
776
|
+
<span class="label">Total Bugs</span>
|
|
777
|
+
</div>
|
|
778
|
+
<div class="stat-card stat-critical">
|
|
779
|
+
<span class="number">{{criticalCount}}</span>
|
|
780
|
+
<span class="label">Critical</span>
|
|
781
|
+
</div>
|
|
782
|
+
<div class="stat-card stat-high">
|
|
783
|
+
<span class="number">{{highCount}}</span>
|
|
784
|
+
<span class="label">High</span>
|
|
785
|
+
</div>
|
|
786
|
+
<div class="stat-card stat-medium">
|
|
787
|
+
<span class="number">{{mediumCount}}</span>
|
|
788
|
+
<span class="label">Medium</span>
|
|
789
|
+
</div>
|
|
790
|
+
<div class="stat-card stat-low">
|
|
791
|
+
<span class="number">{{lowCount}}</span>
|
|
792
|
+
<span class="label">Low</span>
|
|
793
|
+
</div>
|
|
794
|
+
</div>
|
|
795
|
+
|
|
796
|
+
{{#if meta.summary}}
|
|
797
|
+
<div class="summary">{{meta.summary}}</div>
|
|
798
|
+
{{/if}}
|
|
799
|
+
|
|
800
|
+
<h2 class="section-title">Bugs Found</h2>
|
|
801
|
+
|
|
802
|
+
{{#each bugs}}
|
|
803
|
+
<div class="bug-card severity-{{this.severity}}">
|
|
804
|
+
<div class="bug-header">
|
|
805
|
+
<span class="bug-title">{{this.id}}: {{this.title}}</span>
|
|
806
|
+
<span class="badge badge-{{this.severity}}">{{this.severity}}</span>
|
|
807
|
+
{{#if this.component}}<span class="badge badge-component">{{this.component}}</span>{{/if}}
|
|
808
|
+
</div>
|
|
809
|
+
|
|
810
|
+
{{#if this.business_impact}}
|
|
811
|
+
<div class="bug-section-label">Business Impact</div>
|
|
812
|
+
<p>{{this.business_impact_summary}}</p>
|
|
813
|
+
{{/if}}
|
|
814
|
+
|
|
815
|
+
{{#if this.steps.length}}
|
|
816
|
+
<div class="bug-section-label">Steps to Reproduce</div>
|
|
817
|
+
<ol>
|
|
818
|
+
{{#each this.steps}}
|
|
819
|
+
<li>{{this}}</li>
|
|
820
|
+
{{/each}}
|
|
821
|
+
</ol>
|
|
822
|
+
{{/if}}
|
|
823
|
+
|
|
824
|
+
{{#if this.hasEvidence}}
|
|
825
|
+
<div class="bug-section-label">Evidence</div>
|
|
826
|
+
{{#each this.evidence.screenshots}}
|
|
827
|
+
<p class="evidence-item">Screenshot: {{this}}</p>
|
|
828
|
+
{{/each}}
|
|
829
|
+
{{#each this.evidence.console_errors}}
|
|
830
|
+
<p class="evidence-item">Console: {{this}}</p>
|
|
831
|
+
{{/each}}
|
|
832
|
+
{{/if}}
|
|
833
|
+
</div>
|
|
834
|
+
{{/each}}
|
|
835
|
+
|
|
836
|
+
{{#if coverage.length}}
|
|
837
|
+
<h2 class="section-title">Coverage Map</h2>
|
|
838
|
+
<table>
|
|
839
|
+
<thead>
|
|
840
|
+
<tr>
|
|
841
|
+
<th>Area</th>
|
|
842
|
+
<th>Status</th>
|
|
843
|
+
<th>Bugs</th>
|
|
844
|
+
<th>Notes</th>
|
|
845
|
+
</tr>
|
|
846
|
+
</thead>
|
|
847
|
+
<tbody>
|
|
848
|
+
{{#each coverage}}
|
|
849
|
+
<tr>
|
|
850
|
+
<td>{{this.area}}</td>
|
|
851
|
+
<td>{{this.status}}</td>
|
|
852
|
+
<td>{{this.bugsFound}}</td>
|
|
853
|
+
<td>{{this.notes}}</td>
|
|
854
|
+
</tr>
|
|
855
|
+
{{/each}}
|
|
856
|
+
</tbody>
|
|
857
|
+
</table>
|
|
858
|
+
{{/if}}
|
|
859
|
+
|
|
860
|
+
{{#if observations.length}}
|
|
861
|
+
<h2 class="section-title">Observations</h2>
|
|
862
|
+
<div class="list-section">
|
|
863
|
+
<ul>
|
|
864
|
+
{{#each observations}}
|
|
865
|
+
<li>{{this}}</li>
|
|
866
|
+
{{/each}}
|
|
867
|
+
</ul>
|
|
868
|
+
</div>
|
|
869
|
+
{{/if}}
|
|
870
|
+
|
|
871
|
+
{{#if recommendations.length}}
|
|
872
|
+
<h2 class="section-title">Recommendations</h2>
|
|
873
|
+
<div class="list-section">
|
|
874
|
+
<ul>
|
|
875
|
+
{{#each recommendations}}
|
|
876
|
+
<li>{{this}}</li>
|
|
877
|
+
{{/each}}
|
|
878
|
+
</ul>
|
|
879
|
+
</div>
|
|
880
|
+
{{/if}}
|
|
881
|
+
|
|
882
|
+
<div class="footer">
|
|
883
|
+
Generated by Qualiow Exploratory Testing
|
|
884
|
+
</div>
|
|
885
|
+
|
|
886
|
+
</div>
|
|
887
|
+
</body>
|
|
888
|
+
</html>`;
|
|
889
|
+
var compiledTemplate = Handlebars.compile(HTML_TEMPLATE);
|
|
890
|
+
async function generateHtmlReport(sessionDir) {
|
|
891
|
+
const session = await parseSession(sessionDir);
|
|
892
|
+
const report = session.report ?? "";
|
|
893
|
+
const meta = extractReportMeta(report, session.id);
|
|
894
|
+
const coverage = extractCoverage(report);
|
|
895
|
+
const observations = extractListSection(report, "Observations");
|
|
896
|
+
const recommendations = extractListSection(report, "Recommendations");
|
|
897
|
+
const counts = { critical: 0, high: 0, medium: 0, low: 0 };
|
|
898
|
+
for (const bug of session.bugs) {
|
|
899
|
+
counts[bug.severity]++;
|
|
900
|
+
}
|
|
901
|
+
const bugsForTemplate = session.bugs.map((bug) => ({
|
|
902
|
+
...bug,
|
|
903
|
+
business_impact_summary: summarizeBusinessImpact(bug.business_impact),
|
|
904
|
+
hasEvidence: bug.evidence.screenshots.length > 0 || bug.evidence.console_errors.length > 0
|
|
905
|
+
}));
|
|
906
|
+
const html = compiledTemplate({
|
|
907
|
+
meta,
|
|
908
|
+
totalBugs: session.bugs.length,
|
|
909
|
+
criticalCount: counts.critical,
|
|
910
|
+
highCount: counts.high,
|
|
911
|
+
mediumCount: counts.medium,
|
|
912
|
+
lowCount: counts.low,
|
|
913
|
+
bugs: bugsForTemplate,
|
|
914
|
+
coverage,
|
|
915
|
+
observations,
|
|
916
|
+
recommendations
|
|
917
|
+
});
|
|
918
|
+
return html;
|
|
919
|
+
}
|
|
920
|
+
function summarizeBusinessImpact(impact) {
|
|
921
|
+
if (!impact) return "";
|
|
922
|
+
const lines = impact.split("\n").filter((l) => l.trim());
|
|
923
|
+
const summaryLines = [];
|
|
924
|
+
for (const line of lines) {
|
|
925
|
+
const cleaned = line.replace(/^[-*]\s*/, "").replace(/^\*\*[^*]+\*\*\s*/, "").trim();
|
|
926
|
+
if (cleaned) {
|
|
927
|
+
summaryLines.push(cleaned);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
return summaryLines.slice(0, 3).join(" ");
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
// src/formatters/json-report.ts
|
|
934
|
+
function extractTarget(report, sessionId) {
|
|
935
|
+
const match = report.match(/\*\*Application:\*\*\s*(.+)/i) ?? report.match(/\*\*Target:\*\*\s*(.+)/i) ?? report.match(/\|\s*Target\s*\|\s*(.+?)\s*\|/i);
|
|
936
|
+
if (match) return match[1].trim();
|
|
937
|
+
const parts = sessionId.split("-");
|
|
938
|
+
return parts[parts.length - 1] || sessionId;
|
|
939
|
+
}
|
|
940
|
+
function extractDate(report) {
|
|
941
|
+
const match = report.match(/\*\*Date:\*\*\s*(\d{4}-\d{2}-\d{2})/i) ?? report.match(/\|\s*Date\s*\|\s*(\d{4}-\d{2}-\d{2})\s*\|/i);
|
|
942
|
+
return match ? match[1] : "";
|
|
943
|
+
}
|
|
944
|
+
function extractDuration(report) {
|
|
945
|
+
const match = report.match(/\*\*Duration:\*\*\s*~?(\d+)\s*min/i) ?? report.match(/\|\s*Duration\s*\|\s*~?(\d+)\s*min/i);
|
|
946
|
+
return match ? parseInt(match[1], 10) : 0;
|
|
947
|
+
}
|
|
948
|
+
function extractPagesExplored(report) {
|
|
949
|
+
const match = report.match(/Pages\s+Explored\s*\|\s*(\d+)/i);
|
|
950
|
+
return match ? parseInt(match[1], 10) : 0;
|
|
951
|
+
}
|
|
952
|
+
function extractCoverage2(report) {
|
|
953
|
+
const entries = [];
|
|
954
|
+
const tableMatch = report.match(
|
|
955
|
+
/\|\s*Area\s*\|\s*Status\s*\|[\s\S]*?\n((?:\|.+\|.+\n?)+)/i
|
|
956
|
+
);
|
|
957
|
+
if (!tableMatch) return entries;
|
|
958
|
+
const rows = tableMatch[1].split("\n").filter((r) => r.trim().startsWith("|"));
|
|
959
|
+
for (const row of rows) {
|
|
960
|
+
const cells = row.split("|").map((c) => c.trim()).filter(Boolean);
|
|
961
|
+
if (cells.length >= 2 && !cells[0].startsWith("---")) {
|
|
962
|
+
entries.push({
|
|
963
|
+
area: cells[0] || "",
|
|
964
|
+
status: cells[1] || "",
|
|
965
|
+
bugs_found: parseInt(cells[3] || "0", 10) || 0,
|
|
966
|
+
notes: cells[4] || ""
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
return entries;
|
|
971
|
+
}
|
|
972
|
+
function extractListSection2(report, heading) {
|
|
973
|
+
const items = [];
|
|
974
|
+
const regex = new RegExp(`##\\s+${heading}\\s*\\n+([\\s\\S]*?)(?=\\n##\\s|\\n---|$)`, "i");
|
|
975
|
+
const match = report.match(regex);
|
|
976
|
+
if (!match) return items;
|
|
977
|
+
for (const line of match[1].split("\n")) {
|
|
978
|
+
const itemMatch = line.match(/^[-*]\s+(?:\[.\]\s+)?(.+)/);
|
|
979
|
+
if (itemMatch) {
|
|
980
|
+
items.push(itemMatch[1].trim());
|
|
981
|
+
}
|
|
982
|
+
const numberedMatch = line.match(/^\d+\.\s+\*\*(.+?)\*\*\s*(.+)?/);
|
|
983
|
+
if (numberedMatch) {
|
|
984
|
+
const text = numberedMatch[2] ? `${numberedMatch[1]} ${numberedMatch[2]}` : numberedMatch[1];
|
|
985
|
+
items.push(text.replace(/\s*--\s*/, " -- "));
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
return items;
|
|
989
|
+
}
|
|
990
|
+
async function generateJsonReport(sessionDir) {
|
|
991
|
+
const session = await parseSession(sessionDir);
|
|
992
|
+
const report = session.report ?? "";
|
|
993
|
+
const target = extractTarget(report, session.id);
|
|
994
|
+
const date = extractDate(report);
|
|
995
|
+
const duration_min = extractDuration(report);
|
|
996
|
+
const pages_explored = extractPagesExplored(report);
|
|
997
|
+
const counts = { critical: 0, high: 0, medium: 0, low: 0 };
|
|
998
|
+
for (const bug of session.bugs) {
|
|
999
|
+
counts[bug.severity]++;
|
|
1000
|
+
}
|
|
1001
|
+
const coverage = extractCoverage2(report);
|
|
1002
|
+
const observations = extractListSection2(report, "Observations");
|
|
1003
|
+
const recommendations = extractListSection2(report, "Recommendations");
|
|
1004
|
+
return {
|
|
1005
|
+
session: {
|
|
1006
|
+
id: session.id,
|
|
1007
|
+
target,
|
|
1008
|
+
date,
|
|
1009
|
+
duration_min
|
|
1010
|
+
},
|
|
1011
|
+
summary: {
|
|
1012
|
+
total_bugs: session.bugs.length,
|
|
1013
|
+
critical: counts.critical,
|
|
1014
|
+
high: counts.high,
|
|
1015
|
+
medium: counts.medium,
|
|
1016
|
+
low: counts.low,
|
|
1017
|
+
pages_explored
|
|
1018
|
+
},
|
|
1019
|
+
bugs: session.bugs.map((bug) => ({
|
|
1020
|
+
id: bug.id,
|
|
1021
|
+
title: bug.title,
|
|
1022
|
+
severity: bug.severity,
|
|
1023
|
+
component: bug.component,
|
|
1024
|
+
url: bug.url,
|
|
1025
|
+
business_impact: bug.business_impact,
|
|
1026
|
+
steps: bug.steps,
|
|
1027
|
+
evidence: bug.evidence
|
|
1028
|
+
})),
|
|
1029
|
+
coverage,
|
|
1030
|
+
observations,
|
|
1031
|
+
recommendations
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
// src/formatters/jira-export.ts
|
|
1036
|
+
var SEVERITY_TO_JIRA_PRIORITY = {
|
|
1037
|
+
critical: "Blocker",
|
|
1038
|
+
high: "Critical",
|
|
1039
|
+
medium: "Major",
|
|
1040
|
+
low: "Minor"
|
|
1041
|
+
};
|
|
1042
|
+
function csvEscape(value) {
|
|
1043
|
+
if (!value) return '""';
|
|
1044
|
+
const escaped = value.replace(/"/g, '""');
|
|
1045
|
+
return `"${escaped}"`;
|
|
1046
|
+
}
|
|
1047
|
+
function formatDescription(bug) {
|
|
1048
|
+
const parts = [];
|
|
1049
|
+
if (bug.steps.length > 0) {
|
|
1050
|
+
parts.push("h3. Steps to Reproduce");
|
|
1051
|
+
for (const step of bug.steps) {
|
|
1052
|
+
parts.push(`# ${step}`);
|
|
1053
|
+
}
|
|
1054
|
+
parts.push("");
|
|
1055
|
+
}
|
|
1056
|
+
if (bug.expected) {
|
|
1057
|
+
parts.push(`h3. Expected Behavior`);
|
|
1058
|
+
parts.push(bug.expected);
|
|
1059
|
+
parts.push("");
|
|
1060
|
+
}
|
|
1061
|
+
if (bug.actual) {
|
|
1062
|
+
parts.push(`h3. Actual Behavior`);
|
|
1063
|
+
parts.push(bug.actual);
|
|
1064
|
+
parts.push("");
|
|
1065
|
+
}
|
|
1066
|
+
if (bug.business_impact) {
|
|
1067
|
+
parts.push("h3. Business Impact");
|
|
1068
|
+
parts.push(bug.business_impact);
|
|
1069
|
+
parts.push("");
|
|
1070
|
+
}
|
|
1071
|
+
if (bug.url) {
|
|
1072
|
+
parts.push(`h3. URL`);
|
|
1073
|
+
parts.push(bug.url);
|
|
1074
|
+
}
|
|
1075
|
+
return parts.join("\n");
|
|
1076
|
+
}
|
|
1077
|
+
function extractDomain(sessionId) {
|
|
1078
|
+
return "general";
|
|
1079
|
+
}
|
|
1080
|
+
async function generateJiraExport(sessionDir) {
|
|
1081
|
+
const session = await parseSession(sessionDir);
|
|
1082
|
+
const headers = ["Summary", "Priority", "Description", "Component", "Labels"];
|
|
1083
|
+
const rows = [headers.join(",")];
|
|
1084
|
+
const domain = extractDomain(session.id);
|
|
1085
|
+
for (const bug of session.bugs) {
|
|
1086
|
+
const summary = `${bug.id}: ${bug.title}`;
|
|
1087
|
+
const priority = SEVERITY_TO_JIRA_PRIORITY[bug.severity] ?? "Major";
|
|
1088
|
+
const description = formatDescription(bug);
|
|
1089
|
+
const component = bug.component || "";
|
|
1090
|
+
const labels = ["qualiow", "exploratory-testing", domain].filter(Boolean).join(" ");
|
|
1091
|
+
rows.push(
|
|
1092
|
+
[
|
|
1093
|
+
csvEscape(summary),
|
|
1094
|
+
csvEscape(priority),
|
|
1095
|
+
csvEscape(description),
|
|
1096
|
+
csvEscape(component),
|
|
1097
|
+
csvEscape(labels)
|
|
1098
|
+
].join(",")
|
|
1099
|
+
);
|
|
1100
|
+
}
|
|
1101
|
+
return rows.join("\n");
|
|
1102
|
+
}
|
|
1103
|
+
export {
|
|
1104
|
+
AuthConfigSchema,
|
|
1105
|
+
BrowserConfigSchema,
|
|
1106
|
+
DomainConfigSchema,
|
|
1107
|
+
JourneySchema,
|
|
1108
|
+
KnowledgeEntryContentSchema,
|
|
1109
|
+
KnowledgeEntrySchema,
|
|
1110
|
+
KnowledgeManifestEntrySchema,
|
|
1111
|
+
KnowledgeManifestSchema,
|
|
1112
|
+
KnowledgeManifestStatsSchema,
|
|
1113
|
+
LoadingStrategySchema,
|
|
1114
|
+
SafetyConfigSchema,
|
|
1115
|
+
ScopeConfigSchema,
|
|
1116
|
+
SessionMetricsSchema,
|
|
1117
|
+
SeverityCountsSchema,
|
|
1118
|
+
TargetConfigSchema,
|
|
1119
|
+
appendSessionMetrics,
|
|
1120
|
+
containsSecrets,
|
|
1121
|
+
generateHtmlReport,
|
|
1122
|
+
generateJiraExport,
|
|
1123
|
+
generateJsonReport,
|
|
1124
|
+
parseBugReport,
|
|
1125
|
+
parseSession,
|
|
1126
|
+
readAllMetrics,
|
|
1127
|
+
redact,
|
|
1128
|
+
validateAllConfigs,
|
|
1129
|
+
validateDomainConfig,
|
|
1130
|
+
validateKnowledgeEntry,
|
|
1131
|
+
validateTargetConfig
|
|
1132
|
+
};
|
|
1133
|
+
//# sourceMappingURL=index.js.map
|