@flowspec-qa/runner-core 0.2.4 → 0.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/api-client.d.ts +87 -10
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +108 -7
- package/dist/api-client.js.map +1 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +4 -3
- package/dist/auth.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +4 -1
- package/dist/config.js.map +1 -1
- package/dist/discovery-report.d.ts +13 -0
- package/dist/discovery-report.d.ts.map +1 -0
- package/dist/discovery-report.js +977 -0
- package/dist/discovery-report.js.map +1 -0
- package/dist/discovery.d.ts +213 -3
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +2125 -264
- package/dist/discovery.js.map +1 -1
- package/dist/evidence-corpus.d.ts +338 -0
- package/dist/evidence-corpus.d.ts.map +1 -0
- package/dist/evidence-corpus.js +927 -0
- package/dist/evidence-corpus.js.map +1 -0
- package/dist/evidence-types.d.ts +230 -0
- package/dist/evidence-types.d.ts.map +1 -0
- package/dist/evidence-types.js +24 -0
- package/dist/evidence-types.js.map +1 -0
- package/dist/executor.d.ts +1 -0
- package/dist/executor.d.ts.map +1 -1
- package/dist/executor.js +93 -195
- package/dist/executor.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/suite-manager.d.ts +6 -0
- package/dist/suite-manager.d.ts.map +1 -1
- package/dist/suite-manager.js +55 -2
- package/dist/suite-manager.js.map +1 -1
- package/package.json +4 -1
- package/src/api-client.ts +0 -170
- package/src/auth.ts +0 -45
- package/src/backup-manager.ts +0 -63
- package/src/config.ts +0 -52
- package/src/devices.ts +0 -196
- package/src/discovery.ts +0 -563
- package/src/executor.ts +0 -681
- package/src/index.ts +0 -11
- package/src/result-sanitizer.ts +0 -60
- package/src/suite-manager.ts +0 -73
- package/src/uploader.ts +0 -74
- package/tsconfig.json +0 -8
|
@@ -0,0 +1,977 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discovery Evidence Report Generator
|
|
3
|
+
* Generates a self-contained HTML report with screenshots, element maps,
|
|
4
|
+
* navigation flow, and confidence scoring.
|
|
5
|
+
*/
|
|
6
|
+
import fs from 'fs';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
import { classifyCorpus } from './evidence-corpus.js';
|
|
9
|
+
// ── Helpers ────────────────────────────────────────────────────────────────
|
|
10
|
+
function formatDuration(ms) {
|
|
11
|
+
if (ms < 1000)
|
|
12
|
+
return `${ms}ms`;
|
|
13
|
+
const s = Math.round(ms / 1000);
|
|
14
|
+
if (s < 60)
|
|
15
|
+
return `${s}s`;
|
|
16
|
+
return `${Math.floor(s / 60)}m ${s % 60}s`;
|
|
17
|
+
}
|
|
18
|
+
function escapeHtml(s) {
|
|
19
|
+
return s
|
|
20
|
+
.replace(/&/g, '&')
|
|
21
|
+
.replace(/</g, '<')
|
|
22
|
+
.replace(/>/g, '>')
|
|
23
|
+
.replace(/"/g, '"');
|
|
24
|
+
}
|
|
25
|
+
// ── Navigation Map (CSS boxes) ─────────────────────────────────────────────
|
|
26
|
+
function buildNavMap(screens) {
|
|
27
|
+
if (!screens.length)
|
|
28
|
+
return '<p class="muted">Sin datos de navegación</p>';
|
|
29
|
+
const nodes = screens.map((s, i) => {
|
|
30
|
+
const errorClass = s.isErrorState ? 'node-error' : 'node-normal';
|
|
31
|
+
const icon = s.isErrorState ? '⚠️' : '📱';
|
|
32
|
+
return `
|
|
33
|
+
<a href="#screen-${i}" class="nav-node-link">
|
|
34
|
+
<div class="nav-node ${errorClass}" data-index="${i}">
|
|
35
|
+
<div class="nav-icon">${icon}</div>
|
|
36
|
+
<div class="nav-name">${escapeHtml(s.name)}</div>
|
|
37
|
+
<div class="nav-count">${s.elements.length} elementos</div>
|
|
38
|
+
</div>
|
|
39
|
+
</a>
|
|
40
|
+
${i < screens.length - 1 ? '<div class="nav-arrow">→</div>' : ''}
|
|
41
|
+
`;
|
|
42
|
+
}).join('');
|
|
43
|
+
return `<div class="nav-map">${nodes}</div>`;
|
|
44
|
+
}
|
|
45
|
+
function classifyScreenState(screen, screenStateMap) {
|
|
46
|
+
const resultType = screenStateMap.get(screen.name);
|
|
47
|
+
if (resultType) {
|
|
48
|
+
if (resultType === 'partial_flow')
|
|
49
|
+
return 'partial';
|
|
50
|
+
if (resultType === 'validation_state' || resultType === 'validation')
|
|
51
|
+
return 'validation';
|
|
52
|
+
if (resultType === 'error_state' || resultType === 'error')
|
|
53
|
+
return 'error';
|
|
54
|
+
return 'happy';
|
|
55
|
+
}
|
|
56
|
+
// Fallback: name-based heuristic for screens not in the corpus
|
|
57
|
+
if (/Submit incompleto/i.test(screen.name))
|
|
58
|
+
return 'partial';
|
|
59
|
+
if (/Error\s*[—-]\s*campos\s*vac/i.test(screen.name))
|
|
60
|
+
return 'validation';
|
|
61
|
+
if (screen.isErrorState)
|
|
62
|
+
return 'error';
|
|
63
|
+
return 'happy';
|
|
64
|
+
}
|
|
65
|
+
function buildScreenCard(screen, index, screenStateMap) {
|
|
66
|
+
const imgHtml = screen.screenshot
|
|
67
|
+
? `<img src="data:image/png;base64,${screen.screenshot}" class="screen-img" alt="${escapeHtml(screen.name)}" />`
|
|
68
|
+
: `<div class="no-screenshot partial-evidence">
|
|
69
|
+
<div class="pe-icon">📷</div>
|
|
70
|
+
<div class="pe-title">Evidencia parcial</div>
|
|
71
|
+
<div class="pe-body">La pantalla fue detectada mediante jerarquía UI, pero el screenshot no se capturó por indisponibilidad temporal de ADB.</div>
|
|
72
|
+
<div class="pe-badge">TECHNICAL_ONLY</div>
|
|
73
|
+
</div>`;
|
|
74
|
+
const stateType = classifyScreenState(screen, screenStateMap);
|
|
75
|
+
const stateBadges = {
|
|
76
|
+
happy: '<span class="badge" style="color:#06D6A0;background:#06D6A022;border:1px solid #06D6A0">✅ Happy Path</span>',
|
|
77
|
+
validation: '<span class="badge" style="color:#FFB703;background:#FFB70322;border:1px solid #FFB703">🟡 Validation State</span>',
|
|
78
|
+
partial: '<span class="badge" style="color:#FF8A3D;background:#FF8A3D22;border:1px solid #FF8A3D">🟠 Partial Flow</span>',
|
|
79
|
+
error: '<span class="badge" style="color:#EF476F;background:#EF476F22;border:1px solid #EF476F">🔴 Error State</span>',
|
|
80
|
+
};
|
|
81
|
+
const errorBadge = stateBadges[stateType];
|
|
82
|
+
const textsHtml = screen.allTexts.length
|
|
83
|
+
? `<div class="verified-texts"><strong>Textos verificados en pantalla:</strong><br>
|
|
84
|
+
${screen.allTexts.slice(0, 15).map(t => `<code>${escapeHtml(t)}</code>`).join(' ')}
|
|
85
|
+
</div>`
|
|
86
|
+
: '';
|
|
87
|
+
const rows = screen.elements.map(e => `
|
|
88
|
+
<tr>
|
|
89
|
+
<td><code>${escapeHtml(e.type)}</code></td>
|
|
90
|
+
<td>${escapeHtml(e.text === 'N/A' ? '—' : e.text)}</td>
|
|
91
|
+
<td><code>${escapeHtml(e.id)}</code></td>
|
|
92
|
+
</tr>
|
|
93
|
+
`).join('');
|
|
94
|
+
const tableHtml = rows
|
|
95
|
+
? `<table class="elem-table">
|
|
96
|
+
<thead><tr><th>Tipo</th><th>Texto</th><th>ID</th></tr></thead>
|
|
97
|
+
<tbody>${rows}</tbody>
|
|
98
|
+
</table>`
|
|
99
|
+
: '<p class="muted">Sin elementos interactivos detectados</p>';
|
|
100
|
+
return `
|
|
101
|
+
<div class="screen-card" id="screen-${index}">
|
|
102
|
+
<div class="screen-header">
|
|
103
|
+
<h3>${index + 1}. ${escapeHtml(screen.name)} ${errorBadge}</h3>
|
|
104
|
+
</div>
|
|
105
|
+
<div class="screen-body">
|
|
106
|
+
<div class="screen-screenshot">${imgHtml}</div>
|
|
107
|
+
<div class="screen-details">
|
|
108
|
+
${textsHtml}
|
|
109
|
+
<h4>Elementos detectados (${screen.elements.length})</h4>
|
|
110
|
+
${tableHtml}
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
`;
|
|
115
|
+
}
|
|
116
|
+
// ── Confidence Section ────────────────────────────────────────────────────
|
|
117
|
+
function buildConfidenceSection(evidence) {
|
|
118
|
+
const { verifiedTexts, verifiedIds } = evidence;
|
|
119
|
+
const highCount = verifiedIds.length;
|
|
120
|
+
const highTexts = verifiedTexts.length;
|
|
121
|
+
const total = highCount + highTexts;
|
|
122
|
+
const confidence = total > 0 ? Math.min(Math.round((highTexts / Math.max(highTexts + 5, 1)) * 100), 95) : 20;
|
|
123
|
+
const idsHtml = verifiedIds.length
|
|
124
|
+
? verifiedIds.map(id => `<code class="id-chip">${escapeHtml(id)}</code>`).join(' ')
|
|
125
|
+
: '<span class="muted">Ninguno</span>';
|
|
126
|
+
const textsHtml = verifiedTexts.length
|
|
127
|
+
? verifiedTexts.map(t => `<code class="text-chip">${escapeHtml(t)}</code>`).join(' ')
|
|
128
|
+
: '<span class="muted">Ninguno — los textos de error en los scripts son inferidos (LOW confidence)</span>';
|
|
129
|
+
return `
|
|
130
|
+
<div class="confidence-section">
|
|
131
|
+
<div class="confidence-meter">
|
|
132
|
+
<div class="confidence-score" style="color: ${confidence >= 70 ? '#06D6A0' : confidence >= 40 ? '#FFB703' : '#EF476F'}">
|
|
133
|
+
${confidence}%
|
|
134
|
+
</div>
|
|
135
|
+
<div class="confidence-label">Confianza del Discovery</div>
|
|
136
|
+
<div class="confidence-bar">
|
|
137
|
+
<div class="confidence-fill" style="width:${confidence}%;background:${confidence >= 70 ? '#06D6A0' : confidence >= 40 ? '#FFB703' : '#EF476F'}"></div>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
<div class="confidence-detail">
|
|
142
|
+
<div class="conf-block">
|
|
143
|
+
<h4>🟢 IDs verificados en jerarquía real (${verifiedIds.length})</h4>
|
|
144
|
+
<div class="chip-container">${idsHtml}</div>
|
|
145
|
+
<p class="conf-note">Los tests que usan estos IDs tienen confianza ALTA — el elemento fue visto en el dispositivo.</p>
|
|
146
|
+
</div>
|
|
147
|
+
<div class="conf-block">
|
|
148
|
+
<h4>🟢 Textos verificados en pantalla (${verifiedTexts.length})</h4>
|
|
149
|
+
<div class="chip-container">${textsHtml}</div>
|
|
150
|
+
<p class="conf-note">Los assertVisible que usen estos textos exactos tienen confianza ALTA.</p>
|
|
151
|
+
</div>
|
|
152
|
+
<div class="conf-block">
|
|
153
|
+
<h4>🔴 Textos no observados = Confianza BAJA</h4>
|
|
154
|
+
<p class="conf-note">Cualquier assertVisible con texto que NO aparezca arriba fue generado por inferencia de la IA.
|
|
155
|
+
Son los candidatos más probables a fallar. <strong>Solución: Discovery enriquecido (Fase 2) provocará esos estados y capturará el texto real.</strong></p>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
`;
|
|
160
|
+
}
|
|
161
|
+
// ── Evidence Gaps Section ─────────────────────────────────────────────────
|
|
162
|
+
function buildEvidenceGaps(evidence) {
|
|
163
|
+
const screensWithoutShot = evidence.screens.filter(s => !s.screenshot);
|
|
164
|
+
if (screensWithoutShot.length === 0)
|
|
165
|
+
return '';
|
|
166
|
+
const total = evidence.screens.length;
|
|
167
|
+
const missing = screensWithoutShot.length;
|
|
168
|
+
const pct = Math.round((missing / total) * 100);
|
|
169
|
+
const rows = screensWithoutShot.map(s => {
|
|
170
|
+
const stateLabel = s.isErrorState
|
|
171
|
+
? '<span class="gap-badge gap-error">Error State</span>'
|
|
172
|
+
: '<span class="gap-badge gap-normal">Happy Path</span>';
|
|
173
|
+
return `
|
|
174
|
+
<tr>
|
|
175
|
+
<td>${escapeHtml(s.name)}</td>
|
|
176
|
+
<td>${stateLabel}</td>
|
|
177
|
+
<td>${s.elements.length}</td>
|
|
178
|
+
<td class="gap-action">Repetir Discovery o ejecutar <code>recapture</code> antes de aprobar casos STRICT</td>
|
|
179
|
+
</tr>`;
|
|
180
|
+
}).join('');
|
|
181
|
+
return `
|
|
182
|
+
<div class="section gaps-section">
|
|
183
|
+
<h2>⚠️ Brechas técnicas de evidencia</h2>
|
|
184
|
+
|
|
185
|
+
<div class="gaps-summary">
|
|
186
|
+
<div class="gaps-stat">
|
|
187
|
+
<span class="gaps-stat-value" style="color:#EF476F">${missing}</span>
|
|
188
|
+
<span class="gaps-stat-label">pantalla(s) sin screenshot</span>
|
|
189
|
+
</div>
|
|
190
|
+
<div class="gaps-stat">
|
|
191
|
+
<span class="gaps-stat-value">${total - missing}</span>
|
|
192
|
+
<span class="gaps-stat-label">con evidencia completa</span>
|
|
193
|
+
</div>
|
|
194
|
+
<div class="gaps-stat">
|
|
195
|
+
<span class="gaps-stat-value" style="color:${pct > 50 ? '#EF476F' : '#FFB703'}">${pct}%</span>
|
|
196
|
+
<span class="gaps-stat-label">cobertura visual incompleta</span>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
<div class="gaps-notice">
|
|
201
|
+
<strong>¿Qué significa PARTIAL_EVIDENCE?</strong><br/>
|
|
202
|
+
Estas pantallas fueron detectadas correctamente mediante la jerarquía UI de ADB — sus elementos
|
|
203
|
+
interactivos, textos y selectores son válidos. Sin embargo, ADB no pudo capturar el screenshot
|
|
204
|
+
en ese momento (timeout, transición de pantalla, o conflicto de screencap).
|
|
205
|
+
<br/><br/>
|
|
206
|
+
Los tests generados a partir de estas pantallas funcionarán para aserciones de ID y texto,
|
|
207
|
+
pero los casos de tipo <code>STRICT visual</code> (comparación de imagen) no deben aprobarse
|
|
208
|
+
hasta contar con el screenshot. <strong>Recomendación: repetir el Discovery o usar
|
|
209
|
+
<code>flowspecqa recapture <entityId></code> para obtener los screenshots faltantes.</strong>
|
|
210
|
+
</div>
|
|
211
|
+
|
|
212
|
+
<table class="gaps-table">
|
|
213
|
+
<thead>
|
|
214
|
+
<tr>
|
|
215
|
+
<th>Pantalla</th>
|
|
216
|
+
<th>Tipo</th>
|
|
217
|
+
<th>Elementos detectados</th>
|
|
218
|
+
<th>Acción recomendada</th>
|
|
219
|
+
</tr>
|
|
220
|
+
</thead>
|
|
221
|
+
<tbody>${rows}</tbody>
|
|
222
|
+
</table>
|
|
223
|
+
</div>
|
|
224
|
+
`;
|
|
225
|
+
}
|
|
226
|
+
// ── Evidence Corpus Summary (Phase 0+) ───────────────────────────────────
|
|
227
|
+
function buildCorpusSummary(corpus) {
|
|
228
|
+
const total = corpus.records.length;
|
|
229
|
+
const interactive = corpus.records.filter(r => (r.capture_mode ?? r.captured_by) === 'interactive').length;
|
|
230
|
+
const autonomous = total - interactive;
|
|
231
|
+
// Breakdown by action_type
|
|
232
|
+
const byAction = {};
|
|
233
|
+
for (const r of corpus.records) {
|
|
234
|
+
byAction[r.action_type] = (byAction[r.action_type] ?? 0) + 1;
|
|
235
|
+
}
|
|
236
|
+
// Breakdown by result_type
|
|
237
|
+
const byResult = {};
|
|
238
|
+
for (const r of corpus.records) {
|
|
239
|
+
byResult[r.result_type] = (byResult[r.result_type] ?? 0) + 1;
|
|
240
|
+
}
|
|
241
|
+
// Breakdown by evidence_quality (Phase 6)
|
|
242
|
+
const byQuality = {};
|
|
243
|
+
for (const r of corpus.records) {
|
|
244
|
+
const q = r.evidence_quality ?? 'unknown';
|
|
245
|
+
byQuality[q] = (byQuality[q] ?? 0) + 1;
|
|
246
|
+
}
|
|
247
|
+
const actionPills = Object.entries(byAction)
|
|
248
|
+
.sort((a, b) => b[1] - a[1])
|
|
249
|
+
.map(([t, n]) => `<span class="corpus-pill"><strong>${n}</strong> ${escapeHtml(t)}</span>`)
|
|
250
|
+
.join(' ');
|
|
251
|
+
const resultColors = {
|
|
252
|
+
success: '#06D6A0',
|
|
253
|
+
navigation: '#00B4D8',
|
|
254
|
+
validation: '#FFB703',
|
|
255
|
+
error: '#EF476F',
|
|
256
|
+
no_change: '#8899AA',
|
|
257
|
+
};
|
|
258
|
+
const resultPills = Object.entries(byResult)
|
|
259
|
+
.sort((a, b) => b[1] - a[1])
|
|
260
|
+
.map(([t, n]) => {
|
|
261
|
+
const c = resultColors[t] ?? '#8899AA';
|
|
262
|
+
return `<span class="corpus-pill" style="border-color:${c}88;color:${c}"><strong>${n}</strong> ${escapeHtml(t)}</span>`;
|
|
263
|
+
})
|
|
264
|
+
.join(' ');
|
|
265
|
+
// Quality pills (Phase 6)
|
|
266
|
+
const qualityColors = {
|
|
267
|
+
complete: '#06D6A0',
|
|
268
|
+
technical_only: '#00B4D8',
|
|
269
|
+
visual_only: '#FFB703',
|
|
270
|
+
incomplete: '#EF476F',
|
|
271
|
+
unknown: '#8899AA',
|
|
272
|
+
};
|
|
273
|
+
const qualityPills = Object.entries(byQuality)
|
|
274
|
+
.sort((a, b) => b[1] - a[1])
|
|
275
|
+
.map(([t, n]) => {
|
|
276
|
+
const c = qualityColors[t] ?? '#8899AA';
|
|
277
|
+
return `<span class="corpus-pill" style="border-color:${c}88;color:${c}"><strong>${n}</strong> ${escapeHtml(t)}</span>`;
|
|
278
|
+
})
|
|
279
|
+
.join(' ');
|
|
280
|
+
const knownIds = Object.keys(corpus.elementIndex).length;
|
|
281
|
+
return `
|
|
282
|
+
<div class="section">
|
|
283
|
+
<h2>📦 Evidence Corpus</h2>
|
|
284
|
+
<p class="corpus-tagline">
|
|
285
|
+
Cada acción del Discovery produjo un <strong>EvidenceRecord</strong> inmutable.
|
|
286
|
+
Toda generación posterior (STRICT/RECO) debe trazar a estos registros.
|
|
287
|
+
</p>
|
|
288
|
+
|
|
289
|
+
<div class="corpus-grid">
|
|
290
|
+
<div class="corpus-stat">
|
|
291
|
+
<div class="corpus-num">${total}</div>
|
|
292
|
+
<div class="corpus-lbl">EvidenceRecords</div>
|
|
293
|
+
</div>
|
|
294
|
+
<div class="corpus-stat">
|
|
295
|
+
<div class="corpus-num">${knownIds}</div>
|
|
296
|
+
<div class="corpus-lbl">Selectores observados</div>
|
|
297
|
+
</div>
|
|
298
|
+
<div class="corpus-stat">
|
|
299
|
+
<div class="corpus-num" style="color:#06D6A0">100%</div>
|
|
300
|
+
<div class="corpus-lbl">grounded_score</div>
|
|
301
|
+
<div class="corpus-sub">cada selector vino de la jerarquía real</div>
|
|
302
|
+
</div>
|
|
303
|
+
<div class="corpus-stat">
|
|
304
|
+
<div class="corpus-num">${autonomous}</div>
|
|
305
|
+
<div class="corpus-lbl">Autónomos</div>
|
|
306
|
+
<div class="corpus-sub">${interactive} interactivos (con tester)</div>
|
|
307
|
+
</div>
|
|
308
|
+
</div>
|
|
309
|
+
|
|
310
|
+
<div class="corpus-breakdown">
|
|
311
|
+
<div class="corpus-row">
|
|
312
|
+
<strong>Por tipo de acción:</strong> ${actionPills}
|
|
313
|
+
</div>
|
|
314
|
+
<div class="corpus-row">
|
|
315
|
+
<strong>Por resultado:</strong> ${resultPills}
|
|
316
|
+
</div>
|
|
317
|
+
<div class="corpus-row">
|
|
318
|
+
<strong>Por calidad de evidencia:</strong> ${qualityPills}
|
|
319
|
+
</div>
|
|
320
|
+
</div>
|
|
321
|
+
</div>
|
|
322
|
+
`;
|
|
323
|
+
}
|
|
324
|
+
function buildEvidenceTimeline(corpus) {
|
|
325
|
+
if (!corpus.records.length)
|
|
326
|
+
return '';
|
|
327
|
+
const resultColors = {
|
|
328
|
+
success: '#06D6A0',
|
|
329
|
+
navigation: '#00B4D8',
|
|
330
|
+
validation: '#FFB703',
|
|
331
|
+
error: '#EF476F',
|
|
332
|
+
no_change: '#8899AA',
|
|
333
|
+
};
|
|
334
|
+
const actionIcons = {
|
|
335
|
+
launch: '🚀',
|
|
336
|
+
tap: '👆',
|
|
337
|
+
input: '⌨️',
|
|
338
|
+
form_submit: '📋',
|
|
339
|
+
scroll: '📜',
|
|
340
|
+
back: '⬅️',
|
|
341
|
+
};
|
|
342
|
+
// Phase 6 quality colors
|
|
343
|
+
const qualityColors = {
|
|
344
|
+
complete: '#06D6A0',
|
|
345
|
+
technical_only: '#00B4D8',
|
|
346
|
+
visual_only: '#FFB703',
|
|
347
|
+
incomplete: '#EF476F',
|
|
348
|
+
};
|
|
349
|
+
const rows = corpus.records.map(rec => {
|
|
350
|
+
const icon = actionIcons[rec.action_type] ?? '•';
|
|
351
|
+
const resultColor = resultColors[rec.result_type] ?? '#8899AA';
|
|
352
|
+
// Phase 6: prefer capture_mode over captured_by
|
|
353
|
+
const captureMode = rec.capture_mode ?? rec.captured_by;
|
|
354
|
+
const captured = captureMode === 'interactive'
|
|
355
|
+
? '<span class="ev-captured ev-interactive">👤 interactive</span>'
|
|
356
|
+
: captureMode === 'manual'
|
|
357
|
+
? '<span class="ev-captured ev-interactive">✋ manual</span>'
|
|
358
|
+
: captureMode === 'resume'
|
|
359
|
+
? '<span class="ev-captured ev-interactive">▶️ resume</span>'
|
|
360
|
+
: '<span class="ev-captured ev-autonomous">🤖 autonomous</span>';
|
|
361
|
+
// Phase 6: evidence quality pill
|
|
362
|
+
const quality = rec.evidence_quality;
|
|
363
|
+
const qualityHtml = quality
|
|
364
|
+
? `<span class="ev-quality" style="color:${qualityColors[quality] ?? '#8899AA'};border-color:${qualityColors[quality] ?? '#8899AA'}55">${escapeHtml(quality)}</span>`
|
|
365
|
+
: '';
|
|
366
|
+
// Phase 6: screen fingerprint chip
|
|
367
|
+
const fpHtml = rec.screen_fingerprint
|
|
368
|
+
? `<code class="ev-fp" title="Screen fingerprint">#${escapeHtml(rec.screen_fingerprint)}</code>`
|
|
369
|
+
: '';
|
|
370
|
+
const inputData = rec.input_data
|
|
371
|
+
? Object.entries(rec.input_data)
|
|
372
|
+
.filter(([_, v]) => v !== '***')
|
|
373
|
+
.map(([k, v]) => `<code class="ev-field">${escapeHtml(k)}: ${escapeHtml(v || '∅')}</code>`)
|
|
374
|
+
.join(' ')
|
|
375
|
+
: '';
|
|
376
|
+
return `
|
|
377
|
+
<div class="ev-row">
|
|
378
|
+
<div class="ev-id">${escapeHtml(rec.evidenceId)}</div>
|
|
379
|
+
<div class="ev-action">
|
|
380
|
+
<div class="ev-action-line">
|
|
381
|
+
<span class="ev-icon">${icon}</span>
|
|
382
|
+
<code class="ev-element">${escapeHtml(rec.action_element)}</code>
|
|
383
|
+
${rec.action_label ? `<span class="ev-label">${escapeHtml(rec.action_label)}</span>` : ''}
|
|
384
|
+
</div>
|
|
385
|
+
<div class="ev-flow">
|
|
386
|
+
<span class="ev-screen">${escapeHtml(rec.screen_origin)}</span>
|
|
387
|
+
<span class="ev-arrow">→</span>
|
|
388
|
+
<span class="ev-screen">${escapeHtml(rec.screen_destination)}</span>
|
|
389
|
+
${fpHtml}
|
|
390
|
+
</div>
|
|
391
|
+
${inputData ? `<div class="ev-inputs">${inputData}</div>` : ''}
|
|
392
|
+
</div>
|
|
393
|
+
<div class="ev-result">
|
|
394
|
+
<span class="ev-result-pill" style="background:${resultColor}22;color:${resultColor};border-color:${resultColor}66">
|
|
395
|
+
${escapeHtml(rec.result_type)}
|
|
396
|
+
</span>
|
|
397
|
+
${qualityHtml}
|
|
398
|
+
<div class="ev-desc">${escapeHtml(rec.result_description)}</div>
|
|
399
|
+
${captured}
|
|
400
|
+
</div>
|
|
401
|
+
</div>
|
|
402
|
+
`;
|
|
403
|
+
}).join('');
|
|
404
|
+
return `
|
|
405
|
+
<div class="section">
|
|
406
|
+
<h2>⏱️ Timeline del Discovery</h2>
|
|
407
|
+
<p class="muted">Secuencia cronológica de cada interacción registrada como EvidenceRecord.</p>
|
|
408
|
+
<div class="ev-timeline">${rows}</div>
|
|
409
|
+
</div>
|
|
410
|
+
`;
|
|
411
|
+
}
|
|
412
|
+
// ── Resumen Ejecutivo Reorganizado (Fase 7.1) ────────────────────────────
|
|
413
|
+
function buildExecutiveSummary(evidence, corpus) {
|
|
414
|
+
// Pantallas únicas (sin paréntesis de variantes)
|
|
415
|
+
const uniqueScreens = new Set();
|
|
416
|
+
for (const s of evidence.screens) {
|
|
417
|
+
if (!s.isErrorState && !/Submit incompleto/i.test(s.name)) {
|
|
418
|
+
uniqueScreens.add(s.name.replace(/\s*\(.*?\)\s*$/, '').replace(/\s*\[.*?\]\s*$/, ''));
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
// Tres contadores SEPARADOS según result_type del corpus (no más "estados de error" mixto)
|
|
422
|
+
const validationCount = corpus?.records.filter(r => r.result_type === 'validation_state' || r.result_type === 'validation').length ?? 0;
|
|
423
|
+
const partialCount = corpus?.records.filter(r => r.result_type === 'partial_flow' || r.result_type === 'error').length ?? 0;
|
|
424
|
+
const errorCount = corpus?.records.filter(r => r.result_type === 'error_state').length ?? 0;
|
|
425
|
+
const aliasCount = corpus?.records.filter(r => r.result_type === 'duplicate_route' || r.result_type === 'known_screen').length ?? 0;
|
|
426
|
+
const interactive = corpus?.records.filter(r => (r.capture_mode ?? r.captured_by) === 'interactive').length ?? 0;
|
|
427
|
+
const completeFlow = corpus?.records.filter(r => r.result_type === 'new_screen' || r.result_type === 'navigation' || r.result_type === 'success').length ?? 0;
|
|
428
|
+
const totalRecords = corpus?.records.length ?? 0;
|
|
429
|
+
// Phase 6: evidence quality breakdown
|
|
430
|
+
const qualityComplete = corpus?.records.filter(r => r.evidence_quality === 'complete').length ?? 0;
|
|
431
|
+
const qualityTech = corpus?.records.filter(r => r.evidence_quality === 'technical_only').length ?? 0;
|
|
432
|
+
const qualityOther = totalRecords - qualityComplete - qualityTech;
|
|
433
|
+
return `
|
|
434
|
+
<div class="exec-summary">
|
|
435
|
+
<div class="exec-row">
|
|
436
|
+
<div class="exec-cell"><span class="exec-num">${uniqueScreens.size}</span><span class="exec-lbl">Pantallas únicas</span></div>
|
|
437
|
+
<div class="exec-cell"><span class="exec-num" style="color:#06D6A0">${completeFlow}</span><span class="exec-lbl">Flujos completos<br/><small>(navegación verificada)</small></span></div>
|
|
438
|
+
<div class="exec-cell"><span class="exec-num" style="color:#FFB703">${validationCount}</span><span class="exec-lbl">Validations<br/><small>(la app valida bien)</small></span></div>
|
|
439
|
+
<div class="exec-cell"><span class="exec-num" style="color:#FF8A3D">${partialCount}</span><span class="exec-lbl">Flujos parciales<br/><small>(requieren recaptura)</small></span></div>
|
|
440
|
+
</div>
|
|
441
|
+
<div class="exec-row">
|
|
442
|
+
<div class="exec-cell"><span class="exec-num" style="color:#EF476F">${errorCount}</span><span class="exec-lbl">Errores reales<br/><small>(de la app bajo prueba)</small></span></div>
|
|
443
|
+
<div class="exec-cell"><span class="exec-num">${aliasCount}</span><span class="exec-lbl">Rutas alternativas</span></div>
|
|
444
|
+
<div class="exec-cell"><span class="exec-num">${interactive}</span><span class="exec-lbl">Flujos interactivos<br/><small>(con tester)</small></span></div>
|
|
445
|
+
<div class="exec-cell"><span class="exec-num">${evidence.metrics.elementsFound}</span><span class="exec-lbl">Elementos detectados</span></div>
|
|
446
|
+
</div>
|
|
447
|
+
<div class="exec-row">
|
|
448
|
+
<div class="exec-cell"><span class="exec-num">${formatDuration(evidence.metrics.durationMs)}</span><span class="exec-lbl">Tiempo total<br/><small>(engine + tester)</small></span></div>
|
|
449
|
+
<div class="exec-cell"><span class="exec-num">${totalRecords}</span><span class="exec-lbl">EvidenceRecords</span></div>
|
|
450
|
+
<div class="exec-cell"><span class="exec-num">${Object.keys(corpus?.elementIndex ?? {}).length}</span><span class="exec-lbl">Selectores observados</span></div>
|
|
451
|
+
<div class="exec-cell"><span class="exec-num" style="color:#06D6A0">100%</span><span class="exec-lbl">grounded_score</span></div>
|
|
452
|
+
</div>
|
|
453
|
+
<div class="exec-row">
|
|
454
|
+
<div class="exec-cell"><span class="exec-num" style="color:#06D6A0">${qualityComplete}</span><span class="exec-lbl">Evidencia<br/><small>complete</small></span></div>
|
|
455
|
+
<div class="exec-cell"><span class="exec-num" style="color:#00B4D8">${qualityTech}</span><span class="exec-lbl">Evidencia<br/><small>technical_only</small></span></div>
|
|
456
|
+
<div class="exec-cell"><span class="exec-num" style="color:${qualityOther > 0 ? '#FFB703' : '#8899AA'}">${qualityOther}</span><span class="exec-lbl">Evidencia<br/><small>visual/incomplete</small></span></div>
|
|
457
|
+
<div class="exec-cell"><span class="exec-num">${formatDuration(evidence.metrics.durationMs)}</span><span class="exec-lbl">Tiempo total<br/><small>(engine + tester)</small></span></div>
|
|
458
|
+
</div>
|
|
459
|
+
</div>
|
|
460
|
+
`;
|
|
461
|
+
}
|
|
462
|
+
// ── Secciones Obligatorias STRICT/PARTIAL/RECO/GAPS (Fase 7.3) ───────────
|
|
463
|
+
function buildClassifiedSections(corpus) {
|
|
464
|
+
const cls = classifyCorpus(corpus);
|
|
465
|
+
const priorityBadge = (p) => {
|
|
466
|
+
const colors = { alta: '#EF476F', media: '#FFB703', baja: '#8899AA' };
|
|
467
|
+
return `<span class="cls-prio" style="color:${colors[p]};border-color:${colors[p]}55;background:${colors[p]}11">${p.toUpperCase()}</span>`;
|
|
468
|
+
};
|
|
469
|
+
// STRICT — flat list of action → destination
|
|
470
|
+
const strictHtml = cls.details.strict.length === 0
|
|
471
|
+
? `<p class="muted">Sin casos STRICT generables. Ejecuta Discovery más completo o usa <code>flowspecqa capture</code>.</p>`
|
|
472
|
+
: `<ul class="cls-list">${cls.details.strict.map(i => `
|
|
473
|
+
<li><code class="cls-evid">${escapeHtml(i.evidenceId)}</code> ${escapeHtml(i.description)}</li>
|
|
474
|
+
`).join('')}</ul>`;
|
|
475
|
+
// PARTIAL — each item has a recommendation
|
|
476
|
+
const partialHtml = cls.details.partial.length === 0
|
|
477
|
+
? `<p class="muted">Sin flujos parciales detectados.</p>`
|
|
478
|
+
: cls.details.partial.map(i => `
|
|
479
|
+
<div class="cls-item">
|
|
480
|
+
<div class="cls-item-head"><code class="cls-evid">${escapeHtml(i.evidenceId)}</code></div>
|
|
481
|
+
<div class="cls-item-body">${escapeHtml(i.description)}</div>
|
|
482
|
+
<div class="cls-item-foot"><strong>📝 Recomendación:</strong> ${escapeHtml(i.recommendation)}</div>
|
|
483
|
+
</div>
|
|
484
|
+
`).join('');
|
|
485
|
+
// RECO — structured with title, category, priority, risk, missing_evidence, recommendation
|
|
486
|
+
const recoHtml = cls.details.reco.length === 0
|
|
487
|
+
? `<p class="muted">Sin recomendaciones automáticas para este corpus.</p>`
|
|
488
|
+
: cls.details.reco.map(r => `
|
|
489
|
+
<div class="cls-item">
|
|
490
|
+
<div class="cls-item-head">
|
|
491
|
+
${priorityBadge(r.priority)}
|
|
492
|
+
<strong>${escapeHtml(r.title)}</strong>
|
|
493
|
+
<span class="cls-cat">${escapeHtml(r.category)}</span>
|
|
494
|
+
</div>
|
|
495
|
+
<div class="cls-item-body">
|
|
496
|
+
<div><strong>Riesgo:</strong> ${escapeHtml(r.risk)}</div>
|
|
497
|
+
<div><strong>Evidencia faltante:</strong> ${escapeHtml(r.missing_evidence)}</div>
|
|
498
|
+
${r.origin_evidence_id ? `<div class="cls-origin"><code class="cls-evid">${escapeHtml(r.origin_evidence_id)}</code> origina la recomendación${r.origin_element ? ` (campo <code>${escapeHtml(r.origin_element)}</code>)` : ''}</div>` : ''}
|
|
499
|
+
</div>
|
|
500
|
+
<div class="cls-item-foot"><strong>📝 Recomendación:</strong> ${escapeHtml(r.recommendation)}</div>
|
|
501
|
+
</div>
|
|
502
|
+
`).join('');
|
|
503
|
+
// GAPS — structured with action, category, priority, impact, recommendation
|
|
504
|
+
const gapsHtml = cls.details.gaps.length === 0
|
|
505
|
+
? `<p class="muted">Sin brechas de cobertura detectadas. ¡Buen trabajo!</p>`
|
|
506
|
+
: cls.details.gaps.map(g => `
|
|
507
|
+
<div class="cls-item">
|
|
508
|
+
<div class="cls-item-head">
|
|
509
|
+
${priorityBadge(g.priority)}
|
|
510
|
+
<strong>${escapeHtml(g.action)}</strong>
|
|
511
|
+
<span class="cls-cat">${escapeHtml(g.category)}</span>
|
|
512
|
+
</div>
|
|
513
|
+
<div class="cls-item-body">
|
|
514
|
+
<div><strong>Impacto:</strong> ${escapeHtml(g.impact)}</div>
|
|
515
|
+
${g.origin_evidence_id ? `<div class="cls-origin"><code class="cls-evid">${escapeHtml(g.origin_evidence_id)}</code> origina la brecha${g.origin_element ? ` (elemento <code>${escapeHtml(g.origin_element)}</code>)` : ''}</div>` : ''}
|
|
516
|
+
</div>
|
|
517
|
+
<div class="cls-item-foot"><strong>📝 Recomendación:</strong> ${escapeHtml(g.recommendation)}</div>
|
|
518
|
+
</div>
|
|
519
|
+
`).join('');
|
|
520
|
+
return `
|
|
521
|
+
<div class="section cls-section">
|
|
522
|
+
<h2>📑 Casos generables desde la evidencia</h2>
|
|
523
|
+
<p class="cls-tagline">
|
|
524
|
+
Los casos <strong>STRICT</strong> se generan únicamente desde evidencia observada y suficiente.
|
|
525
|
+
Los casos <strong>RECO</strong> se derivan del análisis del flujo real descubierto e incluyen
|
|
526
|
+
riesgo + evidencia faltante + recomendación accionable. Los flujos <strong>PARTIAL</strong> y
|
|
527
|
+
los <strong>GAPS</strong> son ítems de trabajo abiertos con plan de cierre, no fallas del Discovery.
|
|
528
|
+
</p>
|
|
529
|
+
|
|
530
|
+
<div class="cls-grid">
|
|
531
|
+
<div class="cls-block cls-strict">
|
|
532
|
+
<div class="cls-header">
|
|
533
|
+
<span class="cls-badge">STRICT</span>
|
|
534
|
+
<span class="cls-count">${cls.strict_count}</span>
|
|
535
|
+
</div>
|
|
536
|
+
<div class="cls-desc">Casos respaldados por evidencia suficiente. Automatizables sin intervención humana adicional.</div>
|
|
537
|
+
${strictHtml}
|
|
538
|
+
</div>
|
|
539
|
+
|
|
540
|
+
<div class="cls-block cls-partial">
|
|
541
|
+
<div class="cls-header">
|
|
542
|
+
<span class="cls-badge">PARTIAL</span>
|
|
543
|
+
<span class="cls-count">${cls.partial_count}</span>
|
|
544
|
+
</div>
|
|
545
|
+
<div class="cls-desc">Flujos iniciados pero sin pantalla final verificable. NO se promueven a STRICT hasta recapturar.</div>
|
|
546
|
+
${partialHtml}
|
|
547
|
+
</div>
|
|
548
|
+
|
|
549
|
+
<div class="cls-block cls-reco cls-block-wide">
|
|
550
|
+
<div class="cls-header">
|
|
551
|
+
<span class="cls-badge">RECO</span>
|
|
552
|
+
<span class="cls-count">${cls.reco_count}</span>
|
|
553
|
+
</div>
|
|
554
|
+
<div class="cls-desc">Recomendaciones contextuales (banca, seguridad, bordes). Cada una declara su origen, riesgo y plan de captura.</div>
|
|
555
|
+
${recoHtml}
|
|
556
|
+
</div>
|
|
557
|
+
|
|
558
|
+
<div class="cls-block cls-gaps cls-block-wide">
|
|
559
|
+
<div class="cls-header">
|
|
560
|
+
<span class="cls-badge">GAPS</span>
|
|
561
|
+
<span class="cls-count">${cls.gaps_count}</span>
|
|
562
|
+
</div>
|
|
563
|
+
<div class="cls-desc">Cobertura pendiente con acción QA accionable, impacto y comando recomendado.</div>
|
|
564
|
+
${gapsHtml}
|
|
565
|
+
</div>
|
|
566
|
+
</div>
|
|
567
|
+
</div>
|
|
568
|
+
`;
|
|
569
|
+
}
|
|
570
|
+
// ── Main HTML Builder ─────────────────────────────────────────────────────
|
|
571
|
+
export function generateDiscoveryReport(result, options) {
|
|
572
|
+
const evidence = result.evidence;
|
|
573
|
+
const generatedAt = new Date().toLocaleString('es-CL');
|
|
574
|
+
const framework = options.framework === 'maestro' ? 'Maestro (Android/iOS)' : 'Playwright (Web)';
|
|
575
|
+
const appLabel = options.framework === 'maestro' ? 'App ID' : 'URL';
|
|
576
|
+
// Evidence Corpus reference (used by both summary and classified sections)
|
|
577
|
+
const corpus = result.corpus;
|
|
578
|
+
// Resumen ejecutivo reorganizado (Fase 7.1) — separa métricas mezcladas
|
|
579
|
+
const metricsHtml = evidence
|
|
580
|
+
? buildExecutiveSummary(evidence, corpus)
|
|
581
|
+
: '<p class="muted">Sin métricas disponibles</p>';
|
|
582
|
+
// Sección clasificada STRICT/PARTIAL/RECO/GAPS (Fase 7.3) — solo si hay corpus
|
|
583
|
+
const classifiedHtml = corpus ? buildClassifiedSections(corpus) : '';
|
|
584
|
+
// The report shows exactly what Discovery captured — no cosmetic deduping.
|
|
585
|
+
// If two cards share the same screen name, Discovery captured it twice
|
|
586
|
+
// (which is itself useful evidence — the BFS dedupe in discoverMobile()
|
|
587
|
+
// should prevent this for new runs).
|
|
588
|
+
const navHtml = evidence ? buildNavMap(evidence.screens) : '';
|
|
589
|
+
// Build a map of screen name → most-recent result_type from the corpus.
|
|
590
|
+
// Used by buildScreenCard to render the correct state badge (happy /
|
|
591
|
+
// validation / partial / error) instead of the binary error/happy of v1.
|
|
592
|
+
const screenStateMap = new Map();
|
|
593
|
+
if (corpus) {
|
|
594
|
+
for (const r of corpus.records) {
|
|
595
|
+
if (r.screen_destination) {
|
|
596
|
+
screenStateMap.set(r.screen_destination, r.result_type);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
const screensHtml = evidence
|
|
601
|
+
? evidence.screens.map((s, i) => buildScreenCard(s, i, screenStateMap)).join('\n')
|
|
602
|
+
: '<p class="muted">Sin evidencia de pantallas</p>';
|
|
603
|
+
const confidenceHtml = evidence ? buildConfidenceSection(evidence) : '';
|
|
604
|
+
const gapsHtml = evidence ? buildEvidenceGaps(evidence) : '';
|
|
605
|
+
// Evidence Corpus sections (only if Phase 0+ produced a corpus)
|
|
606
|
+
const corpusHtml = corpus ? buildCorpusSummary(corpus) : '';
|
|
607
|
+
const timelineHtml = corpus ? buildEvidenceTimeline(corpus) : '';
|
|
608
|
+
const screenIndexMap = new Map();
|
|
609
|
+
if (evidence) {
|
|
610
|
+
evidence.screens.forEach((s, idx) => {
|
|
611
|
+
screenIndexMap.set(s.name, idx);
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
const getScreenLink = (name) => {
|
|
615
|
+
const idx = screenIndexMap.get(name);
|
|
616
|
+
if (idx !== undefined) {
|
|
617
|
+
return `<a href="#screen-${idx}" class="step-link">${escapeHtml(name)}</a>`;
|
|
618
|
+
}
|
|
619
|
+
return `<strong>${escapeHtml(name)}</strong>`;
|
|
620
|
+
};
|
|
621
|
+
const navStepsHtml = evidence?.metrics.navigationSteps.length
|
|
622
|
+
? `<ol class="nav-steps">${evidence.metrics.navigationSteps.map(s => `<li>${getScreenLink(s.from)} → ${getScreenLink(s.to)} <span class="muted">via ${escapeHtml(s.action)}</span></li>`).join('')}</ol>`
|
|
623
|
+
: '';
|
|
624
|
+
const html = `<!DOCTYPE html>
|
|
625
|
+
<html lang="es">
|
|
626
|
+
<head>
|
|
627
|
+
<meta charset="UTF-8" />
|
|
628
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
629
|
+
<title>FlowSpec QA — Discovery Report</title>
|
|
630
|
+
<style>
|
|
631
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
632
|
+
|
|
633
|
+
body {
|
|
634
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
635
|
+
background: #F0F4F8;
|
|
636
|
+
color: #1A2332;
|
|
637
|
+
line-height: 1.5;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/* ── Header ── */
|
|
641
|
+
.header {
|
|
642
|
+
background: #0D1B2A;
|
|
643
|
+
color: white;
|
|
644
|
+
padding: 32px 48px;
|
|
645
|
+
display: flex;
|
|
646
|
+
justify-content: space-between;
|
|
647
|
+
align-items: flex-start;
|
|
648
|
+
}
|
|
649
|
+
.header-brand { display: flex; align-items: center; gap: 12px; }
|
|
650
|
+
.header-brand .logo { font-size: 28px; font-weight: 800; color: #00B4D8; }
|
|
651
|
+
.header-brand .tagline { font-size: 13px; color: #8899AA; margin-top: 2px; }
|
|
652
|
+
.header-meta { text-align: right; font-size: 13px; color: #8899AA; }
|
|
653
|
+
.header-meta strong { color: #00B4D8; font-size: 15px; display: block; margin-bottom: 4px; }
|
|
654
|
+
|
|
655
|
+
/* ── Layout ── */
|
|
656
|
+
.container { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
|
|
657
|
+
.section { background: white; border-radius: 12px; padding: 28px 32px; margin-bottom: 24px;
|
|
658
|
+
box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
|
|
659
|
+
.section h2 { font-size: 18px; font-weight: 700; color: #0D1B2A; margin-bottom: 20px;
|
|
660
|
+
padding-bottom: 10px; border-bottom: 2px solid #00B4D8; display: flex;
|
|
661
|
+
align-items: center; gap: 8px; }
|
|
662
|
+
|
|
663
|
+
/* ── Metrics ── */
|
|
664
|
+
.metrics-grid { display: flex; gap: 16px; flex-wrap: wrap; }
|
|
665
|
+
.metric-card { background: #0D1B2A; color: white; border-radius: 10px; padding: 20px 24px;
|
|
666
|
+
min-width: 120px; text-align: center; flex: 1; }
|
|
667
|
+
.metric-value { font-size: 36px; font-weight: 800; color: #00B4D8; }
|
|
668
|
+
.metric-label { font-size: 12px; color: #8899AA; margin-top: 4px; text-transform: uppercase;
|
|
669
|
+
letter-spacing: 0.5px; }
|
|
670
|
+
|
|
671
|
+
/* ── Navigation Map ── */
|
|
672
|
+
.nav-map { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px 0; }
|
|
673
|
+
.nav-node { background: #F0F4F8; border: 2px solid #00B4D8; border-radius: 10px;
|
|
674
|
+
padding: 12px 16px; text-align: center; min-width: 110px; }
|
|
675
|
+
.nav-node.node-error { border-color: #EF476F; background: #FFF0F3; }
|
|
676
|
+
.nav-icon { font-size: 20px; }
|
|
677
|
+
.nav-name { font-size: 13px; font-weight: 600; margin-top: 4px; color: #0D1B2A; }
|
|
678
|
+
.nav-count { font-size: 11px; color: #8899AA; margin-top: 2px; }
|
|
679
|
+
.nav-arrow { font-size: 20px; color: #8899AA; }
|
|
680
|
+
.nav-node-link { text-decoration: none; color: inherit; display: inline-block; transition: transform 0.2s ease, box-shadow 0.2s ease; }
|
|
681
|
+
.nav-node-link:hover { transform: translateY(-2px); cursor: pointer; }
|
|
682
|
+
.nav-node-link:hover .nav-node { border-color: #0077B6; box-shadow: 0 4px 12px rgba(0, 180, 216, 0.15); }
|
|
683
|
+
.step-link { color: #00B4D8; text-decoration: none; font-weight: 600; transition: color 0.2s ease; }
|
|
684
|
+
.step-link:hover { color: #0077B6; text-decoration: underline; cursor: pointer; }
|
|
685
|
+
.nav-steps { margin-top: 16px; padding-left: 20px; }
|
|
686
|
+
.nav-steps li { padding: 4px 0; font-size: 14px; }
|
|
687
|
+
|
|
688
|
+
/* ── Screen Cards ── */
|
|
689
|
+
.screen-card { border: 1px solid #E2E8F0; border-radius: 10px; overflow: hidden;
|
|
690
|
+
margin-bottom: 24px; }
|
|
691
|
+
.screen-header { background: #F8FAFC; padding: 14px 20px; border-bottom: 1px solid #E2E8F0; }
|
|
692
|
+
.screen-header h3 { font-size: 16px; font-weight: 600; color: #0D1B2A; display: flex;
|
|
693
|
+
align-items: center; gap: 10px; }
|
|
694
|
+
.screen-body { display: flex; gap: 0; }
|
|
695
|
+
.screen-screenshot { flex: 0 0 260px; padding: 16px; background: #1A2332;
|
|
696
|
+
display: flex; align-items: flex-start; justify-content: center; }
|
|
697
|
+
.screen-img { width: 228px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
|
|
698
|
+
.no-screenshot { width: 228px; height: 200px; background: #0D1B2A; border-radius: 8px;
|
|
699
|
+
display: flex; flex-direction: column; align-items: center;
|
|
700
|
+
justify-content: center; color: #8899AA; font-size: 13px; text-align: center;
|
|
701
|
+
gap: 8px; }
|
|
702
|
+
.screen-details { flex: 1; padding: 20px 24px; }
|
|
703
|
+
.verified-texts { background: #F0FFF4; border: 1px solid #06D6A0; border-radius: 8px;
|
|
704
|
+
padding: 12px 16px; margin-bottom: 16px; font-size: 13px; }
|
|
705
|
+
.verified-texts code { background: #06D6A022; padding: 2px 6px; border-radius: 4px;
|
|
706
|
+
margin: 2px; display: inline-block; }
|
|
707
|
+
.screen-details h4 { font-size: 14px; font-weight: 600; color: #0D1B2A; margin-bottom: 10px; }
|
|
708
|
+
|
|
709
|
+
/* ── Element Table ── */
|
|
710
|
+
.elem-table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
|
711
|
+
.elem-table th { background: #F0F4F8; padding: 8px 12px; text-align: left;
|
|
712
|
+
font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
|
|
713
|
+
color: #8899AA; border-bottom: 1px solid #E2E8F0; }
|
|
714
|
+
.elem-table td { padding: 7px 12px; border-bottom: 1px solid #F0F4F8; }
|
|
715
|
+
.elem-table tr:last-child td { border-bottom: none; }
|
|
716
|
+
.elem-table code { background: #F0F4F8; padding: 2px 6px; border-radius: 4px;
|
|
717
|
+
font-size: 12px; color: #0D1B2A; }
|
|
718
|
+
|
|
719
|
+
/* ── Confidence ── */
|
|
720
|
+
.confidence-section { display: flex; gap: 24px; align-items: flex-start; }
|
|
721
|
+
.confidence-meter { flex: 0 0 160px; text-align: center; }
|
|
722
|
+
.confidence-score { font-size: 56px; font-weight: 800; line-height: 1; }
|
|
723
|
+
.confidence-label { font-size: 13px; color: #8899AA; margin: 6px 0 12px; }
|
|
724
|
+
.confidence-bar { height: 8px; background: #E2E8F0; border-radius: 4px; overflow: hidden; }
|
|
725
|
+
.confidence-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
|
|
726
|
+
.confidence-detail { flex: 1; }
|
|
727
|
+
.conf-block { margin-bottom: 20px; }
|
|
728
|
+
.conf-block h4 { font-size: 14px; font-weight: 600; margin-bottom: 8px; color: #0D1B2A; }
|
|
729
|
+
.conf-note { font-size: 13px; color: #667788; margin-top: 8px; }
|
|
730
|
+
.chip-container { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
731
|
+
.id-chip { background: #00B4D822; color: #00B4D8; padding: 3px 8px; border-radius: 4px;
|
|
732
|
+
font-size: 12px; border: 1px solid #00B4D844; }
|
|
733
|
+
.text-chip { background: #06D6A022; color: #06D6A0; padding: 3px 8px; border-radius: 4px;
|
|
734
|
+
font-size: 12px; border: 1px solid #06D6A044; word-break: break-word; }
|
|
735
|
+
|
|
736
|
+
/* ── Partial Evidence ── */
|
|
737
|
+
.no-screenshot.partial-evidence {
|
|
738
|
+
width: 228px; min-height: 200px; background: #1C0F0F; border-radius: 8px;
|
|
739
|
+
display: flex; flex-direction: column; align-items: center; justify-content: center;
|
|
740
|
+
padding: 16px; text-align: center; gap: 6px;
|
|
741
|
+
border: 1px solid #EF476F44;
|
|
742
|
+
}
|
|
743
|
+
.pe-icon { font-size: 24px; }
|
|
744
|
+
.pe-title { font-size: 13px; font-weight: 700; color: #EF476F; }
|
|
745
|
+
.pe-body { font-size: 11px; color: #AA8888; line-height: 1.4; }
|
|
746
|
+
.pe-badge {
|
|
747
|
+
margin-top: 8px; background: #EF476F22; border: 1px solid #EF476F55;
|
|
748
|
+
color: #EF476F; font-size: 10px; font-weight: 700; padding: 2px 8px;
|
|
749
|
+
border-radius: 4px; letter-spacing: 0.5px; font-family: monospace;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/* ── Evidence Gaps Section ── */
|
|
753
|
+
.gaps-section { border: 1px solid #EF476F44; }
|
|
754
|
+
.gaps-section h2 { border-bottom-color: #EF476F; }
|
|
755
|
+
.gaps-summary { display: flex; gap: 24px; margin-bottom: 20px; flex-wrap: wrap; }
|
|
756
|
+
.gaps-stat { display: flex; flex-direction: column; align-items: center;
|
|
757
|
+
background: #F8FAFC; border-radius: 8px; padding: 14px 20px; min-width: 140px; }
|
|
758
|
+
.gaps-stat-value { font-size: 36px; font-weight: 800; color: #0D1B2A; line-height: 1; }
|
|
759
|
+
.gaps-stat-label { font-size: 12px; color: #8899AA; margin-top: 4px; text-align: center; }
|
|
760
|
+
.gaps-notice {
|
|
761
|
+
background: #FFF8F0; border: 1px solid #FFB70366; border-radius: 8px;
|
|
762
|
+
padding: 16px 20px; font-size: 13px; color: #4A3A20; margin-bottom: 20px; line-height: 1.6;
|
|
763
|
+
}
|
|
764
|
+
.gaps-notice code { background: #FFB70322; padding: 1px 5px; border-radius: 3px; font-size: 12px; }
|
|
765
|
+
.gaps-table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
|
766
|
+
.gaps-table th { background: #FFF0F3; padding: 8px 12px; text-align: left;
|
|
767
|
+
font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
|
|
768
|
+
color: #8899AA; border-bottom: 1px solid #EF476F33; }
|
|
769
|
+
.gaps-table td { padding: 8px 12px; border-bottom: 1px solid #F0F4F8; vertical-align: top; }
|
|
770
|
+
.gaps-table tr:last-child td { border-bottom: none; }
|
|
771
|
+
.gap-badge { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
|
|
772
|
+
.gap-error { background: #EF476F22; color: #EF476F; border: 1px solid #EF476F44; }
|
|
773
|
+
.gap-normal { background: #00B4D822; color: #00B4D8; border: 1px solid #00B4D844; }
|
|
774
|
+
.gap-action { color: #667788; font-size: 12px; }
|
|
775
|
+
.gap-action code { background: #F0F4F8; padding: 1px 5px; border-radius: 3px; }
|
|
776
|
+
|
|
777
|
+
/* ── Evidence Corpus Summary ── */
|
|
778
|
+
.corpus-tagline { color: #455A6E; font-size: 13px; margin-bottom: 16px; line-height: 1.6; }
|
|
779
|
+
.corpus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
|
|
780
|
+
.corpus-stat { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 10px; padding: 16px 18px; text-align: center; }
|
|
781
|
+
.corpus-num { font-size: 36px; font-weight: 800; color: #00B4D8; line-height: 1; }
|
|
782
|
+
.corpus-lbl { font-size: 12px; color: #455A6E; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
|
|
783
|
+
.corpus-sub { font-size: 11px; color: #8899AA; margin-top: 4px; font-style: italic; }
|
|
784
|
+
.corpus-breakdown { background: #F0F4F8; border-radius: 8px; padding: 12px 16px; }
|
|
785
|
+
.corpus-row { font-size: 13px; padding: 6px 0; }
|
|
786
|
+
.corpus-row strong { color: #0D1B2A; margin-right: 8px; }
|
|
787
|
+
.corpus-pill { display: inline-block; background: white; border: 1px solid #E2E8F0; padding: 3px 10px; border-radius: 12px;
|
|
788
|
+
font-size: 12px; margin: 2px 4px; color: #455A6E; }
|
|
789
|
+
.corpus-pill strong { color: #0D1B2A; margin-right: 4px; }
|
|
790
|
+
|
|
791
|
+
/* ── Evidence Timeline ── */
|
|
792
|
+
.ev-timeline { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
|
|
793
|
+
.ev-row { display: grid; grid-template-columns: 70px 1fr 240px; gap: 16px; padding: 14px 16px;
|
|
794
|
+
background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 8px; align-items: start; }
|
|
795
|
+
.ev-id { font-family: 'SF Mono', Menlo, monospace; font-size: 12px; color: #00B4D8; font-weight: 700;
|
|
796
|
+
padding-top: 2px; }
|
|
797
|
+
.ev-action-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
798
|
+
.ev-icon { font-size: 18px; }
|
|
799
|
+
.ev-element { background: #0D1B2A; color: #00B4D8; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
|
|
800
|
+
.ev-label { color: #455A6E; font-size: 13px; font-style: italic; }
|
|
801
|
+
.ev-flow { font-size: 12px; color: #455A6E; margin-top: 6px; }
|
|
802
|
+
.ev-screen { color: #0D1B2A; font-weight: 600; }
|
|
803
|
+
.ev-arrow { color: #8899AA; margin: 0 6px; }
|
|
804
|
+
.ev-inputs { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
|
|
805
|
+
.ev-field { background: #FFB70322; color: #8B6914; padding: 2px 6px; border-radius: 4px; font-size: 11px;
|
|
806
|
+
border: 1px solid #FFB70344; }
|
|
807
|
+
.ev-result { display: flex; flex-direction: column; gap: 4px; }
|
|
808
|
+
.ev-result-pill { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700;
|
|
809
|
+
text-transform: uppercase; border: 1px solid; align-self: flex-start; }
|
|
810
|
+
.ev-desc { font-size: 12px; color: #455A6E; line-height: 1.4; }
|
|
811
|
+
.ev-captured { font-size: 11px; padding: 2px 8px; border-radius: 4px; align-self: flex-start; }
|
|
812
|
+
.ev-autonomous { background: #00B4D822; color: #006B85; }
|
|
813
|
+
.ev-interactive { background: #06D6A022; color: #057855; }
|
|
814
|
+
.ev-quality { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 3px;
|
|
815
|
+
border: 1px solid; letter-spacing: 0.3px; text-transform: uppercase;
|
|
816
|
+
align-self: flex-start; }
|
|
817
|
+
.ev-fp { font-size: 10px; color: #8899AA; background: #F0F4F8; padding: 1px 6px;
|
|
818
|
+
border-radius: 3px; margin-left: 8px; font-family: 'SF Mono', Menlo, monospace; }
|
|
819
|
+
|
|
820
|
+
/* ── Resumen Ejecutivo (Fase 7.1) ── */
|
|
821
|
+
.exec-summary { display: flex; flex-direction: column; gap: 14px; }
|
|
822
|
+
.exec-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
|
|
823
|
+
.exec-cell { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 8px;
|
|
824
|
+
padding: 14px 16px; text-align: center; display: flex; flex-direction: column;
|
|
825
|
+
align-items: center; justify-content: center; min-height: 90px; }
|
|
826
|
+
.exec-num { font-size: 28px; font-weight: 800; color: #00B4D8; line-height: 1; }
|
|
827
|
+
.exec-lbl { font-size: 11px; color: #455A6E; margin-top: 6px; text-transform: uppercase;
|
|
828
|
+
letter-spacing: 0.5px; font-weight: 600; line-height: 1.3; }
|
|
829
|
+
.exec-lbl small { font-weight: 400; text-transform: none; color: #8899AA; font-size: 10px; }
|
|
830
|
+
|
|
831
|
+
/* ── Sección Clasificada STRICT/PARTIAL/RECO/GAPS (Fase 7.3) ── */
|
|
832
|
+
.cls-section { border: 1px solid #00B4D844; }
|
|
833
|
+
.cls-tagline { color: #455A6E; font-size: 13px; line-height: 1.6; margin-bottom: 18px;
|
|
834
|
+
background: #F0F4F8; padding: 12px 16px; border-radius: 8px; }
|
|
835
|
+
.cls-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
|
|
836
|
+
.cls-block { border: 1px solid #E2E8F0; border-radius: 10px; padding: 16px 18px;
|
|
837
|
+
background: #F8FAFC; }
|
|
838
|
+
.cls-block.cls-strict { border-left: 4px solid #06D6A0; }
|
|
839
|
+
.cls-block.cls-partial { border-left: 4px solid #FFB703; }
|
|
840
|
+
.cls-block.cls-reco { border-left: 4px solid #00B4D8; }
|
|
841
|
+
.cls-block.cls-gaps { border-left: 4px solid #EF476F; }
|
|
842
|
+
.cls-header { display: flex; justify-content: space-between; align-items: center;
|
|
843
|
+
margin-bottom: 8px; }
|
|
844
|
+
.cls-badge { padding: 3px 12px; border-radius: 4px; font-size: 11px; font-weight: 800;
|
|
845
|
+
letter-spacing: 1px; color: white; }
|
|
846
|
+
.cls-strict .cls-badge { background: #06D6A0; }
|
|
847
|
+
.cls-partial .cls-badge { background: #FFB703; color: #5A4500; }
|
|
848
|
+
.cls-reco .cls-badge { background: #00B4D8; }
|
|
849
|
+
.cls-gaps .cls-badge { background: #EF476F; }
|
|
850
|
+
.cls-count { font-size: 28px; font-weight: 800; color: #0D1B2A; line-height: 1; }
|
|
851
|
+
.cls-desc { font-size: 12px; color: #455A6E; margin-bottom: 10px; line-height: 1.4; }
|
|
852
|
+
.cls-list { list-style: none; padding: 0; }
|
|
853
|
+
.cls-list li { padding: 6px 0; font-size: 12px; color: #1A2332;
|
|
854
|
+
border-top: 1px solid #E2E8F022; line-height: 1.5; }
|
|
855
|
+
.cls-list li:first-child { border-top: none; }
|
|
856
|
+
.cls-evid { background: #0D1B2A; color: #00B4D8; padding: 1px 6px; border-radius: 3px;
|
|
857
|
+
font-size: 11px; margin-right: 6px; }
|
|
858
|
+
.cls-block-wide { grid-column: span 2; }
|
|
859
|
+
.cls-item { background: white; border: 1px solid #E2E8F022; border-radius: 8px;
|
|
860
|
+
padding: 12px 14px; margin-top: 10px; font-size: 12px; line-height: 1.5; }
|
|
861
|
+
.cls-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
|
|
862
|
+
padding-bottom: 8px; border-bottom: 1px solid #F0F4F8; margin-bottom: 8px; }
|
|
863
|
+
.cls-item-head strong { color: #0D1B2A; flex: 1; font-size: 13px; }
|
|
864
|
+
.cls-item-body { color: #455A6E; padding: 4px 0; }
|
|
865
|
+
.cls-item-body > div { margin: 4px 0; }
|
|
866
|
+
.cls-item-body strong { color: #0D1B2A; }
|
|
867
|
+
.cls-item-foot { margin-top: 8px; padding-top: 8px; border-top: 1px solid #F0F4F8;
|
|
868
|
+
color: #1A2332; background: #F8FAFC; padding: 8px 10px;
|
|
869
|
+
border-radius: 4px; }
|
|
870
|
+
.cls-item-foot strong { color: #06D6A0; }
|
|
871
|
+
.cls-prio { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 3px;
|
|
872
|
+
border: 1px solid; letter-spacing: 0.5px; }
|
|
873
|
+
.cls-cat { font-size: 11px; color: #8899AA; background: #F0F4F8; padding: 2px 8px;
|
|
874
|
+
border-radius: 3px; text-transform: capitalize; }
|
|
875
|
+
.cls-origin { font-size: 11px; color: #8899AA; font-style: italic; margin-top: 6px; }
|
|
876
|
+
.cls-origin code { background: #F0F4F8; padding: 1px 5px; border-radius: 3px;
|
|
877
|
+
color: #455A6E; font-size: 10px; }
|
|
878
|
+
.conf-explain { background: #F0F4F8; border-left: 4px solid #00B4D8; padding: 14px 18px;
|
|
879
|
+
border-radius: 6px; }
|
|
880
|
+
.conf-explain h4 { color: #0D1B2A; }
|
|
881
|
+
.conf-explain code { background: #0D1B2A; color: #00B4D8; padding: 1px 6px;
|
|
882
|
+
border-radius: 3px; font-size: 11px; }
|
|
883
|
+
|
|
884
|
+
@media (max-width: 768px) {
|
|
885
|
+
.exec-row { grid-template-columns: repeat(2, 1fr); }
|
|
886
|
+
.cls-grid { grid-template-columns: 1fr; }
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
/* ── Misc ── */
|
|
890
|
+
.badge { padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
|
|
891
|
+
.muted { color: #8899AA; font-size: 13px; font-style: italic; }
|
|
892
|
+
|
|
893
|
+
.footer { text-align: center; padding: 24px; color: #8899AA; font-size: 12px; }
|
|
894
|
+
.footer strong { color: #00B4D8; }
|
|
895
|
+
|
|
896
|
+
@media (max-width: 768px) {
|
|
897
|
+
.screen-body { flex-direction: column; }
|
|
898
|
+
.confidence-section { flex-direction: column; }
|
|
899
|
+
.header { flex-direction: column; gap: 16px; }
|
|
900
|
+
}
|
|
901
|
+
</style>
|
|
902
|
+
</head>
|
|
903
|
+
<body>
|
|
904
|
+
|
|
905
|
+
<div class="header">
|
|
906
|
+
<div class="header-brand">
|
|
907
|
+
<div>
|
|
908
|
+
<div class="logo">FlowSpec QA</div>
|
|
909
|
+
<div class="tagline">Discovery Evidence Report</div>
|
|
910
|
+
</div>
|
|
911
|
+
</div>
|
|
912
|
+
<div class="header-meta">
|
|
913
|
+
<strong>${escapeHtml(options.url)}</strong>
|
|
914
|
+
<span>${appLabel}: ${escapeHtml(options.url)}</span><br/>
|
|
915
|
+
<span>Framework: ${framework}</span><br/>
|
|
916
|
+
<span>Generado: ${generatedAt}</span>
|
|
917
|
+
</div>
|
|
918
|
+
</div>
|
|
919
|
+
|
|
920
|
+
<div class="container">
|
|
921
|
+
|
|
922
|
+
<!-- Métricas -->
|
|
923
|
+
<div class="section">
|
|
924
|
+
<h2>📊 Resumen del Discovery</h2>
|
|
925
|
+
${metricsHtml}
|
|
926
|
+
</div>
|
|
927
|
+
|
|
928
|
+
<!-- Evidence Corpus (Phase 0+) -->
|
|
929
|
+
${corpusHtml}
|
|
930
|
+
|
|
931
|
+
<!-- Casos generables — STRICT / PARTIAL / RECO / GAPS (Spec § 7.3) -->
|
|
932
|
+
${classifiedHtml}
|
|
933
|
+
|
|
934
|
+
<!-- Mapa de Navegación -->
|
|
935
|
+
<div class="section">
|
|
936
|
+
<h2>🗺️ Mapa de Navegación</h2>
|
|
937
|
+
${navHtml}
|
|
938
|
+
${navStepsHtml}
|
|
939
|
+
</div>
|
|
940
|
+
|
|
941
|
+
<!-- Análisis de Confianza -->
|
|
942
|
+
<div class="section">
|
|
943
|
+
<h2>🎯 Análisis de Confianza</h2>
|
|
944
|
+
${confidenceHtml || '<p class="muted">Sin datos de análisis de confianza</p>'}
|
|
945
|
+
</div>
|
|
946
|
+
|
|
947
|
+
<!-- Pantallas Descubiertas -->
|
|
948
|
+
<div class="section">
|
|
949
|
+
<h2>📱 Pantallas Descubiertas</h2>
|
|
950
|
+
${screensHtml}
|
|
951
|
+
</div>
|
|
952
|
+
|
|
953
|
+
<!-- Timeline cronológico del Discovery -->
|
|
954
|
+
${timelineHtml}
|
|
955
|
+
|
|
956
|
+
<!-- Brechas técnicas de evidencia (solo si hay screens sin screenshot) -->
|
|
957
|
+
${gapsHtml}
|
|
958
|
+
|
|
959
|
+
</div>
|
|
960
|
+
|
|
961
|
+
<div class="footer">
|
|
962
|
+
Generado por <strong>FlowSpec QA Runner</strong> — flowspecqa.com
|
|
963
|
+
</div>
|
|
964
|
+
|
|
965
|
+
</body>
|
|
966
|
+
</html>`;
|
|
967
|
+
// Save to disk
|
|
968
|
+
if (!fs.existsSync(options.outputDir)) {
|
|
969
|
+
fs.mkdirSync(options.outputDir, { recursive: true });
|
|
970
|
+
}
|
|
971
|
+
const sanitizedUrl = options.url.replace(/[^a-zA-Z0-9._-]/g, '_').replace(/_+/g, '_').replace(/^_|_$/g, '');
|
|
972
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-').replace(/Z$/, 'Z');
|
|
973
|
+
const reportPath = path.join(options.outputDir, `discovery_report_${sanitizedUrl}_${timestamp}.html`);
|
|
974
|
+
fs.writeFileSync(reportPath, html, 'utf8');
|
|
975
|
+
return reportPath;
|
|
976
|
+
}
|
|
977
|
+
//# sourceMappingURL=discovery-report.js.map
|