// @ts-check const { test, expect } = require('@playwright/test'); const paths = require('../../fixtures/known-paths.json'); /** * Stufe 1 · Sim-Plattform-Kontext * * Pro aktive Sim: * - window.__GGS__ ist gesetzt mit den richtigen Feldern * (sessionId / simId / baseUrl / basePath / apiUrl) — das ist der * Regressionstest gegen den Weltküche-Bug vom 2026-06-10 (Wrapper * injizierte WK_* statt __GGS__). * - live-client.js wird geladen (per Script-Tag oder __GGS_LIVE_INITIALIZED__). * - window.GGS_LIVE_STATE existiert als Funktion (nicht hart erforderlich * bei jeder Sim, aber wir reporten welche es nicht haben). */ for (const sim of paths.sims_wrapper.active) { test(`Sim ${sim} · __GGS__ + live-client + GGS_LIVE_STATE`, async ({ page }) => { await page.goto(`/${sim}`); // 1) __GGS__ muss existieren und simId enthalten const ctx = await page.evaluate(() => { // @ts-ignore return window['__GGS__'] || null; }); expect(ctx, `__GGS__ fehlt in ${sim}`).not.toBeNull(); expect(ctx.simId, `__GGS__.simId fehlt in ${sim}`).toBeTruthy(); // baseUrl muss zumindest als String existieren (kann leer sein auf Prod) expect(typeof ctx.baseUrl, `__GGS__.baseUrl fehlt in ${sim}`).toBe('string'); // 2) live-client-Script muss geladen sein (entweder als