@flowspec-qa/runner-core 0.2.3 → 0.3.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/discovery-report.d.ts +13 -0
- package/dist/discovery-report.d.ts.map +1 -0
- package/dist/discovery-report.js +357 -0
- package/dist/discovery-report.js.map +1 -0
- package/dist/discovery.d.ts +118 -2
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +762 -190
- package/dist/discovery.js.map +1 -1
- package/dist/executor.d.ts +1 -0
- package/dist/executor.d.ts.map +1 -1
- package/dist/executor.js +48 -15
- package/dist/executor.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/suite-manager.d.ts.map +1 -1
- package/dist/suite-manager.js +43 -0
- 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,13 @@
|
|
|
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 type { DiscoveryResult } from './discovery.js';
|
|
7
|
+
export interface ReportOptions {
|
|
8
|
+
outputDir: string;
|
|
9
|
+
framework: 'playwright' | 'maestro';
|
|
10
|
+
url: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function generateDiscoveryReport(result: DiscoveryResult, options: ReportOptions): string;
|
|
13
|
+
//# sourceMappingURL=discovery-report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery-report.d.ts","sourceRoot":"","sources":["../src/discovery-report.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,gBAAgB,CAAC;AAEzE,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,YAAY,GAAG,SAAS,CAAC;IACpC,GAAG,EAAE,MAAM,CAAC;CACb;AAwJD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,aAAa,GACrB,MAAM,CAkOR"}
|
|
@@ -0,0 +1,357 @@
|
|
|
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
|
+
// ── Helpers ────────────────────────────────────────────────────────────────
|
|
9
|
+
function formatDuration(ms) {
|
|
10
|
+
if (ms < 1000)
|
|
11
|
+
return `${ms}ms`;
|
|
12
|
+
const s = Math.round(ms / 1000);
|
|
13
|
+
if (s < 60)
|
|
14
|
+
return `${s}s`;
|
|
15
|
+
return `${Math.floor(s / 60)}m ${s % 60}s`;
|
|
16
|
+
}
|
|
17
|
+
function escapeHtml(s) {
|
|
18
|
+
return s
|
|
19
|
+
.replace(/&/g, '&')
|
|
20
|
+
.replace(/</g, '<')
|
|
21
|
+
.replace(/>/g, '>')
|
|
22
|
+
.replace(/"/g, '"');
|
|
23
|
+
}
|
|
24
|
+
function confidenceBadge(level) {
|
|
25
|
+
const map = {
|
|
26
|
+
HIGH: { color: '#06D6A0', bg: '#06D6A022', label: '🟢 ALTA' },
|
|
27
|
+
MEDIUM: { color: '#FFB703', bg: '#FFB70322', label: '🟡 MEDIA' },
|
|
28
|
+
LOW: { color: '#EF476F', bg: '#EF476F22', label: '🔴 BAJA' },
|
|
29
|
+
};
|
|
30
|
+
const c = map[level];
|
|
31
|
+
return `<span class="badge" style="color:${c.color};background:${c.bg};border:1px solid ${c.color}">${c.label}</span>`;
|
|
32
|
+
}
|
|
33
|
+
// ── Navigation Map (CSS boxes) ─────────────────────────────────────────────
|
|
34
|
+
function buildNavMap(screens) {
|
|
35
|
+
if (!screens.length)
|
|
36
|
+
return '<p class="muted">Sin datos de navegación</p>';
|
|
37
|
+
const nodes = screens.map((s, i) => {
|
|
38
|
+
const errorClass = s.isErrorState ? 'node-error' : 'node-normal';
|
|
39
|
+
const icon = s.isErrorState ? '⚠️' : '📱';
|
|
40
|
+
return `
|
|
41
|
+
<div class="nav-node ${errorClass}" data-index="${i}">
|
|
42
|
+
<div class="nav-icon">${icon}</div>
|
|
43
|
+
<div class="nav-name">${escapeHtml(s.name)}</div>
|
|
44
|
+
<div class="nav-count">${s.elements.length} elementos</div>
|
|
45
|
+
</div>
|
|
46
|
+
${i < screens.length - 1 ? '<div class="nav-arrow">→</div>' : ''}
|
|
47
|
+
`;
|
|
48
|
+
}).join('');
|
|
49
|
+
return `<div class="nav-map">${nodes}</div>`;
|
|
50
|
+
}
|
|
51
|
+
// ── Screen Card (screenshot + element table) ───────────────────────────────
|
|
52
|
+
function buildScreenCard(screen, index) {
|
|
53
|
+
const imgHtml = screen.screenshot
|
|
54
|
+
? `<img src="data:image/png;base64,${screen.screenshot}" class="screen-img" alt="${escapeHtml(screen.name)}" />`
|
|
55
|
+
: `<div class="no-screenshot">📷 Sin screenshot<br><small>ADB no disponible</small></div>`;
|
|
56
|
+
const errorBadge = screen.isErrorState
|
|
57
|
+
? '<span class="badge" style="color:#EF476F;background:#EF476F22;border:1px solid #EF476F">⚠️ Error State</span>'
|
|
58
|
+
: '<span class="badge" style="color:#06D6A0;background:#06D6A022;border:1px solid #06D6A0">✅ Happy Path</span>';
|
|
59
|
+
const textsHtml = screen.allTexts.length
|
|
60
|
+
? `<div class="verified-texts"><strong>Textos verificados en pantalla:</strong><br>
|
|
61
|
+
${screen.allTexts.slice(0, 15).map(t => `<code>${escapeHtml(t)}</code>`).join(' ')}
|
|
62
|
+
</div>`
|
|
63
|
+
: '';
|
|
64
|
+
const rows = screen.elements.map(e => `
|
|
65
|
+
<tr>
|
|
66
|
+
<td><code>${escapeHtml(e.type)}</code></td>
|
|
67
|
+
<td>${escapeHtml(e.text === 'N/A' ? '—' : e.text)}</td>
|
|
68
|
+
<td><code>${escapeHtml(e.id)}</code></td>
|
|
69
|
+
</tr>
|
|
70
|
+
`).join('');
|
|
71
|
+
const tableHtml = rows
|
|
72
|
+
? `<table class="elem-table">
|
|
73
|
+
<thead><tr><th>Tipo</th><th>Texto</th><th>ID</th></tr></thead>
|
|
74
|
+
<tbody>${rows}</tbody>
|
|
75
|
+
</table>`
|
|
76
|
+
: '<p class="muted">Sin elementos interactivos detectados</p>';
|
|
77
|
+
return `
|
|
78
|
+
<div class="screen-card">
|
|
79
|
+
<div class="screen-header">
|
|
80
|
+
<h3>${index + 1}. ${escapeHtml(screen.name)} ${errorBadge}</h3>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="screen-body">
|
|
83
|
+
<div class="screen-screenshot">${imgHtml}</div>
|
|
84
|
+
<div class="screen-details">
|
|
85
|
+
${textsHtml}
|
|
86
|
+
<h4>Elementos detectados (${screen.elements.length})</h4>
|
|
87
|
+
${tableHtml}
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
`;
|
|
92
|
+
}
|
|
93
|
+
// ── Confidence Section ────────────────────────────────────────────────────
|
|
94
|
+
function buildConfidenceSection(evidence) {
|
|
95
|
+
const { verifiedTexts, verifiedIds } = evidence;
|
|
96
|
+
const highCount = verifiedIds.length;
|
|
97
|
+
const highTexts = verifiedTexts.length;
|
|
98
|
+
const total = highCount + highTexts;
|
|
99
|
+
const confidence = total > 0 ? Math.min(Math.round((highTexts / Math.max(highTexts + 5, 1)) * 100), 95) : 20;
|
|
100
|
+
const idsHtml = verifiedIds.length
|
|
101
|
+
? verifiedIds.map(id => `<code class="id-chip">${escapeHtml(id)}</code>`).join(' ')
|
|
102
|
+
: '<span class="muted">Ninguno</span>';
|
|
103
|
+
const textsHtml = verifiedTexts.length
|
|
104
|
+
? verifiedTexts.map(t => `<code class="text-chip">${escapeHtml(t)}</code>`).join(' ')
|
|
105
|
+
: '<span class="muted">Ninguno — los textos de error en los scripts son inferidos (LOW confidence)</span>';
|
|
106
|
+
return `
|
|
107
|
+
<div class="confidence-section">
|
|
108
|
+
<div class="confidence-meter">
|
|
109
|
+
<div class="confidence-score" style="color: ${confidence >= 70 ? '#06D6A0' : confidence >= 40 ? '#FFB703' : '#EF476F'}">
|
|
110
|
+
${confidence}%
|
|
111
|
+
</div>
|
|
112
|
+
<div class="confidence-label">Confianza del Discovery</div>
|
|
113
|
+
<div class="confidence-bar">
|
|
114
|
+
<div class="confidence-fill" style="width:${confidence}%;background:${confidence >= 70 ? '#06D6A0' : confidence >= 40 ? '#FFB703' : '#EF476F'}"></div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<div class="confidence-detail">
|
|
119
|
+
<div class="conf-block">
|
|
120
|
+
<h4>🟢 IDs verificados en jerarquía real (${verifiedIds.length})</h4>
|
|
121
|
+
<div class="chip-container">${idsHtml}</div>
|
|
122
|
+
<p class="conf-note">Los tests que usan estos IDs tienen confianza ALTA — el elemento fue visto en el dispositivo.</p>
|
|
123
|
+
</div>
|
|
124
|
+
<div class="conf-block">
|
|
125
|
+
<h4>🟢 Textos verificados en pantalla (${verifiedTexts.length})</h4>
|
|
126
|
+
<div class="chip-container">${textsHtml}</div>
|
|
127
|
+
<p class="conf-note">Los assertVisible que usen estos textos exactos tienen confianza ALTA.</p>
|
|
128
|
+
</div>
|
|
129
|
+
<div class="conf-block">
|
|
130
|
+
<h4>🔴 Textos no observados = Confianza BAJA</h4>
|
|
131
|
+
<p class="conf-note">Cualquier assertVisible con texto que NO aparezca arriba fue generado por inferencia de la IA.
|
|
132
|
+
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>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
`;
|
|
137
|
+
}
|
|
138
|
+
// ── Main HTML Builder ─────────────────────────────────────────────────────
|
|
139
|
+
export function generateDiscoveryReport(result, options) {
|
|
140
|
+
const evidence = result.evidence;
|
|
141
|
+
const generatedAt = new Date().toLocaleString('es-CL');
|
|
142
|
+
const framework = options.framework === 'maestro' ? 'Maestro (Android/iOS)' : 'Playwright (Web)';
|
|
143
|
+
const appLabel = options.framework === 'maestro' ? 'App ID' : 'URL';
|
|
144
|
+
const metricsHtml = evidence ? `
|
|
145
|
+
<div class="metrics-grid">
|
|
146
|
+
<div class="metric-card">
|
|
147
|
+
<div class="metric-value">${evidence.metrics.screensDiscovered}</div>
|
|
148
|
+
<div class="metric-label">Pantallas</div>
|
|
149
|
+
</div>
|
|
150
|
+
<div class="metric-card">
|
|
151
|
+
<div class="metric-value">${evidence.metrics.elementsFound}</div>
|
|
152
|
+
<div class="metric-label">Elementos</div>
|
|
153
|
+
</div>
|
|
154
|
+
<div class="metric-card">
|
|
155
|
+
<div class="metric-value">${evidence.metrics.errorStatesExplored}</div>
|
|
156
|
+
<div class="metric-label">Error States</div>
|
|
157
|
+
</div>
|
|
158
|
+
<div class="metric-card">
|
|
159
|
+
<div class="metric-value">${evidence.verifiedTexts.length}</div>
|
|
160
|
+
<div class="metric-label">Textos verificados</div>
|
|
161
|
+
</div>
|
|
162
|
+
<div class="metric-card">
|
|
163
|
+
<div class="metric-value">${formatDuration(evidence.metrics.durationMs)}</div>
|
|
164
|
+
<div class="metric-label">Duración</div>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
` : '<p class="muted">Sin métricas disponibles</p>';
|
|
168
|
+
const navHtml = evidence ? buildNavMap(evidence.screens) : '';
|
|
169
|
+
const screensHtml = evidence
|
|
170
|
+
? evidence.screens.map((s, i) => buildScreenCard(s, i)).join('\n')
|
|
171
|
+
: '<p class="muted">Sin evidencia de pantallas</p>';
|
|
172
|
+
const confidenceHtml = evidence ? buildConfidenceSection(evidence) : '';
|
|
173
|
+
const navStepsHtml = evidence?.metrics.navigationSteps.length
|
|
174
|
+
? `<ol class="nav-steps">${evidence.metrics.navigationSteps.map(s => `<li><strong>${escapeHtml(s.from)}</strong> → <strong>${escapeHtml(s.to)}</strong> <span class="muted">via ${escapeHtml(s.action)}</span></li>`).join('')}</ol>`
|
|
175
|
+
: '';
|
|
176
|
+
const html = `<!DOCTYPE html>
|
|
177
|
+
<html lang="es">
|
|
178
|
+
<head>
|
|
179
|
+
<meta charset="UTF-8" />
|
|
180
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
181
|
+
<title>FlowSpec QA — Discovery Report</title>
|
|
182
|
+
<style>
|
|
183
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
184
|
+
|
|
185
|
+
body {
|
|
186
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
187
|
+
background: #F0F4F8;
|
|
188
|
+
color: #1A2332;
|
|
189
|
+
line-height: 1.5;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/* ── Header ── */
|
|
193
|
+
.header {
|
|
194
|
+
background: #0D1B2A;
|
|
195
|
+
color: white;
|
|
196
|
+
padding: 32px 48px;
|
|
197
|
+
display: flex;
|
|
198
|
+
justify-content: space-between;
|
|
199
|
+
align-items: flex-start;
|
|
200
|
+
}
|
|
201
|
+
.header-brand { display: flex; align-items: center; gap: 12px; }
|
|
202
|
+
.header-brand .logo { font-size: 28px; font-weight: 800; color: #00B4D8; }
|
|
203
|
+
.header-brand .tagline { font-size: 13px; color: #8899AA; margin-top: 2px; }
|
|
204
|
+
.header-meta { text-align: right; font-size: 13px; color: #8899AA; }
|
|
205
|
+
.header-meta strong { color: #00B4D8; font-size: 15px; display: block; margin-bottom: 4px; }
|
|
206
|
+
|
|
207
|
+
/* ── Layout ── */
|
|
208
|
+
.container { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
|
|
209
|
+
.section { background: white; border-radius: 12px; padding: 28px 32px; margin-bottom: 24px;
|
|
210
|
+
box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
|
|
211
|
+
.section h2 { font-size: 18px; font-weight: 700; color: #0D1B2A; margin-bottom: 20px;
|
|
212
|
+
padding-bottom: 10px; border-bottom: 2px solid #00B4D8; display: flex;
|
|
213
|
+
align-items: center; gap: 8px; }
|
|
214
|
+
|
|
215
|
+
/* ── Metrics ── */
|
|
216
|
+
.metrics-grid { display: flex; gap: 16px; flex-wrap: wrap; }
|
|
217
|
+
.metric-card { background: #0D1B2A; color: white; border-radius: 10px; padding: 20px 24px;
|
|
218
|
+
min-width: 120px; text-align: center; flex: 1; }
|
|
219
|
+
.metric-value { font-size: 36px; font-weight: 800; color: #00B4D8; }
|
|
220
|
+
.metric-label { font-size: 12px; color: #8899AA; margin-top: 4px; text-transform: uppercase;
|
|
221
|
+
letter-spacing: 0.5px; }
|
|
222
|
+
|
|
223
|
+
/* ── Navigation Map ── */
|
|
224
|
+
.nav-map { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px 0; }
|
|
225
|
+
.nav-node { background: #F0F4F8; border: 2px solid #00B4D8; border-radius: 10px;
|
|
226
|
+
padding: 12px 16px; text-align: center; min-width: 110px; }
|
|
227
|
+
.nav-node.node-error { border-color: #EF476F; background: #FFF0F3; }
|
|
228
|
+
.nav-icon { font-size: 20px; }
|
|
229
|
+
.nav-name { font-size: 13px; font-weight: 600; margin-top: 4px; color: #0D1B2A; }
|
|
230
|
+
.nav-count { font-size: 11px; color: #8899AA; margin-top: 2px; }
|
|
231
|
+
.nav-arrow { font-size: 20px; color: #8899AA; }
|
|
232
|
+
.nav-steps { margin-top: 16px; padding-left: 20px; }
|
|
233
|
+
.nav-steps li { padding: 4px 0; font-size: 14px; }
|
|
234
|
+
|
|
235
|
+
/* ── Screen Cards ── */
|
|
236
|
+
.screen-card { border: 1px solid #E2E8F0; border-radius: 10px; overflow: hidden;
|
|
237
|
+
margin-bottom: 24px; }
|
|
238
|
+
.screen-header { background: #F8FAFC; padding: 14px 20px; border-bottom: 1px solid #E2E8F0; }
|
|
239
|
+
.screen-header h3 { font-size: 16px; font-weight: 600; color: #0D1B2A; display: flex;
|
|
240
|
+
align-items: center; gap: 10px; }
|
|
241
|
+
.screen-body { display: flex; gap: 0; }
|
|
242
|
+
.screen-screenshot { flex: 0 0 260px; padding: 16px; background: #1A2332;
|
|
243
|
+
display: flex; align-items: flex-start; justify-content: center; }
|
|
244
|
+
.screen-img { width: 228px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
|
|
245
|
+
.no-screenshot { width: 228px; height: 200px; background: #0D1B2A; border-radius: 8px;
|
|
246
|
+
display: flex; flex-direction: column; align-items: center;
|
|
247
|
+
justify-content: center; color: #8899AA; font-size: 13px; text-align: center;
|
|
248
|
+
gap: 8px; }
|
|
249
|
+
.screen-details { flex: 1; padding: 20px 24px; }
|
|
250
|
+
.verified-texts { background: #F0FFF4; border: 1px solid #06D6A0; border-radius: 8px;
|
|
251
|
+
padding: 12px 16px; margin-bottom: 16px; font-size: 13px; }
|
|
252
|
+
.verified-texts code { background: #06D6A022; padding: 2px 6px; border-radius: 4px;
|
|
253
|
+
margin: 2px; display: inline-block; }
|
|
254
|
+
.screen-details h4 { font-size: 14px; font-weight: 600; color: #0D1B2A; margin-bottom: 10px; }
|
|
255
|
+
|
|
256
|
+
/* ── Element Table ── */
|
|
257
|
+
.elem-table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
|
258
|
+
.elem-table th { background: #F0F4F8; padding: 8px 12px; text-align: left;
|
|
259
|
+
font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
|
|
260
|
+
color: #8899AA; border-bottom: 1px solid #E2E8F0; }
|
|
261
|
+
.elem-table td { padding: 7px 12px; border-bottom: 1px solid #F0F4F8; }
|
|
262
|
+
.elem-table tr:last-child td { border-bottom: none; }
|
|
263
|
+
.elem-table code { background: #F0F4F8; padding: 2px 6px; border-radius: 4px;
|
|
264
|
+
font-size: 12px; color: #0D1B2A; }
|
|
265
|
+
|
|
266
|
+
/* ── Confidence ── */
|
|
267
|
+
.confidence-section { display: flex; gap: 24px; align-items: flex-start; }
|
|
268
|
+
.confidence-meter { flex: 0 0 160px; text-align: center; }
|
|
269
|
+
.confidence-score { font-size: 56px; font-weight: 800; line-height: 1; }
|
|
270
|
+
.confidence-label { font-size: 13px; color: #8899AA; margin: 6px 0 12px; }
|
|
271
|
+
.confidence-bar { height: 8px; background: #E2E8F0; border-radius: 4px; overflow: hidden; }
|
|
272
|
+
.confidence-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
|
|
273
|
+
.confidence-detail { flex: 1; }
|
|
274
|
+
.conf-block { margin-bottom: 20px; }
|
|
275
|
+
.conf-block h4 { font-size: 14px; font-weight: 600; margin-bottom: 8px; color: #0D1B2A; }
|
|
276
|
+
.conf-note { font-size: 13px; color: #667788; margin-top: 8px; }
|
|
277
|
+
.chip-container { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
278
|
+
.id-chip { background: #00B4D822; color: #00B4D8; padding: 3px 8px; border-radius: 4px;
|
|
279
|
+
font-size: 12px; border: 1px solid #00B4D844; }
|
|
280
|
+
.text-chip { background: #06D6A022; color: #06D6A0; padding: 3px 8px; border-radius: 4px;
|
|
281
|
+
font-size: 12px; border: 1px solid #06D6A044; word-break: break-word; }
|
|
282
|
+
|
|
283
|
+
/* ── Misc ── */
|
|
284
|
+
.badge { padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
|
|
285
|
+
.muted { color: #8899AA; font-size: 13px; font-style: italic; }
|
|
286
|
+
|
|
287
|
+
.footer { text-align: center; padding: 24px; color: #8899AA; font-size: 12px; }
|
|
288
|
+
.footer strong { color: #00B4D8; }
|
|
289
|
+
|
|
290
|
+
@media (max-width: 768px) {
|
|
291
|
+
.screen-body { flex-direction: column; }
|
|
292
|
+
.confidence-section { flex-direction: column; }
|
|
293
|
+
.header { flex-direction: column; gap: 16px; }
|
|
294
|
+
}
|
|
295
|
+
</style>
|
|
296
|
+
</head>
|
|
297
|
+
<body>
|
|
298
|
+
|
|
299
|
+
<div class="header">
|
|
300
|
+
<div class="header-brand">
|
|
301
|
+
<div>
|
|
302
|
+
<div class="logo">FlowSpec QA</div>
|
|
303
|
+
<div class="tagline">Discovery Evidence Report</div>
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
<div class="header-meta">
|
|
307
|
+
<strong>${escapeHtml(options.url)}</strong>
|
|
308
|
+
<span>${appLabel}: ${escapeHtml(options.url)}</span><br/>
|
|
309
|
+
<span>Framework: ${framework}</span><br/>
|
|
310
|
+
<span>Generado: ${generatedAt}</span>
|
|
311
|
+
</div>
|
|
312
|
+
</div>
|
|
313
|
+
|
|
314
|
+
<div class="container">
|
|
315
|
+
|
|
316
|
+
<!-- Métricas -->
|
|
317
|
+
<div class="section">
|
|
318
|
+
<h2>📊 Resumen del Discovery</h2>
|
|
319
|
+
${metricsHtml}
|
|
320
|
+
</div>
|
|
321
|
+
|
|
322
|
+
<!-- Mapa de Navegación -->
|
|
323
|
+
<div class="section">
|
|
324
|
+
<h2>🗺️ Mapa de Navegación</h2>
|
|
325
|
+
${navHtml}
|
|
326
|
+
${navStepsHtml}
|
|
327
|
+
</div>
|
|
328
|
+
|
|
329
|
+
<!-- Análisis de Confianza -->
|
|
330
|
+
<div class="section">
|
|
331
|
+
<h2>🎯 Análisis de Confianza</h2>
|
|
332
|
+
${confidenceHtml || '<p class="muted">Sin datos de confianza</p>'}
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
<!-- Pantallas Descubiertas -->
|
|
336
|
+
<div class="section">
|
|
337
|
+
<h2>📱 Pantallas Descubiertas</h2>
|
|
338
|
+
${screensHtml}
|
|
339
|
+
</div>
|
|
340
|
+
|
|
341
|
+
</div>
|
|
342
|
+
|
|
343
|
+
<div class="footer">
|
|
344
|
+
Generado por <strong>FlowSpec QA Runner</strong> — flowspecqa.com
|
|
345
|
+
</div>
|
|
346
|
+
|
|
347
|
+
</body>
|
|
348
|
+
</html>`;
|
|
349
|
+
// Save to disk
|
|
350
|
+
if (!fs.existsSync(options.outputDir)) {
|
|
351
|
+
fs.mkdirSync(options.outputDir, { recursive: true });
|
|
352
|
+
}
|
|
353
|
+
const reportPath = path.join(options.outputDir, 'discovery_report.html');
|
|
354
|
+
fs.writeFileSync(reportPath, html, 'utf8');
|
|
355
|
+
return reportPath;
|
|
356
|
+
}
|
|
357
|
+
//# sourceMappingURL=discovery-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery-report.js","sourceRoot":"","sources":["../src/discovery-report.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AASxB,8EAA8E;AAE9E,SAAS,cAAc,CAAC,EAAU;IAChC,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,GAAG,EAAE,IAAI,CAAC;IAChC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;IAChC,IAAI,CAAC,GAAG,EAAE;QAAE,OAAO,GAAG,CAAC,GAAG,CAAC;IAC3B,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC;AAC7C,CAAC;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC;SACL,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,E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CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;IACzE,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAC3C,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
package/dist/discovery.d.ts
CHANGED
|
@@ -1,3 +1,54 @@
|
|
|
1
|
+
/** Evidence captured for a single screen during Discovery */
|
|
2
|
+
export interface ScreenEvidence {
|
|
3
|
+
name: string;
|
|
4
|
+
isErrorState: boolean;
|
|
5
|
+
/** Base64-encoded PNG screenshot (null if ADB capture failed) */
|
|
6
|
+
screenshot: string | null;
|
|
7
|
+
elements: Array<{
|
|
8
|
+
type: string;
|
|
9
|
+
text: string;
|
|
10
|
+
id: string;
|
|
11
|
+
}>;
|
|
12
|
+
/** ALL visible text strings found in the accessibility hierarchy */
|
|
13
|
+
allTexts: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface DiscoveryNavigationStep {
|
|
16
|
+
from: string;
|
|
17
|
+
to: string;
|
|
18
|
+
action: string;
|
|
19
|
+
}
|
|
20
|
+
export interface DiscoveryMetrics {
|
|
21
|
+
startedAt: number;
|
|
22
|
+
finishedAt: number;
|
|
23
|
+
durationMs: number;
|
|
24
|
+
screensDiscovered: number;
|
|
25
|
+
errorStatesExplored: number;
|
|
26
|
+
elementsFound: number;
|
|
27
|
+
navigationSteps: DiscoveryNavigationStep[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Full evidence package produced by Discovery.
|
|
31
|
+
* Used to generate the HTML evidence report and confidence scoring.
|
|
32
|
+
*/
|
|
33
|
+
export interface DiscoveryEvidence {
|
|
34
|
+
screens: ScreenEvidence[];
|
|
35
|
+
metrics: DiscoveryMetrics;
|
|
36
|
+
/** Texts that were physically observed on-screen in any hierarchy dump */
|
|
37
|
+
verifiedTexts: string[];
|
|
38
|
+
/** Element IDs that were physically observed in any hierarchy dump */
|
|
39
|
+
verifiedIds: string[];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* An element that was found on a screen during Discovery but never explicitly
|
|
43
|
+
* navigated to or interacted with. Used in the interactive loop to ask the
|
|
44
|
+
* user which additional flows to explore.
|
|
45
|
+
*/
|
|
46
|
+
export interface UnexploredElement {
|
|
47
|
+
elementId: string;
|
|
48
|
+
elementText: string;
|
|
49
|
+
sourceScreen: string;
|
|
50
|
+
elementType: string;
|
|
51
|
+
}
|
|
1
52
|
export interface DiscoveryOptions {
|
|
2
53
|
url: string;
|
|
3
54
|
framework: 'playwright' | 'maestro';
|
|
@@ -8,26 +59,91 @@ export interface DiscoveryOptions {
|
|
|
8
59
|
password?: string;
|
|
9
60
|
/** Android device serial (from `flowspecqa devices`). Required when multiple Android devices are connected. */
|
|
10
61
|
deviceId?: string;
|
|
62
|
+
/** Called with progress updates so the CLI can show real-time feedback */
|
|
63
|
+
onProgress?: (step: string, detail?: string) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Optional interactive loop callback (mobile only). Called after the initial
|
|
66
|
+
* discovery pass with the current evidence. Implementations can modify
|
|
67
|
+
* evidence in-place (e.g. by calling discoveryEngine.exploreElement).
|
|
68
|
+
* Return true to signal "continue exploring", false to finish and generate the suite.
|
|
69
|
+
*/
|
|
70
|
+
onInteractiveLoop?: (evidence: DiscoveryEvidence) => Promise<boolean>;
|
|
11
71
|
}
|
|
12
72
|
export interface DiscoveryResult {
|
|
13
73
|
planContent: string;
|
|
14
74
|
rawScanData: any;
|
|
75
|
+
/** Evidence package — present when discovery ran successfully */
|
|
76
|
+
evidence?: DiscoveryEvidence;
|
|
77
|
+
/** Convenience alias for evidence.metrics (kept in sync after interactive loop) */
|
|
78
|
+
metrics?: DiscoveryMetrics;
|
|
15
79
|
}
|
|
16
80
|
/**
|
|
17
81
|
* Autonomous Discovery Engine 2.0
|
|
18
82
|
* Uses Playwright and Maestro to extract real UI intelligence.
|
|
19
83
|
*/
|
|
20
84
|
export declare const discoveryEngine: {
|
|
21
|
-
|
|
85
|
+
_progress(opts: DiscoveryOptions, step: string, detail?: string): void;
|
|
86
|
+
/**
|
|
87
|
+
* Captures a screenshot from the connected Android device via ADB and
|
|
88
|
+
* returns it as a base64-encoded PNG string.
|
|
89
|
+
* Returns null silently if ADB capture fails (non-fatal).
|
|
90
|
+
*/
|
|
91
|
+
_captureScreenshotMobile(adbS: string, tag: string): Promise<string | null>;
|
|
22
92
|
/** Capture maestro hierarchy from current screen and return parsed JSON */
|
|
23
|
-
_captureHierarchy(env?: NodeJS.ProcessEnv): Promise<any>;
|
|
93
|
+
_captureHierarchy(env?: NodeJS.ProcessEnv, deviceId?: string): Promise<any>;
|
|
24
94
|
/** Execute a Maestro YAML flow (written to a temp file) */
|
|
25
95
|
_runMaestroFlow(appId: string, steps: string[], env?: NodeJS.ProcessEnv): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Extracts ALL visible text strings from a Maestro hierarchy JSON.
|
|
98
|
+
* Used for confidence scoring — any text returned here is "verified" (actually on screen).
|
|
99
|
+
*/
|
|
100
|
+
extractAllTexts(node: any): string[];
|
|
101
|
+
run(options: DiscoveryOptions): Promise<DiscoveryResult>;
|
|
26
102
|
discoverMobile(options: DiscoveryOptions): Promise<DiscoveryResult>;
|
|
27
103
|
handleLogin(page: any, username: string, password: string): Promise<boolean>;
|
|
28
104
|
discoverWeb(options: DiscoveryOptions): Promise<DiscoveryResult>;
|
|
29
105
|
/** Fallback DOM-based plan (no Vision AI) */
|
|
30
106
|
_buildDomPlan(title: string, url: string, elements: any[]): string;
|
|
107
|
+
/**
|
|
108
|
+
* Inspect the current evidence and return elements that were seen on screen
|
|
109
|
+
* but never explicitly interacted with during Discovery.
|
|
110
|
+
* These become the candidates for the interactive exploration loop.
|
|
111
|
+
*/
|
|
112
|
+
detectUnexplored(evidence: DiscoveryEvidence): UnexploredElement[];
|
|
113
|
+
/**
|
|
114
|
+
* Convert a navigation step action string into the Maestro YAML steps
|
|
115
|
+
* needed to perform that action.
|
|
116
|
+
*/
|
|
117
|
+
_getActionYaml(action: string, creds: {
|
|
118
|
+
username: string;
|
|
119
|
+
password: string;
|
|
120
|
+
}): string[];
|
|
121
|
+
/**
|
|
122
|
+
* BFS the navigation graph to build and execute the Maestro flow that
|
|
123
|
+
* navigates from the app's initial state to `targetScreen`.
|
|
124
|
+
* Returns true if navigation succeeded, false otherwise.
|
|
125
|
+
*/
|
|
126
|
+
_navigateToScreen(targetScreen: string, evidence: DiscoveryEvidence, creds: {
|
|
127
|
+
username: string;
|
|
128
|
+
password: string;
|
|
129
|
+
}, appId: string, maestroEnv: NodeJS.ProcessEnv): Promise<boolean>;
|
|
130
|
+
/**
|
|
131
|
+
* Explore a single previously-unexplored element:
|
|
132
|
+
* 1. Navigate to its source screen
|
|
133
|
+
* 2. Tap the element
|
|
134
|
+
* 3. Capture hierarchy + screenshot of the resulting state
|
|
135
|
+
* 4. Attempt to trigger an error state on the new screen
|
|
136
|
+
* 5. Push findings into `evidence` in-place
|
|
137
|
+
*
|
|
138
|
+
* Returns the new ScreenEvidence entries that were added.
|
|
139
|
+
*/
|
|
140
|
+
exploreElement(element: UnexploredElement, options: DiscoveryOptions, evidence: DiscoveryEvidence): Promise<ScreenEvidence[]>;
|
|
141
|
+
/**
|
|
142
|
+
* Build the full discovery plan markdown from an evidence package.
|
|
143
|
+
* Called after each interactive exploration round to keep the plan current.
|
|
144
|
+
* Also used by discoverMobile() for the initial plan generation.
|
|
145
|
+
*/
|
|
146
|
+
buildPlanFromEvidence(evidence: DiscoveryEvidence, appId: string): string;
|
|
31
147
|
extractMaestroSelectors(node: any): any[];
|
|
32
148
|
};
|
|
33
149
|
//# sourceMappingURL=discovery.d.ts.map
|
package/dist/discovery.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAiCA,6DAA6D;AAC7D,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;IACtB,iEAAiE;IACjE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5D,oEAAoE;IACpE,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,uBAAuB,EAAE,CAAC;CAC5C;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,0EAA0E;IAC1E,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,sEAAsE;IACtE,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;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