@futdevpro/dynamo-e2e 1.18.37 → 1.18.39
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/CHANGELOG.md +41 -0
- package/README.md +23 -0
- package/build/_modules/ui-check/_collections/constants/ui-check-page-scripts.const.d.ts.map +1 -1
- package/build/_modules/ui-check/_collections/constants/ui-check-page-scripts.const.js +45 -2
- package/build/_modules/ui-check/_collections/constants/ui-check-page-scripts.const.js.map +1 -1
- package/build/_modules/ui-check/_collections/detectors/dead-control.detector.d.ts +0 -2
- package/build/_modules/ui-check/_collections/detectors/dead-control.detector.d.ts.map +1 -1
- package/build/_modules/ui-check/_collections/detectors/dead-control.detector.js +2 -10
- package/build/_modules/ui-check/_collections/detectors/dead-control.detector.js.map +1 -1
- package/build/_modules/ui-check/_collections/detectors/error-destination.detector.d.ts +53 -0
- package/build/_modules/ui-check/_collections/detectors/error-destination.detector.d.ts.map +1 -0
- package/build/_modules/ui-check/_collections/detectors/error-destination.detector.js +203 -0
- package/build/_modules/ui-check/_collections/detectors/error-destination.detector.js.map +1 -0
- package/build/_modules/ui-check/_collections/ui-check-default-detectors.const.d.ts +4 -0
- package/build/_modules/ui-check/_collections/ui-check-default-detectors.const.d.ts.map +1 -1
- package/build/_modules/ui-check/_collections/ui-check-default-detectors.const.js +6 -0
- package/build/_modules/ui-check/_collections/ui-check-default-detectors.const.js.map +1 -1
- package/build/_modules/ui-check/_collections/ui-check-guard.util.d.ts.map +1 -1
- package/build/_modules/ui-check/_collections/ui-check-guard.util.js +3 -0
- package/build/_modules/ui-check/_collections/ui-check-guard.util.js.map +1 -1
- package/build/_modules/ui-check/_collections/ui-check-page.util.d.ts +9 -2
- package/build/_modules/ui-check/_collections/ui-check-page.util.d.ts.map +1 -1
- package/build/_modules/ui-check/_collections/ui-check-page.util.js +15 -3
- package/build/_modules/ui-check/_collections/ui-check-page.util.js.map +1 -1
- package/build/_modules/ui-check/index.d.ts +1 -0
- package/build/_modules/ui-check/index.d.ts.map +1 -1
- package/build/_modules/ui-check/index.js +1 -0
- package/build/_modules/ui-check/index.js.map +1 -1
- package/build/_modules/visual-gate/_collections/blocking-overlays.util.d.ts +63 -0
- package/build/_modules/visual-gate/_collections/blocking-overlays.util.d.ts.map +1 -0
- package/build/_modules/visual-gate/_collections/blocking-overlays.util.js +104 -0
- package/build/_modules/visual-gate/_collections/blocking-overlays.util.js.map +1 -0
- package/build/_modules/visual-gate/_collections/visual-gate-defaults.const.d.ts +13 -0
- package/build/_modules/visual-gate/_collections/visual-gate-defaults.const.d.ts.map +1 -0
- package/build/_modules/visual-gate/_collections/visual-gate-defaults.const.js +28 -0
- package/build/_modules/visual-gate/_collections/visual-gate-defaults.const.js.map +1 -0
- package/build/_modules/visual-gate/_collections/visual-gate.util.d.ts +76 -0
- package/build/_modules/visual-gate/_collections/visual-gate.util.d.ts.map +1 -0
- package/build/_modules/visual-gate/_collections/visual-gate.util.js +153 -0
- package/build/_modules/visual-gate/_collections/visual-gate.util.js.map +1 -0
- package/build/_modules/visual-gate/_models/visual-gate-case.interface.d.ts +14 -0
- package/build/_modules/visual-gate/_models/visual-gate-case.interface.d.ts.map +1 -0
- package/build/_modules/visual-gate/_models/visual-gate-case.interface.js +3 -0
- package/build/_modules/visual-gate/_models/visual-gate-case.interface.js.map +1 -0
- package/build/_modules/visual-gate/_models/visual-gate-finding.interface.d.ts +11 -0
- package/build/_modules/visual-gate/_models/visual-gate-finding.interface.d.ts.map +1 -0
- package/build/_modules/visual-gate/_models/visual-gate-finding.interface.js +3 -0
- package/build/_modules/visual-gate/_models/visual-gate-finding.interface.js.map +1 -0
- package/build/_modules/visual-gate/_models/visual-gate-language.interface.d.ts +8 -0
- package/build/_modules/visual-gate/_models/visual-gate-language.interface.d.ts.map +1 -0
- package/build/_modules/visual-gate/_models/visual-gate-language.interface.js +3 -0
- package/build/_modules/visual-gate/_models/visual-gate-language.interface.js.map +1 -0
- package/build/_modules/visual-gate/_models/visual-gate-layout.interface.d.ts +14 -0
- package/build/_modules/visual-gate/_models/visual-gate-layout.interface.d.ts.map +1 -0
- package/build/_modules/visual-gate/_models/visual-gate-layout.interface.js +3 -0
- package/build/_modules/visual-gate/_models/visual-gate-layout.interface.js.map +1 -0
- package/build/_modules/visual-gate/_models/visual-gate-page.interface.d.ts +10 -0
- package/build/_modules/visual-gate/_models/visual-gate-page.interface.d.ts.map +1 -0
- package/build/_modules/visual-gate/_models/visual-gate-page.interface.js +3 -0
- package/build/_modules/visual-gate/_models/visual-gate-page.interface.js.map +1 -0
- package/build/_modules/visual-gate/_models/visual-gate-viewport.interface.d.ts +8 -0
- package/build/_modules/visual-gate/_models/visual-gate-viewport.interface.d.ts.map +1 -0
- package/build/_modules/visual-gate/_models/visual-gate-viewport.interface.js +3 -0
- package/build/_modules/visual-gate/_models/visual-gate-viewport.interface.js.map +1 -0
- package/build/_modules/visual-gate/index.d.ts +15 -0
- package/build/_modules/visual-gate/index.d.ts.map +1 -0
- package/build/_modules/visual-gate/index.js +31 -0
- package/build/_modules/visual-gate/index.js.map +1 -0
- package/build/index.js +1 -1
- package/package.json +10 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyE2E_VisualGate_Util = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
const blocking_overlays_util_1 = require("./blocking-overlays.util");
|
|
6
|
+
const visual_gate_defaults_const_1 = require("./visual-gate-defaults.const");
|
|
7
|
+
/**
|
|
8
|
+
* The visual regression gate (R1-72 d; owner, 2026-11-02 21:39: the credit login "badly out of shape", "a review tool
|
|
9
|
+
* is needed"): the key pages, HU + EN, 1440 + 390, red in the CI when a page falls apart or disappears.
|
|
10
|
+
*
|
|
11
|
+
* @description Two checks per page, the cheap and certain one first: (1) a layout check in the browser — the TEST
|
|
12
|
+
* warning or the cookie bar still covers the page, the page shows (almost) nothing, or it is wider than the screen;
|
|
13
|
+
* (2) a screenshot comparison against the product's committed baseline (Playwright `toHaveScreenshot`; the first run,
|
|
14
|
+
* or `--update-snapshots`, writes it).
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { DyE2E_BlockingOverlays_Util, DyE2E_VisualGate_Util } from '@futdevpro/dynamo-e2e/visual-gate';
|
|
18
|
+
*
|
|
19
|
+
* for (const gateCase of DyE2E_VisualGate_Util.cases({ pages: [ { name: 'home', path: '/' } ] })) {
|
|
20
|
+
* test(`| visual: ${gateCase.id}`, async ({ browser }) => {
|
|
21
|
+
* const { storageState } = await DyE2E_BlockingOverlays_Util.prepareStorageState({
|
|
22
|
+
* browser, baseUrl: BASE_URL, locale: gateCase.language.locale,
|
|
23
|
+
* });
|
|
24
|
+
* const context = await browser.newContext({ storageState, locale: gateCase.language.locale,
|
|
25
|
+
* viewport: { width: gateCase.viewport.width, height: gateCase.viewport.height } });
|
|
26
|
+
* const page = await context.newPage();
|
|
27
|
+
*
|
|
28
|
+
* await page.goto(BASE_URL + gateCase.page.path);
|
|
29
|
+
* await DyE2E_VisualGate_Util.assertPage(page, gateCase);
|
|
30
|
+
* });
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
class DyE2E_VisualGate_Util {
|
|
35
|
+
/** Browser-side layout measurement: a function expression, evaluated through `page.evaluate` (DOM APIs only). */
|
|
36
|
+
static measureLayoutScript = `() => {
|
|
37
|
+
const root = document.documentElement;
|
|
38
|
+
const viewportWidth = root.clientWidth;
|
|
39
|
+
let visibleTextLength = 0;
|
|
40
|
+
let visibleElementCount = 0;
|
|
41
|
+
let widestOverflow = null;
|
|
42
|
+
let widestRight = viewportWidth;
|
|
43
|
+
for (const el of Array.from(document.body ? document.body.querySelectorAll('*') : [])) {
|
|
44
|
+
const style = getComputedStyle(el);
|
|
45
|
+
if (style.display === 'none' || style.visibility === 'hidden' || Number(style.opacity) === 0) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const rect = el.getBoundingClientRect();
|
|
49
|
+
if (rect.width < 1 || rect.height < 1) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
visibleElementCount++;
|
|
53
|
+
for (const node of Array.from(el.childNodes)) {
|
|
54
|
+
if (node.nodeType === 3) {
|
|
55
|
+
visibleTextLength += node.textContent.trim().length;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const right = rect.right + window.scrollX;
|
|
59
|
+
if (right > widestRight + 1 && style.position !== 'fixed') {
|
|
60
|
+
widestRight = right;
|
|
61
|
+
const cls = typeof el.className === 'string' ? el.className.trim().split(/\\s+/).slice(0, 2).join('.') : '';
|
|
62
|
+
widestOverflow = el.tagName.toLowerCase() + (cls ? '.' + cls : '') + ' (' + Math.round(right) + ' px)';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
viewportWidth: viewportWidth,
|
|
67
|
+
scrollWidth: root.scrollWidth,
|
|
68
|
+
widestOverflow: widestOverflow,
|
|
69
|
+
visibleTextLength: visibleTextLength,
|
|
70
|
+
visibleElementCount: visibleElementCount,
|
|
71
|
+
};
|
|
72
|
+
}`;
|
|
73
|
+
/**
|
|
74
|
+
* The check matrix: every page in every language at every screen size.
|
|
75
|
+
*
|
|
76
|
+
* @returns one case per page × language × viewport, ids `<page>-<language>-<viewport>`
|
|
77
|
+
*/
|
|
78
|
+
static cases(set) {
|
|
79
|
+
const gateCases = [];
|
|
80
|
+
for (const page of set.pages) {
|
|
81
|
+
for (const language of set.languages ?? visual_gate_defaults_const_1.DyE2E_VisualGateDefaults_Const.languages) {
|
|
82
|
+
for (const viewport of set.viewports ?? visual_gate_defaults_const_1.DyE2E_VisualGateDefaults_Const.viewports) {
|
|
83
|
+
const id = `${page.name}-${language.code}-${viewport.name}`;
|
|
84
|
+
gateCases.push({ id: id, page: page, language: language, viewport: viewport, snapshotName: `${id}.png` });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (new Set(gateCases.map((gateCase) => gateCase.id)).size
|
|
89
|
+
!== gateCases.length) {
|
|
90
|
+
throw new Error('[dynamo-e2e visual-gate] two pages, languages or viewports share a name');
|
|
91
|
+
}
|
|
92
|
+
return gateCases;
|
|
93
|
+
}
|
|
94
|
+
/** Measures what the page shows (after the fonts are loaded). */
|
|
95
|
+
static async measureLayout(page) {
|
|
96
|
+
await page.evaluate('document.fonts ? document.fonts.ready.then(() => true) : true');
|
|
97
|
+
return page.evaluate(`(${this.measureLayoutScript})()`);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Judges a measured layout.
|
|
101
|
+
*
|
|
102
|
+
* @returns `page-empty` (it disappeared) and / or `horizontal-overflow` (it fell apart); empty when healthy
|
|
103
|
+
*/
|
|
104
|
+
static checkLayout(layout, limits = {}) {
|
|
105
|
+
const findings = [];
|
|
106
|
+
const minText = limits.minVisibleTextLength ?? visual_gate_defaults_const_1.DyE2E_VisualGateDefaults_Const.minVisibleTextLength;
|
|
107
|
+
const minElements = limits.minVisibleElementCount ?? visual_gate_defaults_const_1.DyE2E_VisualGateDefaults_Const.minVisibleElementCount;
|
|
108
|
+
const tolerance = limits.overflowTolerancePx ?? visual_gate_defaults_const_1.DyE2E_VisualGateDefaults_Const.overflowTolerancePx;
|
|
109
|
+
if (layout.visibleTextLength < minText || layout.visibleElementCount < minElements) {
|
|
110
|
+
findings.push({
|
|
111
|
+
kind: 'page-empty',
|
|
112
|
+
message: `the page shows almost nothing: ${layout.visibleTextLength} characters, `
|
|
113
|
+
+ `${layout.visibleElementCount} elements (at least ${minText} / ${minElements})`,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
if (layout.scrollWidth > layout.viewportWidth + tolerance) {
|
|
117
|
+
findings.push({
|
|
118
|
+
kind: 'horizontal-overflow',
|
|
119
|
+
message: `the page is ${layout.scrollWidth} px wide on a ${layout.viewportWidth} px screen`
|
|
120
|
+
+ (layout.widestOverflow ? `; widest: ${layout.widestOverflow}` : ''),
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return findings;
|
|
124
|
+
}
|
|
125
|
+
/** The cheap checks of one page: overlays still covering it + the layout. */
|
|
126
|
+
static async inspect(page, limits = {}) {
|
|
127
|
+
const findings = (await blocking_overlays_util_1.DyE2E_BlockingOverlays_Util.findVisible(page))
|
|
128
|
+
.map((name) => ({
|
|
129
|
+
kind: 'blocking-overlay', message: `${name} covers the page (close it first: DyE2E_BlockingOverlays_Util)`,
|
|
130
|
+
}));
|
|
131
|
+
return findings.concat(this.checkLayout(await this.measureLayout(page), limits));
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* The gate for one case, inside a Playwright test: the cheap checks first (a finding fails the test with its
|
|
135
|
+
* reason), then the screenshot comparison against the baseline `<case id>.png`.
|
|
136
|
+
*/
|
|
137
|
+
static async assertPage(page, gateCase, options = {}) {
|
|
138
|
+
const findings = await this.inspect(page, options);
|
|
139
|
+
if (findings.length) {
|
|
140
|
+
throw new Error(`[dynamo-e2e visual-gate] ${gateCase.id} (${page.url()}):\n`
|
|
141
|
+
+ findings.map((finding) => `- ${finding.kind}: ${finding.message}`).join('\n'));
|
|
142
|
+
}
|
|
143
|
+
await (0, test_1.expect)(page).toHaveScreenshot(gateCase.snapshotName, {
|
|
144
|
+
fullPage: true,
|
|
145
|
+
animations: 'disabled',
|
|
146
|
+
caret: 'hide',
|
|
147
|
+
maxDiffPixelRatio: options.maxDiffPixelRatio ?? visual_gate_defaults_const_1.DyE2E_VisualGateDefaults_Const.maxDiffPixelRatio,
|
|
148
|
+
mask: (gateCase.page.mask ?? []).map((selector) => page.locator(selector)),
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
exports.DyE2E_VisualGate_Util = DyE2E_VisualGate_Util;
|
|
153
|
+
//# sourceMappingURL=visual-gate.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-gate.util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C,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,QAAgB,EAAW,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SAC5F,CAAC,CAAC;IACL,CAAC;;AAjJH,sDAkJC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DyE2E_VisualGateLanguage_Interface } from './visual-gate-language.interface';
|
|
2
|
+
import { DyE2E_VisualGatePage_Interface } from './visual-gate-page.interface';
|
|
3
|
+
import { DyE2E_VisualGateViewport_Interface } from './visual-gate-viewport.interface';
|
|
4
|
+
/** One check of the visual gate: a page, in one language, at one screen size. */
|
|
5
|
+
export interface DyE2E_VisualGateCase_Interface {
|
|
6
|
+
/** `<page>-<language>-<viewport>`, unique within the matrix. */
|
|
7
|
+
id: string;
|
|
8
|
+
page: DyE2E_VisualGatePage_Interface;
|
|
9
|
+
language: DyE2E_VisualGateLanguage_Interface;
|
|
10
|
+
viewport: DyE2E_VisualGateViewport_Interface;
|
|
11
|
+
/** The baseline file name of the screenshot comparison (`<id>.png`). */
|
|
12
|
+
snapshotName: string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=visual-gate-case.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-gate-case.interface.d.ts","sourceRoot":"","sources":["../../../../src/_modules/visual-gate/_models/visual-gate-case.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,kCAAkC,CAAC;AACtF,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,kCAAkC,EAAE,MAAM,kCAAkC,CAAC;AAEtF,iFAAiF;AACjF,MAAM,WAAW,8BAA8B;IAC7C,gEAAgE;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,8BAA8B,CAAC;IACrC,QAAQ,EAAE,kCAAkC,CAAC;IAC7C,QAAQ,EAAE,kCAAkC,CAAC;IAC7C,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-gate-case.interface.js","sourceRoot":"","sources":["../../../../src/_modules/visual-gate/_models/visual-gate-case.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** A reason the visual gate fails a page before (or instead of) the screenshot comparison. */
|
|
2
|
+
export interface DyE2E_VisualGateFinding_Interface {
|
|
3
|
+
/**
|
|
4
|
+
* `blocking-overlay`: the TEST warning or the cookie bar covers the page (the screenshot would show them);
|
|
5
|
+
* `page-empty`: the page shows (almost) nothing — it disappeared; `horizontal-overflow`: the page is wider than the
|
|
6
|
+
* screen — it fell apart.
|
|
7
|
+
*/
|
|
8
|
+
kind: 'blocking-overlay' | 'page-empty' | 'horizontal-overflow';
|
|
9
|
+
message: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=visual-gate-finding.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-gate-finding.interface.d.ts","sourceRoot":"","sources":["../../../../src/_modules/visual-gate/_models/visual-gate-finding.interface.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,MAAM,WAAW,iCAAiC;IAChD;;;;OAIG;IACH,IAAI,EAAE,kBAAkB,GAAG,YAAY,GAAG,qBAAqB,CAAC;IAChE,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-gate-finding.interface.js","sourceRoot":"","sources":["../../../../src/_modules/visual-gate/_models/visual-gate-finding.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** A language of the visual gate: the page is opened in a browser of this locale. */
|
|
2
|
+
export interface DyE2E_VisualGateLanguage_Interface {
|
|
3
|
+
/** Short code (`hu`, `en`) — part of the snapshot name. */
|
|
4
|
+
code: string;
|
|
5
|
+
/** The browser locale (`hu-HU`, `en-US`): the FDP language service follows it when nothing is stored. */
|
|
6
|
+
locale: string;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=visual-gate-language.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-gate-language.interface.d.ts","sourceRoot":"","sources":["../../../../src/_modules/visual-gate/_models/visual-gate-language.interface.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,WAAW,kCAAkC;IACjD,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,yGAAyG;IACzG,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-gate-language.interface.js","sourceRoot":"","sources":["../../../../src/_modules/visual-gate/_models/visual-gate-language.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** What the page shows, measured in the browser (`DyE2E_VisualGate_Util.measureLayout`). */
|
|
2
|
+
export interface DyE2E_VisualGateLayout_Interface {
|
|
3
|
+
/** The width of the viewport (the document element's client width), px. */
|
|
4
|
+
viewportWidth: number;
|
|
5
|
+
/** The width of the scrollable document, px: wider than the viewport ⇒ the page scrolls sideways. */
|
|
6
|
+
scrollWidth: number;
|
|
7
|
+
/** The widest element that sticks out of the viewport (tag + class), or `null`. */
|
|
8
|
+
widestOverflow: string | null;
|
|
9
|
+
/** The number of characters of the visible text. */
|
|
10
|
+
visibleTextLength: number;
|
|
11
|
+
/** The number of visible elements with a size. */
|
|
12
|
+
visibleElementCount: number;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=visual-gate-layout.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-gate-layout.interface.d.ts","sourceRoot":"","sources":["../../../../src/_modules/visual-gate/_models/visual-gate-layout.interface.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,MAAM,WAAW,gCAAgC;IAC/C,2EAA2E;IAC3E,aAAa,EAAE,MAAM,CAAC;IACtB,qGAAqG;IACrG,WAAW,EAAE,MAAM,CAAC;IACpB,mFAAmF;IACnF,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,oDAAoD;IACpD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kDAAkD;IAClD,mBAAmB,EAAE,MAAM,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-gate-layout.interface.js","sourceRoot":"","sources":["../../../../src/_modules/visual-gate/_models/visual-gate-layout.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** A key page of the product the visual gate checks (R1-72 d). */
|
|
2
|
+
export interface DyE2E_VisualGatePage_Interface {
|
|
3
|
+
/** Short, file-name safe name (`home`, `login`) — part of the snapshot name. */
|
|
4
|
+
name: string;
|
|
5
|
+
/** The path from the base URL (`/`, `/login`). */
|
|
6
|
+
path: string;
|
|
7
|
+
/** Selectors of changing parts (a date, a version number) that the screenshot comparison masks. */
|
|
8
|
+
mask?: string[];
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=visual-gate-page.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-gate-page.interface.d.ts","sourceRoot":"","sources":["../../../../src/_modules/visual-gate/_models/visual-gate-page.interface.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,MAAM,WAAW,8BAA8B;IAC7C,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,mGAAmG;IACnG,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-gate-page.interface.js","sourceRoot":"","sources":["../../../../src/_modules/visual-gate/_models/visual-gate-page.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** A screen size of the visual gate. */
|
|
2
|
+
export interface DyE2E_VisualGateViewport_Interface {
|
|
3
|
+
/** Short name (`desktop`, `mobile`) — part of the snapshot name. */
|
|
4
|
+
name: string;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=visual-gate-viewport.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-gate-viewport.interface.d.ts","sourceRoot":"","sources":["../../../../src/_modules/visual-gate/_models/visual-gate-viewport.interface.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,MAAM,WAAW,kCAAkC;IACjD,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-gate-viewport.interface.js","sourceRoot":"","sources":["../../../../src/_modules/visual-gate/_models/visual-gate-viewport.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@futdevpro/dynamo-e2e/visual-gate` — the visual regression gate (R1-72 d): close the TEST warning and the cookie
|
|
3
|
+
* bar, then check the key pages (HU + EN, 1440 + 390) — red when a page falls apart, disappears or changes.
|
|
4
|
+
* The `/vqa` layer collects evidence for a reviewer, `/ui-check` presses controls; this layer judges the look.
|
|
5
|
+
*/
|
|
6
|
+
export * from './_collections/blocking-overlays.util';
|
|
7
|
+
export * from './_collections/visual-gate-defaults.const';
|
|
8
|
+
export * from './_collections/visual-gate.util';
|
|
9
|
+
export * from './_models/visual-gate-case.interface';
|
|
10
|
+
export * from './_models/visual-gate-finding.interface';
|
|
11
|
+
export * from './_models/visual-gate-language.interface';
|
|
12
|
+
export * from './_models/visual-gate-layout.interface';
|
|
13
|
+
export * from './_models/visual-gate-page.interface';
|
|
14
|
+
export * from './_models/visual-gate-viewport.interface';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/_modules/visual-gate/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,0CAA0C,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* `@futdevpro/dynamo-e2e/visual-gate` — the visual regression gate (R1-72 d): close the TEST warning and the cookie
|
|
19
|
+
* bar, then check the key pages (HU + EN, 1440 + 390) — red when a page falls apart, disappears or changes.
|
|
20
|
+
* The `/vqa` layer collects evidence for a reviewer, `/ui-check` presses controls; this layer judges the look.
|
|
21
|
+
*/
|
|
22
|
+
__exportStar(require("./_collections/blocking-overlays.util"), exports);
|
|
23
|
+
__exportStar(require("./_collections/visual-gate-defaults.const"), exports);
|
|
24
|
+
__exportStar(require("./_collections/visual-gate.util"), exports);
|
|
25
|
+
__exportStar(require("./_models/visual-gate-case.interface"), exports);
|
|
26
|
+
__exportStar(require("./_models/visual-gate-finding.interface"), exports);
|
|
27
|
+
__exportStar(require("./_models/visual-gate-language.interface"), exports);
|
|
28
|
+
__exportStar(require("./_models/visual-gate-layout.interface"), exports);
|
|
29
|
+
__exportStar(require("./_models/visual-gate-page.interface"), exports);
|
|
30
|
+
__exportStar(require("./_models/visual-gate-viewport.interface"), exports);
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/_modules/visual-gate/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,wEAAsD;AACtD,4EAA0D;AAC1D,kEAAgD;AAChD,uEAAqD;AACrD,0EAAwD;AACxD,2EAAyD;AACzD,yEAAuD;AACvD,uEAAqD;AACrD,2EAAyD"}
|
package/build/index.js
CHANGED
|
@@ -26,5 +26,5 @@ __exportStar(require("./_modules/game/index"), exports);
|
|
|
26
26
|
__exportStar(require("./_modules/ui-check/index"), exports);
|
|
27
27
|
__exportStar(require("./_modules/coverage/index"), exports);
|
|
28
28
|
/** Package-version stamp — npm-publish-time runtime-érték. */
|
|
29
|
-
exports.DYE2E_PACKAGE_VERSION = '01.18.
|
|
29
|
+
exports.DYE2E_PACKAGE_VERSION = '01.18.39';
|
|
30
30
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futdevpro/dynamo-e2e",
|
|
3
|
-
"version": "01.18.
|
|
3
|
+
"version": "01.18.39",
|
|
4
4
|
"description": "End-to-end testing engine for the Dynamo + FDP ecosystem — auto-generated form-coverage tests, viewport audit matrix, CWV diagnostics. Settings-POJO-first.",
|
|
5
5
|
"DyBu_settings": {
|
|
6
6
|
"packageType": "core-package",
|
|
@@ -102,6 +102,12 @@
|
|
|
102
102
|
"types": "./build/_modules/ui-check/index.d.ts",
|
|
103
103
|
"typings": "./build/_modules/ui-check/index.d.ts"
|
|
104
104
|
},
|
|
105
|
+
"./visual-gate": {
|
|
106
|
+
"default": "./build/_modules/visual-gate/index.js",
|
|
107
|
+
"module": "./build/_modules/visual-gate/index.js",
|
|
108
|
+
"types": "./build/_modules/visual-gate/index.d.ts",
|
|
109
|
+
"typings": "./build/_modules/visual-gate/index.d.ts"
|
|
110
|
+
},
|
|
105
111
|
"./game": {
|
|
106
112
|
"default": "./build/_modules/game/index.js",
|
|
107
113
|
"module": "./build/_modules/game/index.js",
|
|
@@ -132,6 +138,9 @@
|
|
|
132
138
|
"ui-check": [
|
|
133
139
|
"build/_modules/ui-check/index.d.ts"
|
|
134
140
|
],
|
|
141
|
+
"visual-gate": [
|
|
142
|
+
"build/_modules/visual-gate/index.d.ts"
|
|
143
|
+
],
|
|
135
144
|
"game": [
|
|
136
145
|
"build/_modules/game/index.d.ts"
|
|
137
146
|
]
|