const { chromium } = require('@playwright/test'); (async () => { const b = await chromium.launch(); const p = await b.newPage({ viewport:{width:1180,height:820} }); const errs=[]; p.on('pageerror',e=>errs.push(e.message)); p.on('console',m=>{if(m.type()==='error')errs.push(m.text());}); await p.goto('http://localhost/geograsim/App/sims/tourismusregion/game.html'); await p.waitForTimeout(1500); await p.click('.map-btn'); // Route klicken → Spiel startet → Willkommenskarte await p.waitForTimeout(2000); const r = await p.evaluate(() => { const card = document.getElementById('cardText'); const txt = card ? card.textContent : ''; return { started: !!window.__ttState, cardHasEnvText: /Umwelt ist deine Landschaft/.test(txt), cardHasNaturschutz: /Naturschutzgebiet/.test(txt), envKpi: document.getElementById('kEnv')?.textContent, }; }); console.log(JSON.stringify({ result:r, pageErrors: errs.filter(e=>!/404|Failed to load resource/.test(e)) }, null, 2)); await b.close(); })();