test(e2e): smoke @smoke garde la classe "page blanche une fois connecté"

Boote le VRAI App via le broker (hook Before @e2e existant), navigue vers
l'accueil connecté et asserte deux choses fortes : HomeScreen a réellement
monté (.app-navbar + bouton "Relayer", absents d'un spinner/bandeau broker)
ET aucune erreur runtime (pageerror/console.error) n'a été émise pendant le
boot connecté. Le World collecte désormais les pageErrors (réinitialisés par
scénario, logging existant préservé). Câblé dans `bun run validate` (run par
défaut) via @smoke and not @wip, avec nettoyage Chromium.

Preuve: un throw dans HomeScreen fait virer le smoke au rouge; sans lui, vert.
Comble le trou qui laissait passer la régression page-blanche (aucune suite
n'exécutait @e2e et aucune assertion ne gardait le rendu connecté).

Doctrine: bdd-testing/knowledge_e2e-layer documente le smoke @smoke + pageErrors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sylvain Duchesne
2026-07-10 19:03:21 +02:00
parent 4ffa055d62
commit 7302936502
6 changed files with 170 additions and 6 deletions
+13 -3
View File
@@ -547,6 +547,7 @@ Before({ timeout: 60000 }, async function (this: FestipodWorld, scenario) {
this.isAuthenticated = false;
this.screenSourceContent = '';
this.currentScreen = null;
this.pageErrors = [];
// Multi-browser scenarios drive their own isolated browsers via steps
// (this.openBrowser). They must NOT get the legacy single shared page.
@@ -593,10 +594,19 @@ Before({ timeout: 60000 }, async function (this: FestipodWorld, scenario) {
try { window.localStorage.setItem('festipod.account.username', u); } catch { /* opaque origin */ }
}, freshUser);
// Capture console for debugging
this.page.on('pageerror', (err) => console.error('[Browser error]', err.message));
// Capture console for debugging AND collect into the World so smoke
// scenarios can assert no runtime error was emitted during the connected
// boot (guards the "page blanche once connected" render-crash class).
const world = this;
this.page.on('pageerror', (err) => {
console.error('[Browser error]', err.message);
world.pageErrors.push(`pageerror: ${err.message}`);
});
this.page.on('console', (msg) => {
if (msg.type() === 'error') console.error('[Browser console]', msg.text());
if (msg.type() === 'error') {
console.error('[Browser console]', msg.text());
world.pageErrors.push(`console.error: ${msg.text()}`);
}
});
}
+9
View File
@@ -24,6 +24,12 @@ export interface FestipodWorld extends World {
page: Page | null;
appFrame: Frame | null;
// Runtime errors emitted by the app page during the scenario (uncaught
// `pageerror` + console.error). Collected by the Before hook so smoke
// scenarios can assert the connected app booted WITHOUT crashing the render
// (guards the "page blanche once connected" class of bug). Reset per scenario.
pageErrors: string[];
// Multi-browser (named, isolated contexts) — for cross-browser wallet tests.
// The wallet model (own vs shared) is an axis orthogonal to browser count.
browsers: Map<string, NamedBrowser>;
@@ -239,6 +245,9 @@ class CustomWorld extends World implements FestipodWorld {
page: Page | null = null;
appFrame: Frame | null = null;
// Runtime errors emitted by the app page during the scenario (see interface).
pageErrors: string[] = [];
// Multi-browser (named, isolated contexts)
browsers: Map<string, NamedBrowser> = new Map();