import { chromium } from 'playwright'; const url = process.argv[2] || 'http://localhost:4173/top/'; const out = process.argv[3] || '/tmp/bisk_shot.png'; const b = await chromium.launch(); const p = await b.newPage({ viewport: { width: 1500, height: 950 } }); p.on('console', m => console.log('CONSOLE', m.type(), m.text().slice(0,200))); p.on('pageerror', e => console.log('PAGEERROR', e.message.slice(0,200))); p.on('requestfailed', r => console.log('REQFAIL', r.url().slice(0,80), r.failure()?.errorText)); await p.goto(url, { waitUntil: 'load' }); await p.waitForTimeout(6500); await p.screenshot({ path: out }); console.log('BALLS', await p.evaluate(() => globalThis.pit?.['balls']?.length)); console.log('STATUS', await p.evaluate(() => document.querySelector('#status')?.textContent)); await b.close();