import { chromium } from '@playwright/test';
const b = await chromium.launch();
const pg = await b.newPage({ viewport: { width: 390, height: 844 } });
await pg.goto('http://127.0.0.1:4179/');
await pg.waitForFunction(() => window.__game !== undefined);
await pg.waitForTimeout(400);
await pg.screenshot({ path: '/tmp/shot-title.png' });
await pg.keyboard.press('Space');
await pg.waitForTimeout(900);
await pg.screenshot({ path: '/tmp/shot-vestibule.png' });
// balcony / chimney area
await pg.evaluate(() => window.__game.teleport('vestibule', 210, 840));
await pg.waitForTimeout(800);
await pg.screenshot({ path: '/tmp/shot-chimney.png' });
await pg.evaluate(() => window.__game.teleport('archive', 200, 500));
await pg.waitForTimeout(800);
await pg.screenshot({ path: '/tmp/shot-archive.png' });
await pg.evaluate(() => window.__game.teleport('shaft', 195, 1000));
await pg.waitForTimeout(800);
await pg.screenshot({ path: '/tmp/shot-shaft.png' });
await pg.evaluate(() => window.__game.teleport('orrery'));
await pg.waitForTimeout(2600);
await pg.screenshot({ path: '/tmp/shot-boss.png' });
await b.close();
