@arcadialdev/arcality 3.0.0 β 3.0.2
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/package.json +2 -1
- package/public/ArcalityImagen.png +0 -0
- package/public/logo-arcadial-blanco.png +0 -0
- package/public/logo.png +0 -0
- package/scripts/gen-and-run.mjs +950 -176
- package/scripts/init.mjs +221 -178
- package/scripts/rebrand-report.mjs +16 -2
- package/tests/_helpers/ArcalityReporter.js +1237 -712
- package/tests/_helpers/agentic-runner.bundle.spec.js +285 -52
|
@@ -1,712 +1,1237 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const fs_1 = __importDefault(require("fs"));
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
class ArcalityReporter {
|
|
9
|
-
constructor(options = {}) {
|
|
10
|
-
this.results = [];
|
|
11
|
-
this.totalDuration = 0;
|
|
12
|
-
this.startTime = new Date();
|
|
13
|
-
this.outputDir = options.outputDir || 'arcality-report';
|
|
14
|
-
}
|
|
15
|
-
onBegin(config, suite) {
|
|
16
|
-
// Clean output directory to avoid stale reports/attachments
|
|
17
|
-
if (fs_1.default.existsSync(this.outputDir)) {
|
|
18
|
-
try {
|
|
19
|
-
fs_1.default.rmSync(this.outputDir, { recursive: true, force: true });
|
|
20
|
-
console.log(
|
|
21
|
-
}
|
|
22
|
-
catch (err) {
|
|
23
|
-
console.warn(
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (!fs_1.default.existsSync(this.outputDir)) {
|
|
27
|
-
fs_1.default.mkdirSync(this.outputDir, { recursive: true });
|
|
28
|
-
}
|
|
29
|
-
this.startTime = new Date();
|
|
30
|
-
console.log(
|
|
31
|
-
}
|
|
32
|
-
onTestEnd(test, result) {
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (att.contentType === '
|
|
39
|
-
extension = '.
|
|
40
|
-
else if (att.contentType === 'text/
|
|
41
|
-
extension = '.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
fs_1.default.
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
return
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
this.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
.
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
.
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
border
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
.
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
}
|
|
303
|
-
.
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
.
|
|
310
|
-
width: 100
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
.
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}
|
|
371
|
-
.
|
|
372
|
-
background:
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
font-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
color:
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
}
|
|
392
|
-
.
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
.
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
}
|
|
423
|
-
.
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
class ArcalityReporter {
|
|
9
|
+
constructor(options = {}) {
|
|
10
|
+
this.results = [];
|
|
11
|
+
this.totalDuration = 0;
|
|
12
|
+
this.startTime = new Date();
|
|
13
|
+
this.outputDir = options.outputDir || 'arcality-report';
|
|
14
|
+
}
|
|
15
|
+
onBegin(config, suite) {
|
|
16
|
+
// Clean output directory to avoid stale reports/attachments.
|
|
17
|
+
if (fs_1.default.existsSync(this.outputDir)) {
|
|
18
|
+
try {
|
|
19
|
+
fs_1.default.rmSync(this.outputDir, { recursive: true, force: true });
|
|
20
|
+
console.log(`Cleaned old report data at: ${this.outputDir}`);
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
console.warn(`Could not fully clean report dir: ${err.message}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (!fs_1.default.existsSync(this.outputDir)) {
|
|
27
|
+
fs_1.default.mkdirSync(this.outputDir, { recursive: true });
|
|
28
|
+
}
|
|
29
|
+
this.startTime = new Date();
|
|
30
|
+
console.log(`Arcality Mission started at ${this.startTime.toLocaleTimeString()}`);
|
|
31
|
+
}
|
|
32
|
+
onTestEnd(test, result) {
|
|
33
|
+
const stepsHtml = result.steps.map(step => this.renderStep(step, 0)).join('');
|
|
34
|
+
const processedAttachments = result.attachments.map(att => {
|
|
35
|
+
let extension = '.png';
|
|
36
|
+
if (att.contentType === 'application/json')
|
|
37
|
+
extension = '.json';
|
|
38
|
+
else if (att.contentType === 'text/plain')
|
|
39
|
+
extension = '.txt';
|
|
40
|
+
else if (att.contentType === 'text/yaml')
|
|
41
|
+
extension = '.yaml';
|
|
42
|
+
const fileName = att.path ? path_1.default.basename(att.path) : `${att.name || 'attachment'}-${Date.now()}${extension}`;
|
|
43
|
+
const attachmentsDir = path_1.default.join(this.outputDir, 'attachments');
|
|
44
|
+
const destPath = path_1.default.join(attachmentsDir, fileName);
|
|
45
|
+
if (!fs_1.default.existsSync(attachmentsDir)) {
|
|
46
|
+
fs_1.default.mkdirSync(attachmentsDir, { recursive: true });
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
if (att.path && fs_1.default.existsSync(att.path)) {
|
|
50
|
+
fs_1.default.copyFileSync(att.path, destPath);
|
|
51
|
+
}
|
|
52
|
+
else if (att.body) {
|
|
53
|
+
fs_1.default.writeFileSync(destPath, att.body);
|
|
54
|
+
}
|
|
55
|
+
return { ...att, path: `attachments/${fileName}` };
|
|
56
|
+
}
|
|
57
|
+
catch (e) {
|
|
58
|
+
console.error(`Failed to process attachment ${att.name}:`, e);
|
|
59
|
+
return att;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
if (result.status === 'failed' || result.error) {
|
|
63
|
+
const isAppBug = result.error?.message?.includes('APPLICATION BUG');
|
|
64
|
+
const prefix = isAppBug ? '[APPLICATION BUG FOUND]' : '[TEST ENGINE FAILURE]';
|
|
65
|
+
console.log(`\n${prefix} ${test.title} failed:`);
|
|
66
|
+
console.log(`${result.error?.message || result.error?.stack || 'Unknown error'}\n`);
|
|
67
|
+
if (result.error?.stack && !isAppBug) {
|
|
68
|
+
console.log(result.error.stack);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
this.results.push({ test, result, stepsHtml, attachments: processedAttachments });
|
|
72
|
+
}
|
|
73
|
+
async onEnd(result) {
|
|
74
|
+
this.totalDuration = result.duration;
|
|
75
|
+
const htmlContent = this.generateHtml();
|
|
76
|
+
const reportPath = path_1.default.join(this.outputDir, 'index.html');
|
|
77
|
+
fs_1.default.writeFileSync(reportPath, htmlContent);
|
|
78
|
+
console.log(`Arcality Mission Report generated at: ${reportPath}`);
|
|
79
|
+
}
|
|
80
|
+
renderStep(step, depth) {
|
|
81
|
+
if (step.category === 'hook' || step.category === 'fixture')
|
|
82
|
+
return '';
|
|
83
|
+
const statusClass = step.error ? 'step-error' : 'step-passed';
|
|
84
|
+
const duration = step.duration >= 0 ? `<span class="step-duration">${this.formatDuration(step.duration)}</span>` : '';
|
|
85
|
+
let title = this.escapeHtml(step.title);
|
|
86
|
+
title = title.replace(/^(click|fill|navigate|wait|expect|goto|press)/i, '<span class="step-action">$1</span>');
|
|
87
|
+
const children = step.steps && step.steps.length > 0
|
|
88
|
+
? `<div class="step-children">${step.steps.map(s => this.renderStep(s, depth + 1)).join('')}</div>`
|
|
89
|
+
: '';
|
|
90
|
+
const expandableAttr = step.steps && step.steps.length > 0 ? 'data-expandable="true"' : '';
|
|
91
|
+
return `
|
|
92
|
+
<div class="step-wrapper ${statusClass}" style="--step-depth: ${Math.min(depth, 8)}" ${expandableAttr}>
|
|
93
|
+
<div class="step-header">
|
|
94
|
+
<span class="step-marker" aria-hidden="true"></span>
|
|
95
|
+
<span class="step-title">${title}</span>
|
|
96
|
+
${duration}
|
|
97
|
+
</div>
|
|
98
|
+
${children}
|
|
99
|
+
</div>
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
formatDuration(milliseconds) {
|
|
103
|
+
if (milliseconds >= 1000) {
|
|
104
|
+
const seconds = milliseconds / 1000;
|
|
105
|
+
return `${seconds >= 10 ? seconds.toFixed(0) : seconds.toFixed(1)}s`;
|
|
106
|
+
}
|
|
107
|
+
return `${Math.max(0, Math.round(milliseconds))}ms`;
|
|
108
|
+
}
|
|
109
|
+
getStatusLabel(status) {
|
|
110
|
+
switch (status) {
|
|
111
|
+
case 'passed': return 'Exitosa';
|
|
112
|
+
case 'failed': return 'Error';
|
|
113
|
+
case 'timedOut': return 'Tiempo agotado';
|
|
114
|
+
case 'skipped': return 'Omitida';
|
|
115
|
+
case 'interrupted': return 'Interrumpida';
|
|
116
|
+
default: return status;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
getStatusTone(status) {
|
|
120
|
+
if (status === 'failed' || status === 'timedOut' || status === 'interrupted')
|
|
121
|
+
return 'failed';
|
|
122
|
+
if (status === 'passed')
|
|
123
|
+
return 'passed';
|
|
124
|
+
return 'neutral';
|
|
125
|
+
}
|
|
126
|
+
getEngineVersion() {
|
|
127
|
+
try {
|
|
128
|
+
const packageJsonPath = path_1.default.join(process.cwd(), 'package.json');
|
|
129
|
+
if (fs_1.default.existsSync(packageJsonPath)) {
|
|
130
|
+
const pkg = JSON.parse(fs_1.default.readFileSync(packageJsonPath, 'utf8'));
|
|
131
|
+
return pkg.version || '2.2.0';
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
catch (e) {
|
|
135
|
+
console.error('Error reading package.json version:', e);
|
|
136
|
+
}
|
|
137
|
+
return '2.2.0';
|
|
138
|
+
}
|
|
139
|
+
getBrandLogoDataUri() {
|
|
140
|
+
const roots = [
|
|
141
|
+
process.env.ARCALITY_ROOT,
|
|
142
|
+
path_1.default.resolve(__dirname, '..', '..'),
|
|
143
|
+
process.cwd()
|
|
144
|
+
].filter(Boolean);
|
|
145
|
+
const logoNames = ['logo.png', 'logo-arcadial-blanco.png'];
|
|
146
|
+
for (const root of roots) {
|
|
147
|
+
for (const logoName of logoNames) {
|
|
148
|
+
const logoPath = path_1.default.join(root, 'public', logoName);
|
|
149
|
+
if (!fs_1.default.existsSync(logoPath))
|
|
150
|
+
continue;
|
|
151
|
+
try {
|
|
152
|
+
const logoBuffer = fs_1.default.readFileSync(logoPath);
|
|
153
|
+
return `data:image/png;base64,${logoBuffer.toString('base64')}`;
|
|
154
|
+
}
|
|
155
|
+
catch (e) {
|
|
156
|
+
console.warn(`Could not load Arcality logo from ${logoPath}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
generateHtml() {
|
|
163
|
+
const stats = {
|
|
164
|
+
total: this.results.length,
|
|
165
|
+
passed: this.results.filter(r => r.result.status === 'passed').length,
|
|
166
|
+
failed: this.results.filter(r => r.result.status === 'failed' || r.result.status === 'timedOut').length,
|
|
167
|
+
skipped: this.results.filter(r => r.result.status === 'skipped').length,
|
|
168
|
+
flaky: this.results.filter(r => r.result.status === 'passed' && r.result.retry > 0).length
|
|
169
|
+
};
|
|
170
|
+
const evidenceCount = this.results.reduce((count, r) => {
|
|
171
|
+
return count + r.attachments.filter(att => att.path && (att.contentType.startsWith('image/') || att.contentType.startsWith('video/'))).length;
|
|
172
|
+
}, 0);
|
|
173
|
+
const reportTone = stats.failed > 0 ? 'failed' : stats.total === 0 ? 'neutral' : 'passed';
|
|
174
|
+
const reportStatus = stats.failed > 0 ? 'Ejecucion con errores' : stats.total === 0 ? 'Sin ejecuciones' : 'Ejecucion exitosa';
|
|
175
|
+
const reportSummary = stats.failed > 0
|
|
176
|
+
? `${stats.failed} mision${stats.failed === 1 ? '' : 'es'} fallida${stats.failed === 1 ? '' : 's'}. Revisa el diagnostico y la evidencia visual.`
|
|
177
|
+
: stats.total === 0
|
|
178
|
+
? 'No se registraron misiones en esta ejecucion.'
|
|
179
|
+
: 'Todas las misiones ejecutadas finalizaron correctamente.';
|
|
180
|
+
const generatedAt = new Date();
|
|
181
|
+
const reportTitle = stats.total > 1 ? 'Reporte de coleccion' : 'Reporte de ejecucion';
|
|
182
|
+
const brandLogo = this.getBrandLogoDataUri();
|
|
183
|
+
return `
|
|
184
|
+
<!DOCTYPE html>
|
|
185
|
+
<html lang="es">
|
|
186
|
+
<head>
|
|
187
|
+
<meta charset="UTF-8">
|
|
188
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
189
|
+
<title>Arcality Mission Report</title>
|
|
190
|
+
<link rel="shortcut icon" href="https://raw.githubusercontent.com/microsoft/playwright/main/packages/playwright-core/src/server/chromium/test-results/favicon.ico">
|
|
191
|
+
<style>
|
|
192
|
+
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');
|
|
193
|
+
|
|
194
|
+
:root {
|
|
195
|
+
--bg: #07080d;
|
|
196
|
+
--surface: #10131b;
|
|
197
|
+
--surface-soft: #151925;
|
|
198
|
+
--line: #293042;
|
|
199
|
+
--line-soft: rgba(255,255,255,0.08);
|
|
200
|
+
--text: #f7f4ff;
|
|
201
|
+
--muted: #a9afc0;
|
|
202
|
+
--faint: #72798c;
|
|
203
|
+
--brand: #b56cff;
|
|
204
|
+
--brand-soft: rgba(181, 108, 255, 0.16);
|
|
205
|
+
--blue: #6bbcff;
|
|
206
|
+
--success: #39d99f;
|
|
207
|
+
--success-soft: rgba(57, 217, 159, 0.12);
|
|
208
|
+
--error: #ff5f7a;
|
|
209
|
+
--error-soft: rgba(255, 95, 122, 0.12);
|
|
210
|
+
--warning: #ffc857;
|
|
211
|
+
--warning-soft: rgba(255, 200, 87, 0.12);
|
|
212
|
+
--shadow: 0 18px 60px rgba(0,0,0,0.28);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
* { box-sizing: border-box; }
|
|
216
|
+
html { background: var(--bg); }
|
|
217
|
+
body {
|
|
218
|
+
font-family: 'Plus Jakarta Sans', sans-serif;
|
|
219
|
+
background: linear-gradient(180deg, #080910 0%, #10121a 44%, #07080d 100%);
|
|
220
|
+
color: var(--text);
|
|
221
|
+
margin: 0;
|
|
222
|
+
min-height: 100vh;
|
|
223
|
+
line-height: 1.55;
|
|
224
|
+
}
|
|
225
|
+
body::before {
|
|
226
|
+
content: "";
|
|
227
|
+
position: fixed;
|
|
228
|
+
inset: 0;
|
|
229
|
+
pointer-events: none;
|
|
230
|
+
background-image:
|
|
231
|
+
linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
|
|
232
|
+
linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
|
|
233
|
+
background-size: 52px 52px;
|
|
234
|
+
mask-image: linear-gradient(to bottom, rgba(0,0,0,0.75), transparent 68%);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
button, a { font: inherit; }
|
|
238
|
+
a { color: inherit; }
|
|
239
|
+
.container {
|
|
240
|
+
position: relative;
|
|
241
|
+
max-width: 1480px;
|
|
242
|
+
margin: 0 auto;
|
|
243
|
+
padding: 32px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.mission-brief {
|
|
247
|
+
display: grid;
|
|
248
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
249
|
+
gap: 28px;
|
|
250
|
+
align-items: start;
|
|
251
|
+
padding: 6px 0 28px;
|
|
252
|
+
border-bottom: 1px solid var(--line);
|
|
253
|
+
margin-bottom: 22px;
|
|
254
|
+
}
|
|
255
|
+
.brand-row {
|
|
256
|
+
display: flex;
|
|
257
|
+
align-items: center;
|
|
258
|
+
gap: 14px;
|
|
259
|
+
margin-bottom: 26px;
|
|
260
|
+
}
|
|
261
|
+
.brand-mark {
|
|
262
|
+
width: 38px;
|
|
263
|
+
height: 38px;
|
|
264
|
+
border: 1px solid rgba(181,108,255,0.45);
|
|
265
|
+
border-radius: 8px;
|
|
266
|
+
background: linear-gradient(135deg, rgba(181,108,255,0.92), rgba(107,188,255,0.62)), #141720;
|
|
267
|
+
box-shadow: 0 0 28px rgba(181,108,255,0.22);
|
|
268
|
+
}
|
|
269
|
+
.brand-mark.has-logo {
|
|
270
|
+
width: 42px;
|
|
271
|
+
height: 42px;
|
|
272
|
+
padding: 5px;
|
|
273
|
+
background: rgba(255,255,255,0.035);
|
|
274
|
+
box-shadow: 0 0 24px rgba(181,108,255,0.12);
|
|
275
|
+
}
|
|
276
|
+
.brand-mark img {
|
|
277
|
+
display: block;
|
|
278
|
+
width: 100%;
|
|
279
|
+
height: 100%;
|
|
280
|
+
object-fit: contain;
|
|
281
|
+
filter: drop-shadow(0 0 10px rgba(181,108,255,0.28));
|
|
282
|
+
}
|
|
283
|
+
.brand-name {
|
|
284
|
+
font-size: 0.74rem;
|
|
285
|
+
color: var(--muted);
|
|
286
|
+
letter-spacing: 0.16em;
|
|
287
|
+
text-transform: uppercase;
|
|
288
|
+
font-weight: 800;
|
|
289
|
+
}
|
|
290
|
+
.brand-subtitle {
|
|
291
|
+
color: var(--faint);
|
|
292
|
+
font-size: 0.86rem;
|
|
293
|
+
margin-top: 1px;
|
|
294
|
+
}
|
|
295
|
+
.mission-title {
|
|
296
|
+
font-size: clamp(2rem, 4vw, 4.6rem);
|
|
297
|
+
line-height: 0.96;
|
|
298
|
+
letter-spacing: 0;
|
|
299
|
+
max-width: 900px;
|
|
300
|
+
margin: 0;
|
|
301
|
+
font-weight: 800;
|
|
302
|
+
}
|
|
303
|
+
.mission-copy {
|
|
304
|
+
margin: 18px 0 0;
|
|
305
|
+
max-width: 720px;
|
|
306
|
+
color: var(--muted);
|
|
307
|
+
font-size: 1rem;
|
|
308
|
+
}
|
|
309
|
+
.status-card {
|
|
310
|
+
width: min(380px, 100%);
|
|
311
|
+
border: 1px solid var(--line);
|
|
312
|
+
background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018));
|
|
313
|
+
border-radius: 8px;
|
|
314
|
+
padding: 18px;
|
|
315
|
+
box-shadow: var(--shadow);
|
|
316
|
+
}
|
|
317
|
+
.status-card.passed { border-color: rgba(57,217,159,0.42); }
|
|
318
|
+
.status-card.failed { border-color: rgba(255,95,122,0.48); }
|
|
319
|
+
.status-card.neutral { border-color: rgba(169,175,192,0.28); }
|
|
320
|
+
.status-eyebrow {
|
|
321
|
+
display: flex;
|
|
322
|
+
align-items: center;
|
|
323
|
+
justify-content: space-between;
|
|
324
|
+
gap: 16px;
|
|
325
|
+
color: var(--faint);
|
|
326
|
+
font-size: 0.72rem;
|
|
327
|
+
font-family: 'JetBrains Mono', monospace;
|
|
328
|
+
letter-spacing: 0.08em;
|
|
329
|
+
text-transform: uppercase;
|
|
330
|
+
}
|
|
331
|
+
.status-pill {
|
|
332
|
+
display: inline-flex;
|
|
333
|
+
align-items: center;
|
|
334
|
+
gap: 7px;
|
|
335
|
+
border: 1px solid var(--line-soft);
|
|
336
|
+
border-radius: 999px;
|
|
337
|
+
padding: 5px 9px;
|
|
338
|
+
color: var(--text);
|
|
339
|
+
background: rgba(255,255,255,0.04);
|
|
340
|
+
}
|
|
341
|
+
.status-pill::before {
|
|
342
|
+
content: "";
|
|
343
|
+
width: 7px;
|
|
344
|
+
height: 7px;
|
|
345
|
+
border-radius: 50%;
|
|
346
|
+
background: var(--faint);
|
|
347
|
+
}
|
|
348
|
+
.status-card.passed .status-pill::before { background: var(--success); }
|
|
349
|
+
.status-card.failed .status-pill::before { background: var(--error); }
|
|
350
|
+
.status-title {
|
|
351
|
+
font-size: 1.7rem;
|
|
352
|
+
line-height: 1.05;
|
|
353
|
+
margin: 24px 0 10px;
|
|
354
|
+
font-weight: 800;
|
|
355
|
+
}
|
|
356
|
+
.status-summary {
|
|
357
|
+
color: var(--muted);
|
|
358
|
+
margin: 0;
|
|
359
|
+
font-size: 0.95rem;
|
|
360
|
+
}
|
|
361
|
+
.brief-grid {
|
|
362
|
+
display: grid;
|
|
363
|
+
grid-template-columns: repeat(6, minmax(120px, 1fr));
|
|
364
|
+
gap: 1px;
|
|
365
|
+
background: var(--line);
|
|
366
|
+
border: 1px solid var(--line);
|
|
367
|
+
border-radius: 8px;
|
|
368
|
+
overflow: hidden;
|
|
369
|
+
margin-bottom: 18px;
|
|
370
|
+
}
|
|
371
|
+
.brief-metric {
|
|
372
|
+
background: rgba(16,19,27,0.94);
|
|
373
|
+
padding: 16px 18px;
|
|
374
|
+
min-height: 92px;
|
|
375
|
+
}
|
|
376
|
+
.metric-value {
|
|
377
|
+
display: block;
|
|
378
|
+
font-size: 1.7rem;
|
|
379
|
+
line-height: 1;
|
|
380
|
+
font-weight: 800;
|
|
381
|
+
}
|
|
382
|
+
.metric-label {
|
|
383
|
+
display: block;
|
|
384
|
+
margin-top: 10px;
|
|
385
|
+
color: var(--faint);
|
|
386
|
+
font-size: 0.72rem;
|
|
387
|
+
letter-spacing: 0.1em;
|
|
388
|
+
text-transform: uppercase;
|
|
389
|
+
font-weight: 800;
|
|
390
|
+
}
|
|
391
|
+
.val-passed { color: var(--success); }
|
|
392
|
+
.val-failed { color: var(--error); }
|
|
393
|
+
.val-flaky { color: var(--warning); }
|
|
394
|
+
.val-blue { color: var(--blue); }
|
|
395
|
+
|
|
396
|
+
.test-entry {
|
|
397
|
+
border-top: 1px solid var(--line);
|
|
398
|
+
}
|
|
399
|
+
.test-entry:last-child {
|
|
400
|
+
border-bottom: 1px solid var(--line);
|
|
401
|
+
}
|
|
402
|
+
.test-header {
|
|
403
|
+
width: 100%;
|
|
404
|
+
appearance: none;
|
|
405
|
+
border: 0;
|
|
406
|
+
color: var(--text);
|
|
407
|
+
background: transparent;
|
|
408
|
+
padding: 22px 0;
|
|
409
|
+
display: flex;
|
|
410
|
+
justify-content: space-between;
|
|
411
|
+
align-items: center;
|
|
412
|
+
gap: 24px;
|
|
413
|
+
text-align: left;
|
|
414
|
+
cursor: pointer;
|
|
415
|
+
}
|
|
416
|
+
.test-header:hover .test-name { color: var(--brand); }
|
|
417
|
+
.test-info {
|
|
418
|
+
min-width: 0;
|
|
419
|
+
display: flex;
|
|
420
|
+
align-items: center;
|
|
421
|
+
gap: 14px;
|
|
422
|
+
}
|
|
423
|
+
.status-dot {
|
|
424
|
+
width: 11px;
|
|
425
|
+
height: 44px;
|
|
426
|
+
border-radius: 999px;
|
|
427
|
+
background: var(--faint);
|
|
428
|
+
flex: 0 0 auto;
|
|
429
|
+
}
|
|
430
|
+
.status-passed .status-dot { background: var(--success); }
|
|
431
|
+
.status-failed .status-dot { background: var(--error); }
|
|
432
|
+
.status-neutral .status-dot { background: var(--faint); }
|
|
433
|
+
.test-name {
|
|
434
|
+
font-weight: 800;
|
|
435
|
+
font-size: 1.08rem;
|
|
436
|
+
line-height: 1.25;
|
|
437
|
+
transition: color 0.16s ease;
|
|
438
|
+
}
|
|
439
|
+
.test-meta {
|
|
440
|
+
display: flex;
|
|
441
|
+
flex-wrap: wrap;
|
|
442
|
+
gap: 8px;
|
|
443
|
+
margin-top: 8px;
|
|
444
|
+
color: var(--muted);
|
|
445
|
+
font-size: 0.78rem;
|
|
446
|
+
font-family: 'JetBrains Mono', monospace;
|
|
447
|
+
}
|
|
448
|
+
.test-chevron {
|
|
449
|
+
width: 32px;
|
|
450
|
+
height: 32px;
|
|
451
|
+
border: 1px solid var(--line);
|
|
452
|
+
border-radius: 8px;
|
|
453
|
+
display: inline-grid;
|
|
454
|
+
place-items: center;
|
|
455
|
+
color: var(--muted);
|
|
456
|
+
flex: 0 0 auto;
|
|
457
|
+
transition: transform 0.16s ease, border-color 0.16s ease;
|
|
458
|
+
}
|
|
459
|
+
.test-header[aria-expanded="true"] .test-chevron {
|
|
460
|
+
transform: rotate(180deg);
|
|
461
|
+
border-color: rgba(181,108,255,0.48);
|
|
462
|
+
color: var(--text);
|
|
463
|
+
}
|
|
464
|
+
.test-details {
|
|
465
|
+
padding: 0 0 28px;
|
|
466
|
+
}
|
|
467
|
+
.test-details-grid {
|
|
468
|
+
display: grid;
|
|
469
|
+
grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
|
|
470
|
+
gap: 24px;
|
|
471
|
+
align-items: start;
|
|
472
|
+
}
|
|
473
|
+
.primary-column,
|
|
474
|
+
.context-column {
|
|
475
|
+
min-width: 0;
|
|
476
|
+
}
|
|
477
|
+
.context-column {
|
|
478
|
+
display: flex;
|
|
479
|
+
flex-direction: column;
|
|
480
|
+
gap: 14px;
|
|
481
|
+
}
|
|
482
|
+
.outcome-block,
|
|
483
|
+
.side-panel,
|
|
484
|
+
.timeline-wrap {
|
|
485
|
+
border: 1px solid var(--line);
|
|
486
|
+
border-radius: 8px;
|
|
487
|
+
background: rgba(16,19,27,0.78);
|
|
488
|
+
}
|
|
489
|
+
.outcome-block {
|
|
490
|
+
padding: 18px;
|
|
491
|
+
margin-bottom: 18px;
|
|
492
|
+
}
|
|
493
|
+
.outcome-block.success {
|
|
494
|
+
border-color: rgba(57,217,159,0.36);
|
|
495
|
+
background: var(--success-soft);
|
|
496
|
+
}
|
|
497
|
+
.outcome-block.error {
|
|
498
|
+
border-color: rgba(255,95,122,0.4);
|
|
499
|
+
background: var(--error-soft);
|
|
500
|
+
}
|
|
501
|
+
.outcome-label {
|
|
502
|
+
display: block;
|
|
503
|
+
color: var(--faint);
|
|
504
|
+
font-size: 0.72rem;
|
|
505
|
+
letter-spacing: 0.12em;
|
|
506
|
+
text-transform: uppercase;
|
|
507
|
+
font-weight: 800;
|
|
508
|
+
margin-bottom: 8px;
|
|
509
|
+
}
|
|
510
|
+
.success-block {
|
|
511
|
+
margin: 0;
|
|
512
|
+
color: #bff7df;
|
|
513
|
+
font-size: 1rem;
|
|
514
|
+
font-weight: 700;
|
|
515
|
+
}
|
|
516
|
+
.error-block {
|
|
517
|
+
font-family: 'JetBrains Mono', monospace;
|
|
518
|
+
font-size: 0.86rem;
|
|
519
|
+
color: #ffd0d8;
|
|
520
|
+
white-space: pre-wrap;
|
|
521
|
+
margin: 0;
|
|
522
|
+
}
|
|
523
|
+
.panel-header {
|
|
524
|
+
display: flex;
|
|
525
|
+
justify-content: space-between;
|
|
526
|
+
align-items: center;
|
|
527
|
+
gap: 12px;
|
|
528
|
+
padding: 14px 16px;
|
|
529
|
+
border-bottom: 1px solid var(--line-soft);
|
|
530
|
+
}
|
|
531
|
+
.panel-title {
|
|
532
|
+
color: var(--text);
|
|
533
|
+
font-size: 0.8rem;
|
|
534
|
+
letter-spacing: 0.1em;
|
|
535
|
+
text-transform: uppercase;
|
|
536
|
+
font-weight: 800;
|
|
537
|
+
}
|
|
538
|
+
.panel-kicker {
|
|
539
|
+
color: var(--faint);
|
|
540
|
+
font-size: 0.72rem;
|
|
541
|
+
font-family: 'JetBrains Mono', monospace;
|
|
542
|
+
text-transform: uppercase;
|
|
543
|
+
}
|
|
544
|
+
.panel-body {
|
|
545
|
+
padding: 16px;
|
|
546
|
+
}
|
|
547
|
+
.info-block {
|
|
548
|
+
font-family: 'JetBrains Mono', monospace;
|
|
549
|
+
font-size: 0.8rem;
|
|
550
|
+
color: #d7dcff;
|
|
551
|
+
white-space: pre-wrap;
|
|
552
|
+
margin: 0;
|
|
553
|
+
}
|
|
554
|
+
.metadata-list {
|
|
555
|
+
display: grid;
|
|
556
|
+
gap: 12px;
|
|
557
|
+
margin: 0;
|
|
558
|
+
}
|
|
559
|
+
.metadata-row {
|
|
560
|
+
display: flex;
|
|
561
|
+
justify-content: space-between;
|
|
562
|
+
gap: 16px;
|
|
563
|
+
border-bottom: 1px solid var(--line-soft);
|
|
564
|
+
padding-bottom: 10px;
|
|
565
|
+
}
|
|
566
|
+
.metadata-row:last-child {
|
|
567
|
+
border-bottom: 0;
|
|
568
|
+
padding-bottom: 0;
|
|
569
|
+
}
|
|
570
|
+
.metadata-row dt {
|
|
571
|
+
color: var(--faint);
|
|
572
|
+
margin: 0;
|
|
573
|
+
font-size: 0.74rem;
|
|
574
|
+
text-transform: uppercase;
|
|
575
|
+
letter-spacing: 0.08em;
|
|
576
|
+
font-weight: 800;
|
|
577
|
+
}
|
|
578
|
+
.metadata-row dd {
|
|
579
|
+
margin: 0;
|
|
580
|
+
color: var(--text);
|
|
581
|
+
font-family: 'JetBrains Mono', monospace;
|
|
582
|
+
font-size: 0.8rem;
|
|
583
|
+
text-align: right;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.steps-section { margin-top: 0; }
|
|
587
|
+
.section-title {
|
|
588
|
+
display: block;
|
|
589
|
+
padding: 15px 18px;
|
|
590
|
+
border-bottom: 1px solid var(--line-soft);
|
|
591
|
+
color: var(--muted);
|
|
592
|
+
font-size: 0.76rem;
|
|
593
|
+
text-transform: uppercase;
|
|
594
|
+
letter-spacing: 0.12em;
|
|
595
|
+
font-weight: 800;
|
|
596
|
+
}
|
|
597
|
+
.timeline-wrap {
|
|
598
|
+
overflow: hidden;
|
|
599
|
+
}
|
|
600
|
+
.steps-container {
|
|
601
|
+
padding: 12px 0;
|
|
602
|
+
}
|
|
603
|
+
.step-wrapper {
|
|
604
|
+
margin-left: calc(var(--step-depth) * 18px);
|
|
605
|
+
padding: 7px 18px 7px 20px;
|
|
606
|
+
position: relative;
|
|
607
|
+
}
|
|
608
|
+
.step-wrapper::before {
|
|
609
|
+
content: "";
|
|
610
|
+
position: absolute;
|
|
611
|
+
left: 5px;
|
|
612
|
+
top: 0;
|
|
613
|
+
bottom: 0;
|
|
614
|
+
width: 1px;
|
|
615
|
+
background: var(--line-soft);
|
|
616
|
+
}
|
|
617
|
+
.step-header {
|
|
618
|
+
display: grid;
|
|
619
|
+
grid-template-columns: 14px minmax(0, 1fr) auto;
|
|
620
|
+
align-items: start;
|
|
621
|
+
gap: 10px;
|
|
622
|
+
font-size: 0.9rem;
|
|
623
|
+
}
|
|
624
|
+
.step-marker {
|
|
625
|
+
width: 8px;
|
|
626
|
+
height: 8px;
|
|
627
|
+
border-radius: 50%;
|
|
628
|
+
background: var(--success);
|
|
629
|
+
margin-top: 7px;
|
|
630
|
+
box-shadow: 0 0 0 4px rgba(57,217,159,0.08);
|
|
631
|
+
}
|
|
632
|
+
.step-title {
|
|
633
|
+
color: #e6e9f5;
|
|
634
|
+
min-width: 0;
|
|
635
|
+
overflow-wrap: anywhere;
|
|
636
|
+
}
|
|
637
|
+
.step-action {
|
|
638
|
+
color: var(--blue);
|
|
639
|
+
font-weight: 800;
|
|
640
|
+
}
|
|
641
|
+
.step-duration {
|
|
642
|
+
color: var(--faint);
|
|
643
|
+
font-size: 0.72rem;
|
|
644
|
+
font-family: 'JetBrains Mono', monospace;
|
|
645
|
+
white-space: nowrap;
|
|
646
|
+
padding-top: 2px;
|
|
647
|
+
}
|
|
648
|
+
.step-error .step-title { color: #ffd0d8; }
|
|
649
|
+
.step-error .step-marker {
|
|
650
|
+
background: var(--error);
|
|
651
|
+
box-shadow: 0 0 0 4px rgba(255,95,122,0.09);
|
|
652
|
+
}
|
|
653
|
+
.step-children {
|
|
654
|
+
margin-top: 2px;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
.evidence-hero {
|
|
658
|
+
position: relative;
|
|
659
|
+
overflow: hidden;
|
|
660
|
+
background: #080910;
|
|
661
|
+
}
|
|
662
|
+
.evidence-hero img,
|
|
663
|
+
.evidence-hero video {
|
|
664
|
+
width: 100%;
|
|
665
|
+
max-height: 320px;
|
|
666
|
+
object-fit: contain;
|
|
667
|
+
display: block;
|
|
668
|
+
cursor: zoom-in;
|
|
669
|
+
}
|
|
670
|
+
.evidence-link,
|
|
671
|
+
.evidence-thumb {
|
|
672
|
+
text-decoration: none;
|
|
673
|
+
}
|
|
674
|
+
.evidence-link {
|
|
675
|
+
display: flex;
|
|
676
|
+
justify-content: space-between;
|
|
677
|
+
gap: 12px;
|
|
678
|
+
padding: 11px 13px;
|
|
679
|
+
color: var(--muted);
|
|
680
|
+
border-top: 1px solid var(--line-soft);
|
|
681
|
+
font-size: 0.78rem;
|
|
682
|
+
font-family: 'JetBrains Mono', monospace;
|
|
683
|
+
}
|
|
684
|
+
.evidence-link:hover,
|
|
685
|
+
.evidence-thumb:hover {
|
|
686
|
+
color: var(--text);
|
|
687
|
+
}
|
|
688
|
+
.evidence-thumbs {
|
|
689
|
+
display: grid;
|
|
690
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
691
|
+
gap: 10px;
|
|
692
|
+
padding: 12px;
|
|
693
|
+
border-top: 1px solid var(--line-soft);
|
|
694
|
+
}
|
|
695
|
+
.evidence-thumb {
|
|
696
|
+
border: 1px solid var(--line-soft);
|
|
697
|
+
border-radius: 8px;
|
|
698
|
+
overflow: hidden;
|
|
699
|
+
color: var(--muted);
|
|
700
|
+
background: rgba(255,255,255,0.03);
|
|
701
|
+
font-size: 0.72rem;
|
|
702
|
+
}
|
|
703
|
+
.evidence-thumb img,
|
|
704
|
+
.evidence-thumb video {
|
|
705
|
+
width: 100%;
|
|
706
|
+
aspect-ratio: 16 / 9;
|
|
707
|
+
object-fit: cover;
|
|
708
|
+
display: block;
|
|
709
|
+
background: #07080d;
|
|
710
|
+
}
|
|
711
|
+
.thumb-name {
|
|
712
|
+
display: block;
|
|
713
|
+
padding: 8px;
|
|
714
|
+
white-space: nowrap;
|
|
715
|
+
overflow: hidden;
|
|
716
|
+
text-overflow: ellipsis;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
footer {
|
|
720
|
+
margin-top: 34px;
|
|
721
|
+
text-align: center;
|
|
722
|
+
padding: 22px 0 6px;
|
|
723
|
+
font-size: 0.76rem;
|
|
724
|
+
color: var(--faint);
|
|
725
|
+
font-family: 'JetBrains Mono', monospace;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
.tag {
|
|
729
|
+
display: inline-flex;
|
|
730
|
+
align-items: center;
|
|
731
|
+
min-height: 22px;
|
|
732
|
+
padding: 3px 8px;
|
|
733
|
+
border-radius: 999px;
|
|
734
|
+
border: 1px solid var(--line-soft);
|
|
735
|
+
background: rgba(255,255,255,0.035);
|
|
736
|
+
color: var(--muted);
|
|
737
|
+
font-size: 0.68rem;
|
|
738
|
+
font-weight: 800;
|
|
739
|
+
text-transform: uppercase;
|
|
740
|
+
letter-spacing: 0.06em;
|
|
741
|
+
}
|
|
742
|
+
.tag-project {
|
|
743
|
+
color: #e2c7ff;
|
|
744
|
+
background: var(--brand-soft);
|
|
745
|
+
border-color: rgba(181,108,255,0.26);
|
|
746
|
+
}
|
|
747
|
+
.tag-retry {
|
|
748
|
+
color: #ffe2a6;
|
|
749
|
+
background: var(--warning-soft);
|
|
750
|
+
border-color: rgba(255,200,87,0.28);
|
|
751
|
+
}
|
|
752
|
+
.tag-status-passed {
|
|
753
|
+
color: #bff7df;
|
|
754
|
+
background: var(--success-soft);
|
|
755
|
+
border-color: rgba(57,217,159,0.28);
|
|
756
|
+
}
|
|
757
|
+
.tag-status-failed {
|
|
758
|
+
color: #ffd0d8;
|
|
759
|
+
background: var(--error-soft);
|
|
760
|
+
border-color: rgba(255,95,122,0.28);
|
|
761
|
+
}
|
|
762
|
+
.tag-status-neutral {
|
|
763
|
+
color: var(--muted);
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
.security-section {
|
|
767
|
+
overflow: hidden;
|
|
768
|
+
}
|
|
769
|
+
.security-header {
|
|
770
|
+
width: 100%;
|
|
771
|
+
border: 0;
|
|
772
|
+
background: transparent;
|
|
773
|
+
color: var(--text);
|
|
774
|
+
cursor: pointer;
|
|
775
|
+
}
|
|
776
|
+
.security-risk-badge {
|
|
777
|
+
padding: 5px 9px;
|
|
778
|
+
border-radius: 999px;
|
|
779
|
+
font-size: 0.72rem;
|
|
780
|
+
font-weight: 800;
|
|
781
|
+
color: #07080d;
|
|
782
|
+
}
|
|
783
|
+
.security-summary {
|
|
784
|
+
display: grid;
|
|
785
|
+
grid-template-columns: repeat(4, 1fr);
|
|
786
|
+
gap: 1px;
|
|
787
|
+
background: var(--line-soft);
|
|
788
|
+
text-align: center;
|
|
789
|
+
border-bottom: 1px solid var(--line-soft);
|
|
790
|
+
}
|
|
791
|
+
.summary-item {
|
|
792
|
+
background: rgba(7,8,13,0.48);
|
|
793
|
+
padding: 12px 8px;
|
|
794
|
+
}
|
|
795
|
+
.summary-item .count {
|
|
796
|
+
font-size: 1.2rem;
|
|
797
|
+
font-weight: 800;
|
|
798
|
+
}
|
|
799
|
+
.summary-item .label {
|
|
800
|
+
font-size: 0.66rem;
|
|
801
|
+
text-transform: uppercase;
|
|
802
|
+
color: var(--faint);
|
|
803
|
+
letter-spacing: 0.08em;
|
|
804
|
+
}
|
|
805
|
+
.count-Critical { color: var(--error); }
|
|
806
|
+
.count-High { color: #ff9d66; }
|
|
807
|
+
.count-Medium { color: var(--warning); }
|
|
808
|
+
.count-Low { color: var(--blue); }
|
|
809
|
+
|
|
810
|
+
.vuln-list {
|
|
811
|
+
display: flex;
|
|
812
|
+
flex-direction: column;
|
|
813
|
+
gap: 12px;
|
|
814
|
+
padding: 14px;
|
|
815
|
+
}
|
|
816
|
+
.vuln-card {
|
|
817
|
+
background: rgba(7,8,13,0.52);
|
|
818
|
+
border: 1px solid var(--line-soft);
|
|
819
|
+
border-left-width: 4px;
|
|
820
|
+
border-radius: 8px;
|
|
821
|
+
padding: 14px;
|
|
822
|
+
}
|
|
823
|
+
.vuln-card-title {
|
|
824
|
+
font-weight: 800;
|
|
825
|
+
margin-bottom: 8px;
|
|
826
|
+
display: flex;
|
|
827
|
+
align-items: center;
|
|
828
|
+
gap: 10px;
|
|
829
|
+
flex-wrap: wrap;
|
|
830
|
+
}
|
|
831
|
+
.vuln-card-desc {
|
|
832
|
+
color: var(--muted);
|
|
833
|
+
font-size: 0.88rem;
|
|
834
|
+
margin: 10px 0;
|
|
835
|
+
}
|
|
836
|
+
.vuln-card-evidence {
|
|
837
|
+
background: #07080d;
|
|
838
|
+
padding: 10px;
|
|
839
|
+
border-radius: 4px;
|
|
840
|
+
font-family: 'JetBrains Mono', monospace;
|
|
841
|
+
font-size: 0.74rem;
|
|
842
|
+
white-space: pre-wrap;
|
|
843
|
+
word-break: break-all;
|
|
844
|
+
margin: 10px 0;
|
|
845
|
+
border: 1px solid var(--line-soft);
|
|
846
|
+
max-height: 200px;
|
|
847
|
+
overflow-y: auto;
|
|
848
|
+
}
|
|
849
|
+
.vuln-card-remediation {
|
|
850
|
+
font-size: 0.88rem;
|
|
851
|
+
color: #bff7df;
|
|
852
|
+
}
|
|
853
|
+
pre { margin: 0; }
|
|
854
|
+
|
|
855
|
+
@media (max-width: 1040px) {
|
|
856
|
+
.mission-brief,
|
|
857
|
+
.test-details-grid {
|
|
858
|
+
grid-template-columns: 1fr;
|
|
859
|
+
}
|
|
860
|
+
.status-card {
|
|
861
|
+
width: 100%;
|
|
862
|
+
}
|
|
863
|
+
.brief-grid {
|
|
864
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
@media (max-width: 680px) {
|
|
868
|
+
.container {
|
|
869
|
+
padding: 20px;
|
|
870
|
+
}
|
|
871
|
+
.mission-title {
|
|
872
|
+
font-size: 2.3rem;
|
|
873
|
+
}
|
|
874
|
+
.brief-grid {
|
|
875
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
876
|
+
}
|
|
877
|
+
.test-header {
|
|
878
|
+
align-items: flex-start;
|
|
879
|
+
}
|
|
880
|
+
.test-details-grid {
|
|
881
|
+
gap: 16px;
|
|
882
|
+
}
|
|
883
|
+
.step-header {
|
|
884
|
+
grid-template-columns: 14px minmax(0, 1fr);
|
|
885
|
+
}
|
|
886
|
+
.step-duration {
|
|
887
|
+
grid-column: 2;
|
|
888
|
+
justify-self: start;
|
|
889
|
+
padding-top: 0;
|
|
890
|
+
}
|
|
891
|
+
.evidence-thumbs,
|
|
892
|
+
.security-summary {
|
|
893
|
+
grid-template-columns: 1fr 1fr;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
</style>
|
|
897
|
+
</head>
|
|
898
|
+
<body>
|
|
899
|
+
<div class="container">
|
|
900
|
+
<header class="mission-brief">
|
|
901
|
+
<div>
|
|
902
|
+
<div class="brand-row">
|
|
903
|
+
<span class="brand-mark ${brandLogo ? 'has-logo' : ''}" aria-hidden="true">
|
|
904
|
+
${brandLogo ? `<img src="${brandLogo}" alt="">` : ''}
|
|
905
|
+
</span>
|
|
906
|
+
<div>
|
|
907
|
+
<div class="brand-name">Arcality QA Engine</div>
|
|
908
|
+
<div class="brand-subtitle">Consola de diagnostico autonomo</div>
|
|
909
|
+
</div>
|
|
910
|
+
</div>
|
|
911
|
+
<h1 class="mission-title">${reportTitle}</h1>
|
|
912
|
+
<p class="mission-copy">${reportSummary}</p>
|
|
913
|
+
</div>
|
|
914
|
+
<div class="status-card ${reportTone}">
|
|
915
|
+
<div class="status-eyebrow">
|
|
916
|
+
<span>Estado general</span>
|
|
917
|
+
<span class="status-pill">${reportStatus}</span>
|
|
918
|
+
</div>
|
|
919
|
+
<div class="status-title">${reportStatus}</div>
|
|
920
|
+
<p class="status-summary">Inicio ${this.startTime.toLocaleString()} | Engine ${this.getEngineVersion()}</p>
|
|
921
|
+
</div>
|
|
922
|
+
</header>
|
|
923
|
+
|
|
924
|
+
<div class="brief-grid" aria-label="Resumen de ejecucion">
|
|
925
|
+
<div class="brief-metric"><span class="metric-value">${stats.total}</span><span class="metric-label">Misiones</span></div>
|
|
926
|
+
<div class="brief-metric"><span class="metric-value val-passed">${stats.passed}</span><span class="metric-label">Exitosas</span></div>
|
|
927
|
+
<div class="brief-metric"><span class="metric-value val-failed">${stats.failed}</span><span class="metric-label">Errores</span></div>
|
|
928
|
+
<div class="brief-metric"><span class="metric-value val-flaky">${stats.flaky}</span><span class="metric-label">Reintentos</span></div>
|
|
929
|
+
<div class="brief-metric"><span class="metric-value val-blue">${evidenceCount}</span><span class="metric-label">Evidencias</span></div>
|
|
930
|
+
<div class="brief-metric"><span class="metric-value">${this.formatDuration(this.totalDuration)}</span><span class="metric-label">Duracion</span></div>
|
|
931
|
+
</div>
|
|
932
|
+
|
|
933
|
+
<div class="test-list">
|
|
934
|
+
${this.results.map((r, i) => {
|
|
935
|
+
const tone = this.getStatusTone(r.result.status);
|
|
936
|
+
const statusClass = `status-${tone}`;
|
|
937
|
+
const projectName = r.test.parent.project()?.name || 'default';
|
|
938
|
+
const isOpen = this.results.length === 1 || tone === 'failed' || i === 0;
|
|
939
|
+
const successSummary = r.attachments.find(a => a.name === 'success_summary');
|
|
940
|
+
const successText = this.getAttachmentText(successSummary);
|
|
941
|
+
const evidenceHtml = this.renderVisualEvidence(r.attachments);
|
|
942
|
+
const contextHtml = this.renderTextAttachmentSection(r.attachments, 'qa_context_summary', 'Contexto QA aplicado');
|
|
943
|
+
const securityHtml = this._renderSecuritySection(r.attachments, i);
|
|
944
|
+
return `
|
|
945
|
+
<div class="test-entry ${statusClass}">
|
|
946
|
+
<button class="test-header" type="button" onclick="toggleDetails('details-${i}', this)" aria-expanded="${isOpen ? 'true' : 'false'}">
|
|
947
|
+
<div class="test-info">
|
|
948
|
+
<span class="status-dot"></span>
|
|
949
|
+
<div>
|
|
950
|
+
<div class="test-name">${this.escapeHtml(r.test.title)}</div>
|
|
951
|
+
<div class="test-meta">
|
|
952
|
+
<span class="tag tag-status-${tone}">${this.getStatusLabel(r.result.status)}</span>
|
|
953
|
+
<span class="tag tag-project">${this.escapeHtml(projectName)}</span>
|
|
954
|
+
${r.result.retry > 0 ? `<span class="tag tag-retry">Retry #${r.result.retry}</span>` : ''}
|
|
955
|
+
<span class="tag">${this.formatDuration(r.result.duration)}</span>
|
|
956
|
+
</div>
|
|
957
|
+
</div>
|
|
958
|
+
</div>
|
|
959
|
+
<span class="test-chevron" aria-hidden="true">v</span>
|
|
960
|
+
</button>
|
|
961
|
+
|
|
962
|
+
<div class="test-details" id="details-${i}" style="display: ${isOpen ? 'block' : 'none'};">
|
|
963
|
+
<div class="test-details-grid">
|
|
964
|
+
<main class="primary-column">
|
|
965
|
+
${r.result.status === 'passed' && successText ? `
|
|
966
|
+
<div class="outcome-block success">
|
|
967
|
+
<span class="outcome-label">Resultado</span>
|
|
968
|
+
<p class="success-block">${this.escapeHtml(successText)}</p>
|
|
969
|
+
</div>
|
|
970
|
+
` : ''}
|
|
971
|
+
|
|
972
|
+
${r.result.error ? `
|
|
973
|
+
<div class="outcome-block error">
|
|
974
|
+
<span class="outcome-label">Diagnostico del bloqueo</span>
|
|
975
|
+
<pre class="error-block">${this.escapeHtml(r.result.error.message || 'Unknown Failure')}</pre>
|
|
976
|
+
</div>
|
|
977
|
+
` : ''}
|
|
978
|
+
|
|
979
|
+
<section class="steps-section timeline-wrap">
|
|
980
|
+
<span class="section-title">Proceso cognitivo del agente</span>
|
|
981
|
+
<div class="steps-container">
|
|
982
|
+
${r.stepsHtml || '<p style="opacity:0.5; padding: 0 18px;">No hay pasos registrados.</p>'}
|
|
983
|
+
</div>
|
|
984
|
+
</section>
|
|
985
|
+
</main>
|
|
986
|
+
|
|
987
|
+
<aside class="context-column">
|
|
988
|
+
${evidenceHtml}
|
|
989
|
+
${contextHtml}
|
|
990
|
+
${securityHtml}
|
|
991
|
+
<section class="side-panel">
|
|
992
|
+
<div class="panel-header">
|
|
993
|
+
<span class="panel-title">Metadata</span>
|
|
994
|
+
</div>
|
|
995
|
+
<div class="panel-body">
|
|
996
|
+
<dl class="metadata-list">
|
|
997
|
+
<div class="metadata-row"><dt>Proyecto</dt><dd>${this.escapeHtml(projectName)}</dd></div>
|
|
998
|
+
<div class="metadata-row"><dt>Estado</dt><dd>${this.getStatusLabel(r.result.status)}</dd></div>
|
|
999
|
+
<div class="metadata-row"><dt>Duracion</dt><dd>${this.formatDuration(r.result.duration)}</dd></div>
|
|
1000
|
+
<div class="metadata-row"><dt>Retry</dt><dd>${r.result.retry}</dd></div>
|
|
1001
|
+
</dl>
|
|
1002
|
+
</div>
|
|
1003
|
+
</section>
|
|
1004
|
+
</aside>
|
|
1005
|
+
</div>
|
|
1006
|
+
</div>
|
|
1007
|
+
</div>
|
|
1008
|
+
`;
|
|
1009
|
+
}).join('')}
|
|
1010
|
+
</div>
|
|
1011
|
+
|
|
1012
|
+
<footer>
|
|
1013
|
+
ARCALITY ENGINE v${this.getEngineVersion()} | ${generatedAt.toISOString()} | GENERATED FOR ARCADIAL
|
|
1014
|
+
</footer>
|
|
1015
|
+
</div>
|
|
1016
|
+
|
|
1017
|
+
<script>
|
|
1018
|
+
function toggleDetails(id, trigger) {
|
|
1019
|
+
const el = document.getElementById(id);
|
|
1020
|
+
if (!el) return;
|
|
1021
|
+
const isHidden = el.style.display === 'none' || el.style.display === '';
|
|
1022
|
+
el.style.display = isHidden ? 'block' : 'none';
|
|
1023
|
+
if (trigger) trigger.setAttribute('aria-expanded', isHidden ? 'true' : 'false');
|
|
1024
|
+
}
|
|
1025
|
+
</script>
|
|
1026
|
+
</body>
|
|
1027
|
+
</html>
|
|
1028
|
+
`;
|
|
1029
|
+
}
|
|
1030
|
+
renderVisualEvidence(attachments) {
|
|
1031
|
+
const media = attachments.filter(att => att.path && (att.contentType.startsWith('image/') || att.contentType.startsWith('video/')));
|
|
1032
|
+
if (media.length === 0)
|
|
1033
|
+
return '';
|
|
1034
|
+
const primary = media[0];
|
|
1035
|
+
const primaryPath = this.escapeHtml(primary.path);
|
|
1036
|
+
const primaryName = this.escapeHtml(primary.name);
|
|
1037
|
+
const primaryMedia = primary.contentType.startsWith('image/')
|
|
1038
|
+
? `<img src="${primaryPath}" alt="${primaryName}" onclick="window.open(this.src)">`
|
|
1039
|
+
: `<video controls src="${primaryPath}"></video>`;
|
|
1040
|
+
return `
|
|
1041
|
+
<section class="side-panel evidence-panel">
|
|
1042
|
+
<div class="panel-header">
|
|
1043
|
+
<span class="panel-title">Evidencia visual</span>
|
|
1044
|
+
<span class="panel-kicker">${media.length} archivo${media.length === 1 ? '' : 's'}</span>
|
|
1045
|
+
</div>
|
|
1046
|
+
<div class="evidence-hero">
|
|
1047
|
+
${primaryMedia}
|
|
1048
|
+
<a class="evidence-link" href="${primaryPath}" target="_blank" rel="noreferrer">
|
|
1049
|
+
<span>${primaryName}</span>
|
|
1050
|
+
<span>Abrir</span>
|
|
1051
|
+
</a>
|
|
1052
|
+
</div>
|
|
1053
|
+
${media.length > 1 ? `
|
|
1054
|
+
<div class="evidence-thumbs">
|
|
1055
|
+
${media.map(att => {
|
|
1056
|
+
const mediaPath = this.escapeHtml(att.path);
|
|
1057
|
+
const mediaName = this.escapeHtml(att.name);
|
|
1058
|
+
const thumb = att.contentType.startsWith('image/')
|
|
1059
|
+
? `<img src="${mediaPath}" alt="${mediaName}">`
|
|
1060
|
+
: `<video src="${mediaPath}"></video>`;
|
|
1061
|
+
return `
|
|
1062
|
+
<a class="evidence-thumb" href="${mediaPath}" target="_blank" rel="noreferrer">
|
|
1063
|
+
${thumb}
|
|
1064
|
+
<span class="thumb-name">${mediaName}</span>
|
|
1065
|
+
</a>
|
|
1066
|
+
`;
|
|
1067
|
+
}).join('')}
|
|
1068
|
+
</div>
|
|
1069
|
+
` : ''}
|
|
1070
|
+
</section>
|
|
1071
|
+
`;
|
|
1072
|
+
}
|
|
1073
|
+
getAttachmentText(att) {
|
|
1074
|
+
if (!att)
|
|
1075
|
+
return null;
|
|
1076
|
+
if (att.body)
|
|
1077
|
+
return att.body.toString();
|
|
1078
|
+
if (att.path) {
|
|
1079
|
+
const actualPath = path_1.default.isAbsolute(att.path) ? att.path : path_1.default.join(this.outputDir, att.path);
|
|
1080
|
+
if (fs_1.default.existsSync(actualPath)) {
|
|
1081
|
+
return fs_1.default.readFileSync(actualPath, 'utf8');
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
return null;
|
|
1085
|
+
}
|
|
1086
|
+
renderTextAttachmentSection(attachments, attachmentName, title) {
|
|
1087
|
+
const attachment = attachments.find(att => att.name === attachmentName);
|
|
1088
|
+
const text = this.getAttachmentText(attachment);
|
|
1089
|
+
if (!text)
|
|
1090
|
+
return '';
|
|
1091
|
+
return `
|
|
1092
|
+
<section class="side-panel">
|
|
1093
|
+
<div class="panel-header">
|
|
1094
|
+
<span class="panel-title">${this.escapeHtml(title)}</span>
|
|
1095
|
+
</div>
|
|
1096
|
+
<div class="panel-body">
|
|
1097
|
+
<pre class="info-block">${this.escapeHtml(text)}</pre>
|
|
1098
|
+
</div>
|
|
1099
|
+
</section>
|
|
1100
|
+
`;
|
|
1101
|
+
}
|
|
1102
|
+
_renderSecuritySection(attachments, index) {
|
|
1103
|
+
let vulnerabilities = [];
|
|
1104
|
+
const reportAtt = attachments.find(a => a.name === 'security_report');
|
|
1105
|
+
if (reportAtt) {
|
|
1106
|
+
const text = this.getAttachmentText(reportAtt);
|
|
1107
|
+
if (text) {
|
|
1108
|
+
try {
|
|
1109
|
+
const parsed = JSON.parse(text);
|
|
1110
|
+
if (Array.isArray(parsed))
|
|
1111
|
+
vulnerabilities.push(...parsed);
|
|
1112
|
+
}
|
|
1113
|
+
catch (e) { }
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
const findingAtts = attachments.filter(a => a.name === 'security_finding');
|
|
1117
|
+
for (const findingAtt of findingAtts) {
|
|
1118
|
+
const text = this.getAttachmentText(findingAtt);
|
|
1119
|
+
if (text) {
|
|
1120
|
+
try {
|
|
1121
|
+
const parsed = JSON.parse(text);
|
|
1122
|
+
vulnerabilities.push(parsed);
|
|
1123
|
+
}
|
|
1124
|
+
catch (e) { }
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
if (vulnerabilities.length === 0)
|
|
1128
|
+
return '';
|
|
1129
|
+
const severityOrder = { 'Critical': 0, 'High': 1, 'Medium': 2, 'Low': 3, 'Info': 4 };
|
|
1130
|
+
const severityCounts = { 'Critical': 0, 'High': 0, 'Medium': 0, 'Low': 0, 'Info': 0 };
|
|
1131
|
+
let worstSeverity = 'Info';
|
|
1132
|
+
const normalizeSeverity = (value) => {
|
|
1133
|
+
const severity = String(value || 'Info');
|
|
1134
|
+
return severityCounts[severity] !== undefined ? severity : 'Info';
|
|
1135
|
+
};
|
|
1136
|
+
vulnerabilities.forEach(v => {
|
|
1137
|
+
const severity = normalizeSeverity(v.severity);
|
|
1138
|
+
severityCounts[severity]++;
|
|
1139
|
+
if (severityOrder[severity] < severityOrder[worstSeverity]) {
|
|
1140
|
+
worstSeverity = severity;
|
|
1141
|
+
}
|
|
1142
|
+
});
|
|
1143
|
+
const getSeverityColor = (sev) => {
|
|
1144
|
+
switch (sev) {
|
|
1145
|
+
case 'Critical': return 'var(--error)';
|
|
1146
|
+
case 'High': return '#ff9d66';
|
|
1147
|
+
case 'Medium': return 'var(--warning)';
|
|
1148
|
+
case 'Low': return 'var(--blue)';
|
|
1149
|
+
case 'Info': return 'var(--faint)';
|
|
1150
|
+
}
|
|
1151
|
+
};
|
|
1152
|
+
const riskColor = getSeverityColor(worstSeverity);
|
|
1153
|
+
return `
|
|
1154
|
+
<section class="side-panel security-section">
|
|
1155
|
+
<button type="button" class="security-header panel-header" onclick="toggleDetails('security-details-${index}', this)" aria-expanded="false">
|
|
1156
|
+
<span class="panel-title">Evaluacion de seguridad</span>
|
|
1157
|
+
<span class="security-risk-badge" style="background-color: ${riskColor};">${worstSeverity}</span>
|
|
1158
|
+
</button>
|
|
1159
|
+
<div class="security-summary">
|
|
1160
|
+
<div class="summary-item">
|
|
1161
|
+
<div class="count count-Critical">${severityCounts.Critical}</div>
|
|
1162
|
+
<div class="label">Critical</div>
|
|
1163
|
+
</div>
|
|
1164
|
+
<div class="summary-item">
|
|
1165
|
+
<div class="count count-High">${severityCounts.High}</div>
|
|
1166
|
+
<div class="label">High</div>
|
|
1167
|
+
</div>
|
|
1168
|
+
<div class="summary-item">
|
|
1169
|
+
<div class="count count-Medium">${severityCounts.Medium}</div>
|
|
1170
|
+
<div class="label">Medium</div>
|
|
1171
|
+
</div>
|
|
1172
|
+
<div class="summary-item">
|
|
1173
|
+
<div class="count count-Low">${severityCounts.Low}</div>
|
|
1174
|
+
<div class="label">Low</div>
|
|
1175
|
+
</div>
|
|
1176
|
+
</div>
|
|
1177
|
+
<div class="security-details" id="security-details-${index}" style="display: none;">
|
|
1178
|
+
<div class="vuln-list">
|
|
1179
|
+
${vulnerabilities.map(v => {
|
|
1180
|
+
const sev = normalizeSeverity(v.severity);
|
|
1181
|
+
const cardColor = getSeverityColor(sev);
|
|
1182
|
+
return `
|
|
1183
|
+
<div class="vuln-card" style="border-left-color: ${cardColor};">
|
|
1184
|
+
<div class="vuln-card-title">
|
|
1185
|
+
<span class="tag" style="background-color: ${cardColor}20; color: ${cardColor};">${sev}</span>
|
|
1186
|
+
<span>${this.escapeHtml(v.category)} ${v.subcategory ? `<span style="opacity:0.7">- ${this.escapeHtml(v.subcategory)}</span>` : ''}</span>
|
|
1187
|
+
</div>
|
|
1188
|
+
<div style="font-size: 0.78rem; opacity: 0.82; margin: 6px 0 10px; display: flex; flex-wrap: wrap; gap: 10px;">
|
|
1189
|
+
${v.type ? `<span><strong style="color:var(--brand);">Type:</strong> ${this.escapeHtml(v.type)}</span>` : ''}
|
|
1190
|
+
${v.confidence ? `<span><strong>Confidence:</strong> ${this.escapeHtml(v.confidence)}</span>` : ''}
|
|
1191
|
+
${v.exploitability ? `<span><strong>Exploitability:</strong> ${this.escapeHtml(v.exploitability)}</span>` : ''}
|
|
1192
|
+
</div>
|
|
1193
|
+
<p class="vuln-card-desc">${this.escapeHtml(v.description)}</p>
|
|
1194
|
+
${v.impact ? `<p class="vuln-card-desc" style="color:#ffd89a;"><strong>Impact:</strong> ${this.escapeHtml(v.impact)}</p>` : ''}
|
|
1195
|
+
|
|
1196
|
+
<div class="vuln-card-evidence">
|
|
1197
|
+
<strong>Evidence:</strong>
|
|
1198
|
+
<pre>${this.escapeHtml(JSON.stringify(v.evidence, null, 2))}</pre>
|
|
1199
|
+
</div>
|
|
1200
|
+
|
|
1201
|
+
${v.reproductionSteps && v.reproductionSteps.length > 0 ? `
|
|
1202
|
+
<div style="margin: 10px 0; background: rgba(0,0,0,0.18); padding: 10px; border-radius: 6px; border-left: 2px solid ${cardColor}80;">
|
|
1203
|
+
<strong style="font-size: 0.82rem; color: var(--muted);">Reproduction Steps:</strong>
|
|
1204
|
+
<ol style="margin: 5px 0 0 20px; font-size: 0.82rem; color: var(--text);">
|
|
1205
|
+
${v.reproductionSteps.map((s) => `<li>${this.escapeHtml(s)}</li>`).join('')}
|
|
1206
|
+
</ol>
|
|
1207
|
+
</div>` : ''}
|
|
1208
|
+
|
|
1209
|
+
<div class="vuln-card-remediation">
|
|
1210
|
+
<strong>Remediation:</strong> ${this.escapeHtml(v.remediation)}
|
|
1211
|
+
</div>
|
|
1212
|
+
|
|
1213
|
+
${v.classification ? `
|
|
1214
|
+
<div style="font-size: 0.72rem; opacity: 0.55; margin-top: 12px; display: flex; gap: 15px; font-family: 'JetBrains Mono', monospace; flex-wrap: wrap;">
|
|
1215
|
+
${v.classification.owaspTop10 ? `<span>[OWASP: ${this.escapeHtml(v.classification.owaspTop10)}]</span>` : ''}
|
|
1216
|
+
${v.classification.cwe ? `<span>[CWE: ${this.escapeHtml(v.classification.cwe)}]</span>` : ''}
|
|
1217
|
+
</div>` : ''}
|
|
1218
|
+
</div>
|
|
1219
|
+
`;
|
|
1220
|
+
}).join('')}
|
|
1221
|
+
</div>
|
|
1222
|
+
</div>
|
|
1223
|
+
</section>
|
|
1224
|
+
`;
|
|
1225
|
+
}
|
|
1226
|
+
escapeHtml(unsafe) {
|
|
1227
|
+
if (!unsafe)
|
|
1228
|
+
return '';
|
|
1229
|
+
return unsafe
|
|
1230
|
+
.replace(/&/g, "&")
|
|
1231
|
+
.replace(/</g, "<")
|
|
1232
|
+
.replace(/>/g, ">")
|
|
1233
|
+
.replace(/"/g, """)
|
|
1234
|
+
.replace(/'/g, "'");
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
exports.default = ArcalityReporter;
|