@futdevpro/fdp-e2e-helpers 1.15.21 → 1.15.22
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.
|
@@ -21,4 +21,30 @@ export interface FDP_AuthFormsE2E_Options {
|
|
|
21
21
|
* ezért érdemes E2E-vel őrizni. A fogyasztó: `FDP_buildAuthFormsE2E({ loginRoute, registerRoute })`.
|
|
22
22
|
*/
|
|
23
23
|
export declare function FDP_buildAuthFormsE2E(opts: FDP_AuthFormsE2E_Options): void;
|
|
24
|
+
/** A `FDP_buildRobustnessE2E` opciói. */
|
|
25
|
+
export interface FDP_RobustnessE2E_Options {
|
|
26
|
+
/** A publikus landing-oldal route-ja (console-health + page-title check). Pl. `/landing`. */
|
|
27
|
+
landingRoute: string;
|
|
28
|
+
/** Egy AUTH-GUARD-dal védett route, ami unauthentikáltan máshová redirect-el. Pl. `/main`. Ha nincs megadva → a guard-teszt kimarad. */
|
|
29
|
+
protectedRoute?: string;
|
|
30
|
+
/** Egy biztosan NEM létező route a 404/not-found-kezelés tesztelésére. Default: `/nonexistent-route-xyz-12345`. */
|
|
31
|
+
unknownRoute?: string;
|
|
32
|
+
/** A not-found-redirect URL-jében elvárt jelölő (a routing `**` → not-found). Default: `not-found`. */
|
|
33
|
+
notFoundIndicator?: string;
|
|
34
|
+
/** A védett route pathname-töredéke, aminek a redirect UTÁN NEM szabad benne lennie az URL-ben. Default: a `protectedRoute` `/`-ek nélkül. */
|
|
35
|
+
protectedPathFragment?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Beregisztrálja a **production-readiness robusztussági smoke-okat** (no-auth, no-spend) — minden frontendes
|
|
39
|
+
* rendszerre újrahasználható (master-prompter, futdevpro, token-service, niche-datasets-space, …). Ezek a
|
|
40
|
+
* meglévő public/nav-smoke-ot egészítik ki az auth/spend nélkül is ellenőrizhető viselkedésekkel:
|
|
41
|
+
* - **auth-guard**: a védett route unauthentikáltan NEM marad elérhető (redirect),
|
|
42
|
+
* - **404-graceful**: ismeretlen route → not-found (nem törött oldal),
|
|
43
|
+
* - **console-health**: a landing KRITIKUS JS-hiba nélkül tölt be,
|
|
44
|
+
* - **page-title**: van title (alap struktúra/SEO).
|
|
45
|
+
*
|
|
46
|
+
* Egy törött guard / fehér-képernyős JS-crash = launch-blokkoló, ezért érdemes E2E-vel őrizni. A logika a
|
|
47
|
+
* master-prompter `robustness.spec`-jéből emelve (live test-env-en zöldre futtatva), parametrizálva.
|
|
48
|
+
*/
|
|
49
|
+
export declare function FDP_buildRobustnessE2E(opts: FDP_RobustnessE2E_Options): void;
|
|
24
50
|
//# sourceMappingURL=fdp-browser-e2e.util.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FDP_buildAuthFormsE2E = FDP_buildAuthFormsE2E;
|
|
4
|
+
exports.FDP_buildRobustnessE2E = FDP_buildRobustnessE2E;
|
|
4
5
|
const test_1 = require("@playwright/test");
|
|
5
6
|
/**
|
|
6
7
|
* Beregisztrálja a **standard auth-UI form-struktúra** smoke-okat (no-auth, no-spend): a login + register oldal
|
|
@@ -33,4 +34,60 @@ function FDP_buildAuthFormsE2E(opts) {
|
|
|
33
34
|
});
|
|
34
35
|
});
|
|
35
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Beregisztrálja a **production-readiness robusztussági smoke-okat** (no-auth, no-spend) — minden frontendes
|
|
39
|
+
* rendszerre újrahasználható (master-prompter, futdevpro, token-service, niche-datasets-space, …). Ezek a
|
|
40
|
+
* meglévő public/nav-smoke-ot egészítik ki az auth/spend nélkül is ellenőrizhető viselkedésekkel:
|
|
41
|
+
* - **auth-guard**: a védett route unauthentikáltan NEM marad elérhető (redirect),
|
|
42
|
+
* - **404-graceful**: ismeretlen route → not-found (nem törött oldal),
|
|
43
|
+
* - **console-health**: a landing KRITIKUS JS-hiba nélkül tölt be,
|
|
44
|
+
* - **page-title**: van title (alap struktúra/SEO).
|
|
45
|
+
*
|
|
46
|
+
* Egy törött guard / fehér-képernyős JS-crash = launch-blokkoló, ezért érdemes E2E-vel őrizni. A logika a
|
|
47
|
+
* master-prompter `robustness.spec`-jéből emelve (live test-env-en zöldre futtatva), parametrizálva.
|
|
48
|
+
*/
|
|
49
|
+
function FDP_buildRobustnessE2E(opts) {
|
|
50
|
+
const unknownRoute = opts.unknownRoute ?? '/nonexistent-route-xyz-12345';
|
|
51
|
+
const notFoundIndicator = opts.notFoundIndicator ?? 'not-found';
|
|
52
|
+
const protectedFragment = opts.protectedPathFragment ??
|
|
53
|
+
(opts.protectedRoute ? opts.protectedRoute.replace(/\//g, '') : '');
|
|
54
|
+
test_1.test.describe('Robustness — auth-guard / 404 / console-health', () => {
|
|
55
|
+
if (opts.protectedRoute) {
|
|
56
|
+
(0, test_1.test)('a védett route unauthentikáltan elnavigál (auth-guard)', async ({ page }) => {
|
|
57
|
+
await page.goto(opts.protectedRoute);
|
|
58
|
+
// a guard ASYNC lehet (silent-login check) → a redirect a bootstrap UTÁN; a pathname-et figyeljük
|
|
59
|
+
// (a query-ben benne lehet a védett route mint redirectTo). Ha sosem redirect-el → timeout → (helyes) bukás.
|
|
60
|
+
await page.waitForURL((url) => !url.pathname.replace(/\//g, '').startsWith(protectedFragment), { timeout: 15_000 });
|
|
61
|
+
(0, test_1.expect)(new URL(page.url()).pathname.replace(/\//g, '')).not.toContain(protectedFragment);
|
|
62
|
+
await (0, test_1.expect)(page.locator('body')).toBeVisible();
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
(0, test_1.test)('ismeretlen route → not-found kezelés (nem törött oldal)', async ({ page }) => {
|
|
66
|
+
await page.goto(unknownRoute);
|
|
67
|
+
await page.waitForLoadState('domcontentloaded');
|
|
68
|
+
(0, test_1.expect)(page.url()).toContain(notFoundIndicator);
|
|
69
|
+
await (0, test_1.expect)(page.locator('body')).toBeVisible();
|
|
70
|
+
});
|
|
71
|
+
(0, test_1.test)('a landing KRITIKUS JS-hiba nélkül tölt be (console-health)', async ({ page }) => {
|
|
72
|
+
const errors = [];
|
|
73
|
+
page.on('console', (msg) => {
|
|
74
|
+
if (msg.type() === 'error') {
|
|
75
|
+
errors.push(msg.text());
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
page.on('pageerror', (err) => { errors.push(err.message); });
|
|
79
|
+
await page.goto(opts.landingRoute);
|
|
80
|
+
await page.waitForLoadState('networkidle');
|
|
81
|
+
// csak a KRITIKUS JS-hibákra szigorú (a sima console.error lehet 3rd-party/analytics/404-favicon)
|
|
82
|
+
const critical = errors.filter((e) => /TypeError|ReferenceError|is not a function|is not defined/.test(e));
|
|
83
|
+
(0, test_1.expect)(critical, `Kritikus JS-hibák a betöltéskor: ${critical.join(' | ')}`).toHaveLength(0);
|
|
84
|
+
});
|
|
85
|
+
(0, test_1.test)('a betöltött oldalnak van title-je (alap struktúra/SEO)', async ({ page }) => {
|
|
86
|
+
await page.goto(opts.landingRoute);
|
|
87
|
+
await page.waitForLoadState('domcontentloaded');
|
|
88
|
+
const title = await page.title();
|
|
89
|
+
(0, test_1.expect)(title.trim().length).toBeGreaterThan(0);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
}
|
|
36
93
|
//# sourceMappingURL=fdp-browser-e2e.util.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futdevpro/fdp-e2e-helpers",
|
|
3
|
-
"version": "01.15.
|
|
3
|
+
"version": "01.15.22",
|
|
4
4
|
"description": "Shared E2E test helpers for FDP-stack apps. First util: E2E_HardDelete_Util. Stateless utility-collection — NOT a framework.",
|
|
5
5
|
"DyBu_settings": {
|
|
6
6
|
"packageType": "shared-package",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
],
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"@futdevpro/fsm-dynamo": "1.15.23",
|
|
74
|
-
"@futdevpro/nts-dynamo": "1.15.
|
|
74
|
+
"@futdevpro/nts-dynamo": "1.15.48",
|
|
75
75
|
"@playwright/test": ">=1.49.0"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
"tslib": "^2.6.2"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@futdevpro/dynamo-eslint": "1.15.
|
|
83
|
+
"@futdevpro/dynamo-eslint": "1.15.14",
|
|
84
84
|
"@futdevpro/fsm-dynamo": "1.15.23",
|
|
85
|
-
"@futdevpro/nts-dynamo": "1.15.
|
|
85
|
+
"@futdevpro/nts-dynamo": "1.15.48",
|
|
86
86
|
"@playwright/test": "^1.49.0",
|
|
87
87
|
"@types/jasmine": "^5.1.5",
|
|
88
88
|
"@typescript-eslint/eslint-plugin": "^8.41.0",
|