import { chromium } from 'playwright'; const PORT = process.env.BRIDGE_PORT || 8099; const base = `http://localhost:${PORT}`; const browser = await chromium.launch(); const page = await browser.newPage({ viewport: { width: 1180, height: 820 }, deviceScaleFactor: 2 }); await page.goto(base, { waitUntil: 'networkidle' }); const tabs = [['pfd', 'PFD'], ['mfd', 'MFD'], ['map', 'Map'], ['fms', 'FMS'], ['ap', 'Autopilot']]; for (const [tab, label] of tabs) { await page.getByRole('button', { name: label, exact: true }).click(); await page.waitForTimeout(tab === 'map' || tab === 'pfd' ? 4000 : 700); // tiles/terrain await page.screenshot({ path: `/tmp/cockpit-${tab}.png` }); console.log(`shot: /tmp/cockpit-${tab}.png`); } await browser.close();