Files
geograsim/.dontDeploy/playwright/tr-passstrasse-check.js
T
Adminator fecd8bb9c9 Textsystem: Bis-Strich mit Leerzeichen (Zahl – Zahl) per Agent-Sweep
562 Ersetzungen in 50 Dateien: Halbgeviertstrich zwischen zwei Ziffern (=
"bis"-Bereich) bekommt Leerzeichen davor/danach (3–4 -> 3 – 4). Regex
/([0-9])\s*–\s*(?=[0-9])/ auf Rohtext (format-erhaltend, CRLF/Einrueckung
unveraendert), Bindestriche in Woertern und Minuszeichen unangetastet, alle
JSON weiter gueltig. Energiemanager-Zeitbloecke sind Display-Labels (kein
Logik-Key) -> safe.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 12:38:19 +02:00

39 lines
1.6 KiB
JavaScript

const { chromium } = require('@playwright/test');
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
const errors = [];
page.on('pageerror', e => errors.push('PAGEERROR: '+e.message));
page.on('console', m => { if (m.type()==='error') errors.push(m.text()); });
// 1) maps-custom.json direkt prüfen
const mc = await page.request.get('http://localhost/geograsim/App/sims/tourismusregion/js/maps-custom.json');
const mcJson = await mc.json();
const ps = mcJson.passstrasse || null;
// 2) Hintergrundbild erreichbar?
const img = await page.request.get('http://localhost/geograsim/App/sims/tourismusregion/assets/maps/passstrasse.png');
// 3) Sim-Startscreen laden, Kartenliste prüfen
const res = await page.goto('http://localhost/geograsim/App/sims/tourismusregion/game.html');
await page.waitForTimeout(2500);
const startInfo = await page.evaluate(() => {
const list = document.getElementById('mapList');
const labels = list ? [...list.querySelectorAll('*')].map(e=>e.textContent).filter(t=>t && t.length<40) : [];
const hasPass = !!(list && /Passstra/i.test(list.textContent||''));
return { mapListText: (list?list.textContent:'').replace(/\s+/g,' ').trim().slice(0,300), hasPass };
});
console.log(JSON.stringify({
httpStatus: res.status(),
passInMapsCustom: !!ps,
routeKeys: ps ? Object.keys(ps.routes||{}) : null,
bergaufPoints: ps && ps.routes && ps.routes.bergauf ? ps.routes.bergauf.length : null,
slotCount: ps ? (ps.slots||[]).length : null,
bgImageStatus: img.status(),
startInfo,
pageErrors: errors
}, null, 2));
await browser.close();
})();