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