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()); }); const res = await page.goto('http://localhost/geograsim/App/teacher'); await page.waitForTimeout(1000); const r = await page.evaluate(() => { const tabs = [...document.querySelectorAll('#tab-bar .tab')].map(t => t.textContent.trim()); let toggle = null; try { toggle = (typeof _liveToggleHtml === 'function') ? _liveToggleHtml() : null; } catch(e){ toggle = 'ERR:'+e.message; } return { tabLabels: tabs, hasSetLiveMode: typeof setLiveMode === 'function', hasRenderGesamt: typeof renderLiveGesamt === 'function', hasQualityBar: typeof _liveQualityBar === 'function', qualitySample: (typeof _liveQualityBar === 'function') ? _liveQualityBar(8,2) : null, toggleHasGesamt: (typeof toggle === 'string') ? toggle.includes('Gesamt') : toggle, toggleHasTag: (typeof toggle === 'string') ? toggle.includes('Tag') : toggle, }; }); console.log(JSON.stringify({ httpStatus: res.status(), result: r, pageErrors: errors }, null, 2)); await browser.close(); })();