Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GiECd9RWGMKV7n3K1mdy8T
18 lines
1022 B
JavaScript
18 lines
1022 B
JavaScript
import { chromium } from 'playwright';
|
|
import { staticServer } from './helpers.mjs';
|
|
const server = await staticServer();
|
|
const browser = await chromium.launch({ args: ['--use-gl=angle', '--use-angle=swiftshader', '--enable-unsafe-swiftshader'] });
|
|
const page = await browser.newPage({ viewport: { width: 1280, height: 860 } });
|
|
await page.goto(`http://127.0.0.1:${server.port}/`);
|
|
await page.click('#splash'); await page.click('#new-game'); await page.click('#rione [data-rione="campomigliaio"]'); await page.click('#skip-intro');
|
|
for (const [scene, at] of JSON.parse(process.env.SPOTS)) {
|
|
await page.evaluate(async ([scene, at]) => {
|
|
const { settle } = await import('/tests/helpers.mjs');
|
|
settle(game); game.state.flags.ingorgo = true;
|
|
game.go(scene, at, 'right'); settle(game);
|
|
}, [scene, at]);
|
|
await page.waitForTimeout(1500);
|
|
await page.screenshot({ path: `${process.env.S}/folla-${scene}-${at[1]}.png`, clip: { x: 98, y: 60, width: 1084, height: 610 } });
|
|
}
|
|
await browser.close(); server.kill();
|