@futdevpro/dynamo-e2e 1.9.0 → 1.11.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.
Files changed (138) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +2 -2
  3. package/bin/dye2e.js +46 -0
  4. package/build/_modules/cwv/_collections/cwv-comparison.util.d.ts +48 -0
  5. package/build/_modules/cwv/_collections/cwv-comparison.util.d.ts.map +1 -0
  6. package/build/_modules/cwv/_collections/cwv-comparison.util.js +59 -0
  7. package/build/_modules/cwv/_collections/cwv-comparison.util.js.map +1 -0
  8. package/build/_modules/cwv/_collections/cwv-diagnose.util.d.ts +37 -0
  9. package/build/_modules/cwv/_collections/cwv-diagnose.util.d.ts.map +1 -0
  10. package/build/_modules/cwv/_collections/cwv-diagnose.util.js +108 -0
  11. package/build/_modules/cwv/_collections/cwv-diagnose.util.js.map +1 -0
  12. package/build/_modules/cwv/cwv-comparison.spec.d.ts +2 -0
  13. package/build/_modules/cwv/cwv-comparison.spec.d.ts.map +1 -0
  14. package/build/_modules/cwv/cwv-comparison.spec.js +77 -0
  15. package/build/_modules/cwv/cwv-comparison.spec.js.map +1 -0
  16. package/build/_modules/cwv/cwv-diagnose.spec.d.ts +2 -0
  17. package/build/_modules/cwv/cwv-diagnose.spec.d.ts.map +1 -0
  18. package/build/_modules/cwv/cwv-diagnose.spec.js +78 -0
  19. package/build/_modules/cwv/cwv-diagnose.spec.js.map +1 -0
  20. package/build/_modules/cwv/index.d.ts +2 -0
  21. package/build/_modules/cwv/index.d.ts.map +1 -1
  22. package/build/_modules/cwv/index.js +2 -0
  23. package/build/_modules/cwv/index.js.map +1 -1
  24. package/build/_modules/generators/_collections/cli-runner.util.d.ts +28 -0
  25. package/build/_modules/generators/_collections/cli-runner.util.d.ts.map +1 -1
  26. package/build/_modules/generators/_collections/cli-runner.util.js +123 -0
  27. package/build/_modules/generators/_collections/cli-runner.util.js.map +1 -1
  28. package/build/_modules/generators/bootstrap.spec.d.ts +2 -0
  29. package/build/_modules/generators/bootstrap.spec.d.ts.map +1 -0
  30. package/build/_modules/generators/bootstrap.spec.js +38 -0
  31. package/build/_modules/generators/bootstrap.spec.js.map +1 -0
  32. package/build/_modules/generators/doctor.spec.d.ts +2 -0
  33. package/build/_modules/generators/doctor.spec.d.ts.map +1 -0
  34. package/build/_modules/generators/doctor.spec.js +68 -0
  35. package/build/_modules/generators/doctor.spec.js.map +1 -0
  36. package/coverage/contracts/_collections/index.html +1 -1
  37. package/coverage/contracts/_collections/index.ts.html +1 -1
  38. package/coverage/contracts/_collections/utils/index.html +1 -1
  39. package/coverage/contracts/_collections/utils/test-id.util.ts.html +1 -1
  40. package/coverage/contracts/_enums/cwv-metric-type.enum.ts.html +1 -1
  41. package/coverage/contracts/_enums/field-test-case-type.enum.ts.html +1 -1
  42. package/coverage/contracts/_enums/index.html +1 -1
  43. package/coverage/contracts/_enums/index.ts.html +1 -1
  44. package/coverage/contracts/_enums/standard-viewport.enum.ts.html +1 -1
  45. package/coverage/contracts/_enums/test-expectation-type.enum.ts.html +1 -1
  46. package/coverage/contracts/_enums/test-run-mode-type.enum.ts.html +1 -1
  47. package/coverage/contracts/index.html +1 -1
  48. package/coverage/contracts/index.ts.html +1 -1
  49. package/coverage/cwv/_collections/cwv-aggregator.util.ts.html +1 -1
  50. package/coverage/cwv/_collections/cwv-comparison.util.ts.html +355 -0
  51. package/coverage/cwv/_collections/cwv-diagnose.util.ts.html +553 -0
  52. package/coverage/cwv/_collections/cwv-emission.util.ts.html +1 -1
  53. package/coverage/cwv/_collections/index.html +38 -8
  54. package/coverage/cwv/_collections/inp-interaction-script.const.ts.html +1 -1
  55. package/coverage/cwv/_collections/web-vitals-page-script.const.ts.html +1 -1
  56. package/coverage/cwv/cwv-suite.generator.ts.html +1 -1
  57. package/coverage/cwv/index.html +1 -1
  58. package/coverage/generators/_collections/cli-runner.util.ts.html +414 -15
  59. package/coverage/generators/_collections/field-emission.util.ts.html +1 -1
  60. package/coverage/generators/_collections/form-level-emission.util.ts.html +1 -1
  61. package/coverage/generators/_collections/index.html +13 -13
  62. package/coverage/generators/_collections/spec-emission.util.ts.html +1 -1
  63. package/coverage/generators/_collections/test-case-filter.util.ts.html +1 -1
  64. package/coverage/generators/_collections/viewport-emission.util.ts.html +1 -1
  65. package/coverage/generators/form-suite.generator.ts.html +1 -1
  66. package/coverage/generators/index.html +1 -1
  67. package/coverage/generators/viewport-suite.generator.ts.html +1 -1
  68. package/coverage/index.html +26 -26
  69. package/coverage/lcov-report/contracts/_collections/index.html +1 -1
  70. package/coverage/lcov-report/contracts/_collections/index.ts.html +1 -1
  71. package/coverage/lcov-report/contracts/_collections/utils/index.html +1 -1
  72. package/coverage/lcov-report/contracts/_collections/utils/test-id.util.ts.html +1 -1
  73. package/coverage/lcov-report/contracts/_enums/cwv-metric-type.enum.ts.html +1 -1
  74. package/coverage/lcov-report/contracts/_enums/field-test-case-type.enum.ts.html +1 -1
  75. package/coverage/lcov-report/contracts/_enums/index.html +1 -1
  76. package/coverage/lcov-report/contracts/_enums/index.ts.html +1 -1
  77. package/coverage/lcov-report/contracts/_enums/standard-viewport.enum.ts.html +1 -1
  78. package/coverage/lcov-report/contracts/_enums/test-expectation-type.enum.ts.html +1 -1
  79. package/coverage/lcov-report/contracts/_enums/test-run-mode-type.enum.ts.html +1 -1
  80. package/coverage/lcov-report/contracts/index.html +1 -1
  81. package/coverage/lcov-report/contracts/index.ts.html +1 -1
  82. package/coverage/lcov-report/cwv/_collections/cwv-aggregator.util.ts.html +1 -1
  83. package/coverage/lcov-report/cwv/_collections/cwv-comparison.util.ts.html +355 -0
  84. package/coverage/lcov-report/cwv/_collections/cwv-diagnose.util.ts.html +553 -0
  85. package/coverage/lcov-report/cwv/_collections/cwv-emission.util.ts.html +1 -1
  86. package/coverage/lcov-report/cwv/_collections/index.html +38 -8
  87. package/coverage/lcov-report/cwv/_collections/inp-interaction-script.const.ts.html +1 -1
  88. package/coverage/lcov-report/cwv/_collections/web-vitals-page-script.const.ts.html +1 -1
  89. package/coverage/lcov-report/cwv/cwv-suite.generator.ts.html +1 -1
  90. package/coverage/lcov-report/cwv/index.html +1 -1
  91. package/coverage/lcov-report/generators/_collections/cli-runner.util.ts.html +414 -15
  92. package/coverage/lcov-report/generators/_collections/field-emission.util.ts.html +1 -1
  93. package/coverage/lcov-report/generators/_collections/form-level-emission.util.ts.html +1 -1
  94. package/coverage/lcov-report/generators/_collections/index.html +13 -13
  95. package/coverage/lcov-report/generators/_collections/spec-emission.util.ts.html +1 -1
  96. package/coverage/lcov-report/generators/_collections/test-case-filter.util.ts.html +1 -1
  97. package/coverage/lcov-report/generators/_collections/viewport-emission.util.ts.html +1 -1
  98. package/coverage/lcov-report/generators/form-suite.generator.ts.html +1 -1
  99. package/coverage/lcov-report/generators/index.html +1 -1
  100. package/coverage/lcov-report/generators/viewport-suite.generator.ts.html +1 -1
  101. package/coverage/lcov-report/index.html +26 -26
  102. package/coverage/lcov-report/runtime/_collections/assertion-helpers.util.ts.html +1 -1
  103. package/coverage/lcov-report/runtime/_collections/index.html +1 -1
  104. package/coverage/lcov-report/runtime/_collections/unique-generator.util.ts.html +1 -1
  105. package/coverage/lcov-report/runtime/_collections/wait-helpers.util.ts.html +1 -1
  106. package/coverage/lcov-report/runtime/_services/dialog-page-object.ts.html +1 -1
  107. package/coverage/lcov-report/runtime/_services/field-page-object.ts.html +1 -1
  108. package/coverage/lcov-report/runtime/_services/form-page-object.ts.html +1 -1
  109. package/coverage/lcov-report/runtime/_services/index.html +1 -1
  110. package/coverage/lcov-report/runtime/_services/loader-page-object.ts.html +1 -1
  111. package/coverage/lcov-report/runtime/_services/logger.service.ts.html +1 -1
  112. package/coverage/lcov-report/runtime/_services/login-flow-helper.base.ts.html +1 -1
  113. package/coverage/lcov-report/runtime/_services/nav-page-object.ts.html +1 -1
  114. package/coverage/lcov-report/runtime/_services/toast-page-object.ts.html +1 -1
  115. package/coverage/lcov-report/runtime/_services/wave-2b-page-objects.ts.html +1 -1
  116. package/coverage/lcov-report/runtime/index.html +1 -1
  117. package/coverage/lcov-report/runtime/index.ts.html +1 -1
  118. package/coverage/lcov.info +580 -70
  119. package/coverage/runtime/_collections/assertion-helpers.util.ts.html +1 -1
  120. package/coverage/runtime/_collections/index.html +1 -1
  121. package/coverage/runtime/_collections/unique-generator.util.ts.html +1 -1
  122. package/coverage/runtime/_collections/wait-helpers.util.ts.html +1 -1
  123. package/coverage/runtime/_services/dialog-page-object.ts.html +1 -1
  124. package/coverage/runtime/_services/field-page-object.ts.html +1 -1
  125. package/coverage/runtime/_services/form-page-object.ts.html +1 -1
  126. package/coverage/runtime/_services/index.html +1 -1
  127. package/coverage/runtime/_services/loader-page-object.ts.html +1 -1
  128. package/coverage/runtime/_services/logger.service.ts.html +1 -1
  129. package/coverage/runtime/_services/login-flow-helper.base.ts.html +1 -1
  130. package/coverage/runtime/_services/nav-page-object.ts.html +1 -1
  131. package/coverage/runtime/_services/toast-page-object.ts.html +1 -1
  132. package/coverage/runtime/_services/wave-2b-page-objects.ts.html +1 -1
  133. package/coverage/runtime/index.html +1 -1
  134. package/coverage/runtime/index.ts.html +1 -1
  135. package/coverage/tmp/coverage-221932-1781072712070-0.json +1 -0
  136. package/coverage/tmp/{coverage-225712-1781070050591-0.json → coverage-224696-1781072711012-0.json} +1 -1
  137. package/package.json +1 -1
  138. package/coverage/tmp/coverage-222216-1781070051665-0.json +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,45 @@
3
3
  Minden release a `dynamo-e2e-foundation` HYPERPLAN MP-N ütemezést követi.
4
4
  Verzióformátum: `MM.mm.p` (két-számjegyes major-minor, Dynamo-konvenció).
5
5
 
6
+ ## [01.11.0] — 2026-06-10
7
+
8
+ ### Added (CWV comparison + dye2e bootstrap)
9
+ - `DyE2E_CWVComparison_Util` (`cwv/_collections/cwv-comparison.util.ts`):
10
+ - `compareReports(old, new, tolerance?)` — két CWV JSON-report összevet,
11
+ p75 deltával, status: improved/regressed/stable
12
+ - `regressionsOnly()` — szűr csak a regressziókra
13
+ - `formatMarkdownTable()` — markdown-tablázat 🟢🔴⚪ icon-okkal
14
+ - **`dye2e bootstrap`** CLI parancs:
15
+ - `pwd` + `force` flag
16
+ - 5 fájl scaffold: `playwright.config.ts`, `e2e/generate.ts`,
17
+ `e2e/tests/.gitkeep`, `e2e/tests/generated/.gitkeep`, `e2e/README.md`
18
+ - `DyE2E_CliRunner_Util.bootstrapFiles()` testable factory
19
+
20
+ ### Test
21
+ - 198/0 Jasmine zöld (183 előbb + 10 CWV comparison + 5 bootstrap)
22
+ - Coverage: 98.32% / 86.28% / 97.45% / 98.32%
23
+
24
+ ## [01.10.0] — 2026-06-10
25
+
26
+ ### Added (Wave-3 attribution diagnose + `dye2e doctor` CLI)
27
+ - `DyE2E_CWVDiagnose_Util` (`cwv/_collections/cwv-diagnose.util.ts`):
28
+ - `diagnoseMetric()` — per-metric p75 + threshold check + attribution-target
29
+ + optimalizálási suggestion (IMG/H1/DIV LCP, CLS-dimension, INP-long-tasks,
30
+ TTFB-caching, FCP-critical-CSS)
31
+ - `diagnoseAll()` — minden metric egyszerre
32
+ - `DyE2E_CWVDiagnose_Hint` interface (metric, p75, threshold, worstTarget,
33
+ summary, suggestion)
34
+ - **`dye2e doctor`** CLI parancs:
35
+ - `pwd` flag (default cwd)
36
+ - 5 check: @futdevpro/dynamo-e2e, @playwright/test, playwright.config,
37
+ e2e/tests dir, .dynamo/pipeline.cicd.config.json
38
+ - Per-check suggestion + exit 0 (all ✓) / 1 (suggestions present)
39
+ - `DyE2E_CliRunner_Util.doctorReport()` testable factory
40
+
41
+ ### Test
42
+ - 183/0 Jasmine zöld (167 előbb + 8 CWV diagnose + 8 CLI doctor)
43
+ - Coverage: 98.2% / 86.43% / 97.36% / 98.2%
44
+
6
45
  ## [01.09.0] — 2026-06-10
7
46
 
8
47
  ### Added (Wave-3 INP integration + Wave-2b fixture + CONTRIBUTING)
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @futdevpro/dynamo-e2e
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/@futdevpro/dynamo-e2e.svg?label=npm)](https://www.npmjs.com/package/@futdevpro/dynamo-e2e)
4
- [![coverage](https://img.shields.io/badge/coverage-98.3%25-brightgreen.svg)](./coverage/)
5
- [![specs](https://img.shields.io/badge/specs-167%2F0-brightgreen.svg)](./src/)
4
+ [![coverage](https://img.shields.io/badge/coverage-98.32%25-brightgreen.svg)](./coverage/)
5
+ [![specs](https://img.shields.io/badge/specs-198%2F0-brightgreen.svg)](./src/)
6
6
  [![hyperplan](https://img.shields.io/badge/hyperplan-109%2F112-brightgreen.svg)](./__documentations/plans/dynamo-e2e-foundation/HYPERPLAN.md)
7
7
 
8
8
  End-to-end testing engine for the Dynamo + FDP ecosystem.
package/bin/dye2e.js CHANGED
@@ -25,6 +25,52 @@ function main() {
25
25
  process.exit(0);
26
26
  }
27
27
 
28
+ if (parsed.command === 'bootstrap') {
29
+ const projectRoot = parsed.flags.pwd ? path.resolve(parsed.flags.pwd) : process.cwd();
30
+ const force = parsed.flags.force === 'true';
31
+ const files = DyE2E_CliRunner_Util.bootstrapFiles();
32
+ let written = 0;
33
+ let skipped = 0;
34
+ process.stdout.write('dye2e bootstrap — scaffolding into ' + projectRoot + '\n\n');
35
+ for (const [relPath, content] of Object.entries(files)) {
36
+ const absPath = path.resolve(projectRoot, relPath);
37
+ if (fs.existsSync(absPath) && !force) {
38
+ process.stdout.write(' [SKIP] ' + relPath + ' (exists)\n');
39
+ skipped++;
40
+ continue;
41
+ }
42
+ fs.mkdirSync(path.dirname(absPath), { recursive: true });
43
+ fs.writeFileSync(absPath, content, 'utf-8');
44
+ process.stdout.write(' [WRITE] ' + relPath + '\n');
45
+ written++;
46
+ }
47
+ process.stdout.write('\n done — ' + written + ' written, ' + skipped + ' skipped\n');
48
+ process.stdout.write('\n next: pnpm add -D @futdevpro/dynamo-e2e @playwright/test\n');
49
+ process.stdout.write(' then: node e2e/generate.ts && npx playwright test\n');
50
+ process.exit(0);
51
+ }
52
+
53
+ if (parsed.command === 'doctor') {
54
+ const projectRoot = parsed.flags.pwd ? path.resolve(parsed.flags.pwd) : process.cwd();
55
+ const report = DyE2E_CliRunner_Util.doctorReport(projectRoot, fs);
56
+ process.stdout.write('dye2e doctor — project config check\n');
57
+ process.stdout.write(' pwd: ' + projectRoot + '\n\n');
58
+ process.stdout.write(' [' + (report.hasDynamoE2E ? '✓' : '✗') + '] @futdevpro/dynamo-e2e installed\n');
59
+ process.stdout.write(' [' + (report.hasPlaywrightTest ? '✓' : '✗') + '] @playwright/test installed\n');
60
+ process.stdout.write(' [' + (report.hasPlaywrightConfig ? '✓' : '✗') + '] playwright.config.{ts,js} present\n');
61
+ process.stdout.write(' [' + (report.hasE2EDir ? '✓' : '✗') + '] e2e/ or tests/ directory present\n');
62
+ process.stdout.write(' [' + (report.hasCicdConfig ? '✓' : '✗') + '] .dynamo/pipeline.cicd.config.json present (Overseer CICD)\n');
63
+ if (report.suggestions.length > 0) {
64
+ process.stdout.write('\n Suggestions:\n');
65
+ for (const s of report.suggestions) {
66
+ process.stdout.write(' - ' + s + '\n');
67
+ }
68
+ } else {
69
+ process.stdout.write('\n ✓ all checks passed.\n');
70
+ }
71
+ process.exit(report.suggestions.length > 0 ? 1 : 0);
72
+ }
73
+
28
74
  const generateCommands = ['generate-form-suite', 'generate-viewport-audit', 'generate-cwv-diag'];
29
75
  if (generateCommands.indexOf(parsed.command) !== -1) {
30
76
  const configPath = parsed.flags.config;
@@ -0,0 +1,48 @@
1
+ import { DyE2E_CWVMetric_Type } from '../../contracts/_enums/cwv-metric-type.enum';
2
+ /**
3
+ * MP-05/Wave-3 — CWV report comparison util.
4
+ *
5
+ * Két JSON-report-ot összevet (régi vs új) és visszaadja a regressziókat.
6
+ * Tipikus use-case: nightly CICD vs előző-stable, vagy PR-build vs main.
7
+ */
8
+ export interface DyE2E_CWVComparison_Summary {
9
+ metric: DyE2E_CWVMetric_Type;
10
+ oldP75: number;
11
+ newP75: number;
12
+ /** Delta = newP75 − oldP75. Pozitív = romlás (LCP/CLS/INP/TTFB/FCP-nél). */
13
+ delta: number;
14
+ /** Százalékos változás. */
15
+ deltaPercent: number;
16
+ /** "improved" | "regressed" | "stable". */
17
+ status: 'improved' | 'regressed' | 'stable';
18
+ }
19
+ export interface DyE2E_CWVReport_Shape {
20
+ route?: string;
21
+ summary?: Record<string, {
22
+ p75?: number;
23
+ n?: number;
24
+ }>;
25
+ raw?: Array<{
26
+ metric?: string;
27
+ value?: number;
28
+ iter?: number;
29
+ }>;
30
+ [extra: string]: unknown;
31
+ }
32
+ export declare class DyE2E_CWVComparison_Util {
33
+ /** Delta-tűrés (% alatti változás "stable"-nek számít). Default 5%. */
34
+ static defaultStableTolerancePercent: number;
35
+ /**
36
+ * Összevet két CWV-JSON-report-ot.
37
+ *
38
+ * @param oldReport — előző (baseline) report
39
+ * @param newReport — új (current) report
40
+ * @param tolerance — % alatti változás "stable". Default `defaultStableTolerancePercent`.
41
+ */
42
+ static compareReports(oldReport: DyE2E_CWVReport_Shape, newReport: DyE2E_CWVReport_Shape, tolerance?: number): DyE2E_CWVComparison_Summary[];
43
+ /** Csak a regresszióknak a leírása (kiemelve). */
44
+ static regressionsOnly(comparisons: DyE2E_CWVComparison_Summary[]): DyE2E_CWVComparison_Summary[];
45
+ /** Ember-olvasható összegzés markdown-tablázatra. */
46
+ static formatMarkdownTable(comparisons: DyE2E_CWVComparison_Summary[]): string;
47
+ }
48
+ //# sourceMappingURL=cwv-comparison.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cwv-comparison.util.d.ts","sourceRoot":"","sources":["../../../../src/_modules/cwv/_collections/cwv-comparison.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAEnF;;;;;GAKG;AAEH,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,oBAAoB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,MAAM,EAAE,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;CAC7C;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvD,GAAG,CAAC,EAAE,KAAK,CAAC;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChE,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,qBAAa,wBAAwB;IAEnC,uEAAuE;IACvE,MAAM,CAAC,6BAA6B,EAAE,MAAM,CAAK;IAEjD;;;;;;OAMG;IACH,MAAM,CAAC,cAAc,CACnB,SAAS,EAAE,qBAAqB,EAChC,SAAS,EAAE,qBAAqB,EAChC,SAAS,GAAE,MAA+D,GACzE,2BAA2B,EAAE;IA0BhC,kDAAkD;IAClD,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,2BAA2B,EAAE,GAAG,2BAA2B,EAAE;IAIjG,qDAAqD;IACrD,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,2BAA2B,EAAE,GAAG,MAAM;CAa/E"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyE2E_CWVComparison_Util = void 0;
4
+ const cwv_metric_type_enum_1 = require("../../contracts/_enums/cwv-metric-type.enum");
5
+ class DyE2E_CWVComparison_Util {
6
+ /** Delta-tűrés (% alatti változás "stable"-nek számít). Default 5%. */
7
+ static defaultStableTolerancePercent = 5;
8
+ /**
9
+ * Összevet két CWV-JSON-report-ot.
10
+ *
11
+ * @param oldReport — előző (baseline) report
12
+ * @param newReport — új (current) report
13
+ * @param tolerance — % alatti változás "stable". Default `defaultStableTolerancePercent`.
14
+ */
15
+ static compareReports(oldReport, newReport, tolerance = DyE2E_CWVComparison_Util.defaultStableTolerancePercent) {
16
+ const metrics = [
17
+ cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp,
18
+ cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.cls,
19
+ cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.inp,
20
+ cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.ttfb,
21
+ cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.fcp,
22
+ ];
23
+ const result = [];
24
+ for (const metric of metrics) {
25
+ const oldP75 = oldReport.summary?.[metric]?.p75 ?? NaN;
26
+ const newP75 = newReport.summary?.[metric]?.p75 ?? NaN;
27
+ if (!isFinite(oldP75) || !isFinite(newP75)) {
28
+ continue;
29
+ }
30
+ const delta = newP75 - oldP75;
31
+ const deltaPercent = oldP75 > 0 ? (delta / oldP75) * 100 : 0;
32
+ const status = Math.abs(deltaPercent) <= tolerance ? 'stable' :
33
+ delta < 0 ? 'improved' :
34
+ 'regressed';
35
+ result.push({ metric, oldP75, newP75, delta, deltaPercent, status });
36
+ }
37
+ return result;
38
+ }
39
+ /** Csak a regresszióknak a leírása (kiemelve). */
40
+ static regressionsOnly(comparisons) {
41
+ return comparisons.filter((c) => c.status === 'regressed');
42
+ }
43
+ /** Ember-olvasható összegzés markdown-tablázatra. */
44
+ static formatMarkdownTable(comparisons) {
45
+ if (comparisons.length === 0) {
46
+ return '_No comparable metrics._';
47
+ }
48
+ const header = '| Metric | Old p75 | New p75 | Delta | Δ% | Status |\n|---|---|---|---|---|---|';
49
+ const rows = comparisons.map((c) => {
50
+ const unit = c.metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.cls ? '' : 'ms';
51
+ const icon = c.status === 'improved' ? '🟢' :
52
+ c.status === 'regressed' ? '🔴' : '⚪';
53
+ return `| ${c.metric.toUpperCase()} | ${c.oldP75.toFixed(2)}${unit} | ${c.newP75.toFixed(2)}${unit} | ${c.delta.toFixed(2)}${unit} | ${c.deltaPercent.toFixed(1)}% | ${icon} ${c.status} |`;
54
+ });
55
+ return `${header}\n${rows.join('\n')}`;
56
+ }
57
+ }
58
+ exports.DyE2E_CWVComparison_Util = DyE2E_CWVComparison_Util;
59
+ //# sourceMappingURL=cwv-comparison.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cwv-comparison.util.js","sourceRoot":"","sources":["../../../../src/_modules/cwv/_collections/cwv-comparison.util.ts"],"names":[],"mappings":";;;AAAA,sFAAmF;AA4BnF,MAAa,wBAAwB;IAEnC,uEAAuE;IACvE,MAAM,CAAC,6BAA6B,GAAW,CAAC,CAAC;IAEjD;;;;;;OAMG;IACH,MAAM,CAAC,cAAc,CACnB,SAAgC,EAChC,SAAgC,EAChC,YAAoB,wBAAwB,CAAC,6BAA6B;QAE1E,MAAM,OAAO,GAA2B;YACtC,2CAAoB,CAAC,GAAG;YACxB,2CAAoB,CAAC,GAAG;YACxB,2CAAoB,CAAC,GAAG;YACxB,2CAAoB,CAAC,IAAI;YACzB,2CAAoB,CAAC,GAAG;SACzB,CAAC;QACF,MAAM,MAAM,GAAkC,EAAE,CAAC;QACjD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAW,SAAS,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,GAAG,CAAC;YAC/D,MAAM,MAAM,GAAW,SAAS,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,GAAG,CAAC;YAC/D,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MA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CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;YACxC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC;QAC9L,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IACzC,CAAC;;AA5DH,4DA6DC"}
@@ -0,0 +1,37 @@
1
+ import { DyE2E_CWVMetric_Type } from '../../contracts/_enums/cwv-metric-type.enum';
2
+ import { DyE2E_CWVThresholds_Interface } from '../../contracts/_models/interfaces/cwv-thresholds.interface';
3
+ import { DyE2E_CWVMeasurement_DataModel } from '../_models/cwv-measurement.data-model';
4
+ /**
5
+ * MP-05/Wave-3 — Attribution-based diagnose util.
6
+ *
7
+ * Bemenet: measurement-tömb + thresholds. Kimenet: human-readable diagnose
8
+ * sorok — "LCP p75 = 4200ms (cél: 2500ms). A leglassabb LCP target:
9
+ * `IMG#hero-banner`. Optimalizálás: preload + dimension-set."
10
+ */
11
+ export interface DyE2E_CWVDiagnose_Hint {
12
+ metric: DyE2E_CWVMetric_Type;
13
+ /** A measured p75 érték. */
14
+ p75: number;
15
+ /** A threshold (ha definiált). */
16
+ threshold?: number;
17
+ /** A legrosszabb futás target-info (a `measurement.attribution`-ből). */
18
+ worstTarget?: string;
19
+ /** Human-readable summary. */
20
+ summary: string;
21
+ /** Optimalizálási javaslat. */
22
+ suggestion: string;
23
+ }
24
+ export declare class DyE2E_CWVDiagnose_Util {
25
+ /**
26
+ * Per-metric percentile-számolás (lásd `DyE2E_CWVAggregator_Util` is —
27
+ * itt egy-self-contained verzió a diagnose-flow-hoz).
28
+ */
29
+ private static percentile;
30
+ /** Diagnose egy metricre — visszaadja a hint-et vagy null-t ha nincs adat. */
31
+ static diagnoseMetric(measurements: DyE2E_CWVMeasurement_DataModel[], metric: DyE2E_CWVMetric_Type, thresholds: DyE2E_CWVThresholds_Interface): DyE2E_CWVDiagnose_Hint | null;
32
+ /** Diagnose minden metric-re egyszerre. */
33
+ static diagnoseAll(measurements: DyE2E_CWVMeasurement_DataModel[], thresholds: DyE2E_CWVThresholds_Interface): DyE2E_CWVDiagnose_Hint[];
34
+ /** Egy metric-szintű optimalizálási javaslat. */
35
+ private static suggest;
36
+ }
37
+ //# sourceMappingURL=cwv-diagnose.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cwv-diagnose.util.d.ts","sourceRoot":"","sources":["../../../../src/_modules/cwv/_collections/cwv-diagnose.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,6BAA6B,EAAE,MAAM,6DAA6D,CAAC;AAC5G,OAAO,EAAE,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;AAEvF;;;;;;GAMG;AAEH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,4BAA4B;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;CACpB;AASD,qBAAa,sBAAsB;IAEjC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAiBzB,8EAA8E;IAC9E,MAAM,CAAC,cAAc,CACnB,YAAY,EAAE,8BAA8B,EAAE,EAC9C,MAAM,EAAE,oBAAoB,EAC5B,UAAU,EAAE,6BAA6B,GACxC,sBAAsB,GAAG,IAAI;IAkDhC,2CAA2C;IAC3C,MAAM,CAAC,WAAW,CAChB,YAAY,EAAE,8BAA8B,EAAE,EAC9C,UAAU,EAAE,6BAA6B,GACxC,sBAAsB,EAAE;IAa3B,iDAAiD;IACjD,OAAO,CAAC,MAAM,CAAC,OAAO;CA0BvB"}
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyE2E_CWVDiagnose_Util = void 0;
4
+ const cwv_metric_type_enum_1 = require("../../contracts/_enums/cwv-metric-type.enum");
5
+ const LCP_SUGGESTIONS = {
6
+ IMG: 'IMG → preload + explicit width/height + responsive-srcset',
7
+ VIDEO: 'VIDEO → poster-image + preload="metadata"',
8
+ H1: 'H1 → font-display:swap + preload critical CSS',
9
+ DIV: 'DIV background-image → image preload + CSS containment',
10
+ };
11
+ class DyE2E_CWVDiagnose_Util {
12
+ /**
13
+ * Per-metric percentile-számolás (lásd `DyE2E_CWVAggregator_Util` is —
14
+ * itt egy-self-contained verzió a diagnose-flow-hoz).
15
+ */
16
+ static percentile(values, p) {
17
+ if (values.length === 0) {
18
+ return NaN;
19
+ }
20
+ const sorted = [...values].sort((a, b) => a - b);
21
+ if (sorted.length === 1) {
22
+ return sorted[0];
23
+ }
24
+ const rank = p * (sorted.length - 1);
25
+ const lo = Math.floor(rank);
26
+ const hi = Math.ceil(rank);
27
+ if (lo === hi) {
28
+ return sorted[lo];
29
+ }
30
+ return sorted[lo] * (1 - (rank - lo)) + sorted[hi] * (rank - lo);
31
+ }
32
+ /** Diagnose egy metricre — visszaadja a hint-et vagy null-t ha nincs adat. */
33
+ static diagnoseMetric(measurements, metric, thresholds) {
34
+ const filtered = measurements.filter((m) => m.metric === metric);
35
+ if (filtered.length === 0) {
36
+ return null;
37
+ }
38
+ const values = filtered.map((m) => m.value);
39
+ const p75 = DyE2E_CWVDiagnose_Util.percentile(values, 0.75);
40
+ // Az "legrosszabb" futás attribution-ja a target-info forrása.
41
+ const worst = filtered.reduce((acc, m) => m.value > acc.value ? m : acc, filtered[0]);
42
+ const worstTarget = typeof worst.attribution?.element === 'string'
43
+ ? worst.attribution.element
44
+ : typeof worst.attribution?.target === 'string'
45
+ ? worst.attribution.target
46
+ : undefined;
47
+ const thresholdKey = metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp ? 'lcp_p75_ms' :
48
+ metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.cls ? 'cls_p75' :
49
+ metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.inp ? 'inp_p75_ms' :
50
+ metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.ttfb ? 'ttfb_p75_ms' :
51
+ metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.fcp ? 'fcp_p75_ms' :
52
+ 'lcp_p75_ms';
53
+ const threshold = thresholds[thresholdKey];
54
+ const fails = typeof threshold === 'number' && p75 > threshold;
55
+ const suggestion = DyE2E_CWVDiagnose_Util.suggest(metric, worstTarget, fails);
56
+ const summary = `${metric.toUpperCase()} p75 = ${p75.toFixed(2)}${metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.cls ? '' : 'ms'}${typeof threshold === 'number' ? ` (cél: ${threshold}${metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.cls ? '' : 'ms'})` : ''}${fails ? ' ⚠️ FAIL' : ''}${worstTarget ? `. Legrosszabb target: \`${worstTarget}\`` : ''}.`;
57
+ return {
58
+ metric: metric,
59
+ p75: p75,
60
+ threshold: threshold,
61
+ worstTarget: worstTarget,
62
+ summary: summary,
63
+ suggestion: suggestion,
64
+ };
65
+ }
66
+ /** Diagnose minden metric-re egyszerre. */
67
+ static diagnoseAll(measurements, thresholds) {
68
+ const metrics = [
69
+ cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp,
70
+ cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.cls,
71
+ cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.inp,
72
+ cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.ttfb,
73
+ cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.fcp,
74
+ ];
75
+ return metrics
76
+ .map((m) => DyE2E_CWVDiagnose_Util.diagnoseMetric(measurements, m, thresholds))
77
+ .filter((h) => h !== null);
78
+ }
79
+ /** Egy metric-szintű optimalizálási javaslat. */
80
+ static suggest(metric, target, fails) {
81
+ if (!fails) {
82
+ return 'OK — threshold tartva.';
83
+ }
84
+ if (metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp && target) {
85
+ // Az IMG/H1/DIV stb. prefixet vegye ki
86
+ const tag = target.split(/[#.]/)[0].toUpperCase();
87
+ return LCP_SUGGESTIONS[tag] ?? `LCP target ${target} — optimalizálás: preload + critical CSS + lazy-load other content`;
88
+ }
89
+ if (metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp) {
90
+ return 'LCP — preload critical resources + reduce render-blocking JS + use CDN';
91
+ }
92
+ if (metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.cls) {
93
+ return 'CLS — set explicit dimensions on IMG/IFRAME/AD-slots + avoid font-swap layout-shift + use `font-display: optional`';
94
+ }
95
+ if (metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.inp) {
96
+ return 'INP — break up long tasks (yield to main thread) + remove unused JS + defer non-critical interactivity';
97
+ }
98
+ if (metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.ttfb) {
99
+ return 'TTFB — server-side caching + CDN + reduce DB query time + edge-deploy';
100
+ }
101
+ if (metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.fcp) {
102
+ return 'FCP — inline critical CSS + preconnect to third-party origins + reduce render-blocking JS';
103
+ }
104
+ return 'Optimalizálási javaslat — lásd web.dev metric-specific docs.';
105
+ }
106
+ }
107
+ exports.DyE2E_CWVDiagnose_Util = DyE2E_CWVDiagnose_Util;
108
+ //# sourceMappingURL=cwv-diagnose.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cwv-diagnose.util.js","sourceRoot":"","sources":["../../../../src/_modules/cwv/_collections/cwv-diagnose.util.ts"],"names":[],"mappings":";;;AAAA,sFAAmF;AA0BnF,MAAM,eAAe,GAA2B;IAC9C,GAAG,EAAE,2DAA2D;IAChE,KAAK,EAAE,2CAA2C;IAClD,EAAE,EAAE,+CAA+C;IACnD,GAAG,EAAE,wDAAwD;CAC9D,CAAC;AAEF,MAAa,sBAAsB;IAEjC;;;OAGG;IACK,MAAM,CAAC,UAAU,CAAC,MAAgB,EAAE,CAAS;QACnD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,GAAG,CAAC;QACb,CAAC;QACD,MAAM,MAAM,GAAa,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAS,EAAE,CAAS,EAAU,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACnF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;QACD,MAAM,IAAI,GAAW,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC7C,MAAM,EAAE,GAAW,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpC,MAAM,EAAE,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACd,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC;QACD,OAAO,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,C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;QACD,IAAI,MAAM,KAAK,2CAAoB,CAAC,GAAG,EAAE,CAAC;YACxC,OAAO,2FAA2F,CAAC;QACrG,CAAC;QACD,OAAO,8DAA8D,CAAC;IACxE,CAAC;CACF;AA1HD,wDA0HC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cwv-comparison.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cwv-comparison.spec.d.ts","sourceRoot":"","sources":["../../../src/_modules/cwv/cwv-comparison.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const cwv_metric_type_enum_1 = require("../contracts/_enums/cwv-metric-type.enum");
4
+ const cwv_comparison_util_1 = require("./_collections/cwv-comparison.util");
5
+ describe('| dynamo-e2e | CWV Comparison Util (Wave-3)', () => {
6
+ it('| ures report-ok → [] (nincs metric)', () => {
7
+ const result = cwv_comparison_util_1.DyE2E_CWVComparison_Util.compareReports({}, {});
8
+ expect(result.length).toBe(0);
9
+ });
10
+ it('| stable: ±5% alatti változás', () => {
11
+ const oldR = { summary: { lcp: { p75: 2000 } } };
12
+ const newR = { summary: { lcp: { p75: 2080 } } };
13
+ const result = cwv_comparison_util_1.DyE2E_CWVComparison_Util.compareReports(oldR, newR);
14
+ expect(result[0].status).toBe('stable');
15
+ });
16
+ it('| improved: >5% csökkenés', () => {
17
+ const oldR = { summary: { lcp: { p75: 2000 } } };
18
+ const newR = { summary: { lcp: { p75: 1500 } } };
19
+ const result = cwv_comparison_util_1.DyE2E_CWVComparison_Util.compareReports(oldR, newR);
20
+ expect(result[0].status).toBe('improved');
21
+ expect(result[0].delta).toBe(-500);
22
+ });
23
+ it('| regressed: >5% növekedés', () => {
24
+ const oldR = { summary: { lcp: { p75: 2000 } } };
25
+ const newR = { summary: { lcp: { p75: 3000 } } };
26
+ const result = cwv_comparison_util_1.DyE2E_CWVComparison_Util.compareReports(oldR, newR);
27
+ expect(result[0].status).toBe('regressed');
28
+ expect(result[0].deltaPercent).toBe(50);
29
+ });
30
+ it('| custom tolerance — 1% strict mode', () => {
31
+ const oldR = { summary: { lcp: { p75: 2000 } } };
32
+ const newR = { summary: { lcp: { p75: 2050 } } };
33
+ const result = cwv_comparison_util_1.DyE2E_CWVComparison_Util.compareReports(oldR, newR, 1);
34
+ expect(result[0].status).toBe('regressed');
35
+ });
36
+ it('| több metric egyszerre', () => {
37
+ const oldR = { summary: { lcp: { p75: 2000 }, cls: { p75: 0.05 }, inp: { p75: 150 } } };
38
+ const newR = { summary: { lcp: { p75: 2100 }, cls: { p75: 0.20 }, inp: { p75: 100 } } };
39
+ const result = cwv_comparison_util_1.DyE2E_CWVComparison_Util.compareReports(oldR, newR);
40
+ expect(result.length).toBe(3);
41
+ const lcp = result.find(r => r.metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp);
42
+ const cls = result.find(r => r.metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.cls);
43
+ const inp = result.find(r => r.metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.inp);
44
+ expect(lcp?.status).toBe('stable');
45
+ expect(cls?.status).toBe('regressed');
46
+ expect(inp?.status).toBe('improved');
47
+ });
48
+ it('| regressionsOnly — szűr', () => {
49
+ const oldR = { summary: { lcp: { p75: 2000 }, cls: { p75: 0.05 } } };
50
+ const newR = { summary: { lcp: { p75: 3000 }, cls: { p75: 0.05 } } };
51
+ const result = cwv_comparison_util_1.DyE2E_CWVComparison_Util.compareReports(oldR, newR);
52
+ const regressions = cwv_comparison_util_1.DyE2E_CWVComparison_Util.regressionsOnly(result);
53
+ expect(regressions.length).toBe(1);
54
+ expect(regressions[0].metric).toBe(cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp);
55
+ });
56
+ it('| formatMarkdownTable — header + row markdown', () => {
57
+ const oldR = { summary: { lcp: { p75: 2000 } } };
58
+ const newR = { summary: { lcp: { p75: 3000 } } };
59
+ const result = cwv_comparison_util_1.DyE2E_CWVComparison_Util.compareReports(oldR, newR);
60
+ const md = cwv_comparison_util_1.DyE2E_CWVComparison_Util.formatMarkdownTable(result);
61
+ expect(md).toContain('| Metric | Old p75 | New p75 | Delta | Δ% | Status |');
62
+ expect(md).toContain('LCP');
63
+ expect(md).toContain('🔴');
64
+ expect(md).toContain('regressed');
65
+ });
66
+ it('| formatMarkdownTable — üres → "_No comparable metrics._"', () => {
67
+ const md = cwv_comparison_util_1.DyE2E_CWVComparison_Util.formatMarkdownTable([]);
68
+ expect(md).toBe('_No comparable metrics._');
69
+ });
70
+ it('| NaN p75 → metric kihagyva', () => {
71
+ const oldR = { summary: { lcp: { p75: 2000 }, cls: {} } };
72
+ const newR = { summary: { lcp: { p75: 2100 }, cls: { p75: 0.1 } } };
73
+ const result = cwv_comparison_util_1.DyE2E_CWVComparison_Util.compareReports(oldR, newR);
74
+ expect(result.length).toBe(1); // csak lcp, mert cls.oldP75 NaN
75
+ });
76
+ });
77
+ //# sourceMappingURL=cwv-comparison.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cwv-comparison.spec.js","sourceRoot":"","sources":["../../../src/_modules/cwv/cwv-comparison.spec.ts"],"names":[],"mappings":";;AAAA,mFAAgF;AAChF,4EAAqG;AAErG,QAAQ,CAAC,6CAA6C,EAAE,GAAS,EAAE;IAEjE,EAAE,CAAC,sCAAsC,EAAE,GAAS,EAAE;QACpD,MAAM,MAAM,GAAG,8CAAwB,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC/D,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+BAA+B,EAAE,GAAS,EAAE;QAC7C,MAAM,IAAI,GAA0B,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QACxE,MAAM,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EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC;QACjF,MAAM,IAAI,GAA0B,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;QAC3F,MAAM,MAAM,GAAG,8CAAwB,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACnE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,gCAAgC;IACjE,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cwv-diagnose.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cwv-diagnose.spec.d.ts","sourceRoot":"","sources":["../../../src/_modules/cwv/cwv-diagnose.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const cwv_metric_type_enum_1 = require("../contracts/_enums/cwv-metric-type.enum");
4
+ const cwv_default_thresholds_const_1 = require("../contracts/_collections/constants/cwv-default-thresholds.const");
5
+ const cwv_measurement_data_model_1 = require("./_models/cwv-measurement.data-model");
6
+ const cwv_diagnose_util_1 = require("./_collections/cwv-diagnose.util");
7
+ describe('| dynamo-e2e | CWV Diagnose Util (Wave-3)', () => {
8
+ it('| üres measurement → null', () => {
9
+ const result = cwv_diagnose_util_1.DyE2E_CWVDiagnose_Util.diagnoseMetric([], cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp, cwv_default_thresholds_const_1.CWV_GOOD_THRESHOLDS);
10
+ expect(result).toBeNull();
11
+ });
12
+ it('| LCP p75 < threshold → OK', () => {
13
+ const ms = [
14
+ new cwv_measurement_data_model_1.DyE2E_CWVMeasurement_DataModel({ metric: cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp, value: 1500, iteration: 0, route: '/x' }),
15
+ new cwv_measurement_data_model_1.DyE2E_CWVMeasurement_DataModel({ metric: cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp, value: 2000, iteration: 1, route: '/x' }),
16
+ ];
17
+ const result = cwv_diagnose_util_1.DyE2E_CWVDiagnose_Util.diagnoseMetric(ms, cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp, cwv_default_thresholds_const_1.CWV_GOOD_THRESHOLDS);
18
+ expect(result).not.toBeNull();
19
+ expect(result?.suggestion).toBe('OK — threshold tartva.');
20
+ expect(result?.summary).toContain('LCP p75');
21
+ expect(result?.summary).not.toContain('FAIL');
22
+ });
23
+ it('| LCP p75 > threshold → FAIL + suggestion', () => {
24
+ const ms = [
25
+ new cwv_measurement_data_model_1.DyE2E_CWVMeasurement_DataModel({ metric: cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp, value: 4000, iteration: 0, route: '/x' }),
26
+ new cwv_measurement_data_model_1.DyE2E_CWVMeasurement_DataModel({ metric: cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp, value: 5500, iteration: 1, route: '/x' }),
27
+ ];
28
+ const result = cwv_diagnose_util_1.DyE2E_CWVDiagnose_Util.diagnoseMetric(ms, cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp, cwv_default_thresholds_const_1.CWV_GOOD_THRESHOLDS);
29
+ expect(result?.summary).toContain('FAIL');
30
+ expect(result?.suggestion).not.toBe('OK — threshold tartva.');
31
+ });
32
+ it('| LCP target IMG → IMG-specifikus suggestion', () => {
33
+ const ms = [
34
+ new cwv_measurement_data_model_1.DyE2E_CWVMeasurement_DataModel({
35
+ metric: cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp, value: 5000, iteration: 0, route: '/x',
36
+ attribution: { element: 'IMG#hero-banner' },
37
+ }),
38
+ ];
39
+ const result = cwv_diagnose_util_1.DyE2E_CWVDiagnose_Util.diagnoseMetric(ms, cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp, cwv_default_thresholds_const_1.CWV_GOOD_THRESHOLDS);
40
+ expect(result?.worstTarget).toBe('IMG#hero-banner');
41
+ expect(result?.suggestion).toContain('preload');
42
+ });
43
+ it('| CLS p75 > 0.1 → FAIL + dimension suggestion', () => {
44
+ const ms = [
45
+ new cwv_measurement_data_model_1.DyE2E_CWVMeasurement_DataModel({ metric: cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.cls, value: 0.2, iteration: 0, route: '/x' }),
46
+ new cwv_measurement_data_model_1.DyE2E_CWVMeasurement_DataModel({ metric: cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.cls, value: 0.3, iteration: 1, route: '/x' }),
47
+ ];
48
+ const result = cwv_diagnose_util_1.DyE2E_CWVDiagnose_Util.diagnoseMetric(ms, cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.cls, cwv_default_thresholds_const_1.CWV_GOOD_THRESHOLDS);
49
+ expect(result?.summary).toContain('FAIL');
50
+ expect(result?.suggestion).toContain('dimension');
51
+ });
52
+ it('| INP p75 > 200ms → FAIL + long-task suggestion', () => {
53
+ const ms = [
54
+ new cwv_measurement_data_model_1.DyE2E_CWVMeasurement_DataModel({ metric: cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.inp, value: 500, iteration: 0, route: '/x' }),
55
+ ];
56
+ const result = cwv_diagnose_util_1.DyE2E_CWVDiagnose_Util.diagnoseMetric(ms, cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.inp, cwv_default_thresholds_const_1.CWV_GOOD_THRESHOLDS);
57
+ expect(result?.suggestion).toContain('long tasks');
58
+ });
59
+ it('| TTFB / FCP suggestion-ágak', () => {
60
+ const ttfbMs = [new cwv_measurement_data_model_1.DyE2E_CWVMeasurement_DataModel({ metric: cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.ttfb, value: 2000, iteration: 0, route: '/x' })];
61
+ const fcpMs = [new cwv_measurement_data_model_1.DyE2E_CWVMeasurement_DataModel({ metric: cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.fcp, value: 3000, iteration: 0, route: '/x' })];
62
+ const ttfb = cwv_diagnose_util_1.DyE2E_CWVDiagnose_Util.diagnoseMetric(ttfbMs, cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.ttfb, cwv_default_thresholds_const_1.CWV_GOOD_THRESHOLDS);
63
+ const fcp = cwv_diagnose_util_1.DyE2E_CWVDiagnose_Util.diagnoseMetric(fcpMs, cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.fcp, cwv_default_thresholds_const_1.CWV_GOOD_THRESHOLDS);
64
+ expect(ttfb?.suggestion).toContain('caching');
65
+ expect(fcp?.suggestion).toContain('critical CSS');
66
+ });
67
+ it('| diagnoseAll több metric-re egyszerre', () => {
68
+ const ms = [
69
+ new cwv_measurement_data_model_1.DyE2E_CWVMeasurement_DataModel({ metric: cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp, value: 1500, iteration: 0, route: '/x' }),
70
+ new cwv_measurement_data_model_1.DyE2E_CWVMeasurement_DataModel({ metric: cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.cls, value: 0.05, iteration: 0, route: '/x' }),
71
+ ];
72
+ const all = cwv_diagnose_util_1.DyE2E_CWVDiagnose_Util.diagnoseAll(ms, cwv_default_thresholds_const_1.CWV_GOOD_THRESHOLDS);
73
+ expect(all.length).toBe(2); // LCP + CLS
74
+ expect(all.find(h => h.metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.lcp)).toBeDefined();
75
+ expect(all.find(h => h.metric === cwv_metric_type_enum_1.DyE2E_CWVMetric_Type.cls)).toBeDefined();
76
+ });
77
+ });
78
+ //# sourceMappingURL=cwv-diagnose.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cwv-diagnose.spec.js","sourceRoot":"","sources":["../../../src/_modules/cwv/cwv-diagnose.spec.ts"],"names":[],"mappings":";;AAAA,m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,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,2CAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAC3E,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,2CAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC7E,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC"}
@@ -2,6 +2,8 @@
2
2
  * `@futdevpro/dynamo-e2e/cwv` — Core Web Vitals diagnostics (Wave-3).
3
3
  */
4
4
  export * from './_collections/cwv-aggregator.util';
5
+ export * from './_collections/cwv-comparison.util';
6
+ export * from './_collections/cwv-diagnose.util';
5
7
  export * from './_collections/cwv-emission.util';
6
8
  export * from './_collections/inp-interaction-script.const';
7
9
  export * from './_collections/web-vitals-page-script.const';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/_modules/cwv/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AAEtC,eAAO,MAAM,iBAAiB,EAAE,MAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/_modules/cwv/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AAEtC,eAAO,MAAM,iBAAiB,EAAE,MAAuB,CAAC"}
@@ -19,6 +19,8 @@ exports.DYE2E_CWV_VERSION = void 0;
19
19
  * `@futdevpro/dynamo-e2e/cwv` — Core Web Vitals diagnostics (Wave-3).
20
20
  */
21
21
  __exportStar(require("./_collections/cwv-aggregator.util"), exports);
22
+ __exportStar(require("./_collections/cwv-comparison.util"), exports);
23
+ __exportStar(require("./_collections/cwv-diagnose.util"), exports);
22
24
  __exportStar(require("./_collections/cwv-emission.util"), exports);
23
25
  __exportStar(require("./_collections/inp-interaction-script.const"), exports);
24
26
  __exportStar(require("./_collections/web-vitals-page-script.const"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/_modules/cwv/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,qEAAmD;AACnD,mEAAiD;AACjD,8EAA4D;AAC5D,8EAA4D;AAC5D,kDAAgC;AAChC,wDAAsC;AAEzB,QAAA,iBAAiB,GAAW,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/_modules/cwv/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,qEAAmD;AACnD,qEAAmD;AACnD,mEAAiD;AACjD,mEAAiD;AACjD,8EAA4D;AAC5D,8EAA4D;AAC5D,kDAAgC;AAChC,wDAAsC;AAEzB,QAAA,iBAAiB,GAAW,cAAc,CAAC"}