import { chromium } from 'playwright'
const url = 'http://localhost:5180/'
const b = await chromium.launch()
// desktop
let p = await b.newPage({ viewport: { width: 1280, height: 900 }, deviceScaleFactor: 2 })
await p.goto(url, { waitUntil: 'networkidle' }).catch(()=>{})
await p.waitForTimeout(5000)
// seek both waveforms to ~55% to light the orbit rails
for (const w of await p.$$('div[tabindex="0"] > div > div:last-child')) {
  const box = await w.boundingBox(); if (box) await p.mouse.click(box.x + box.width*0.55, box.y + box.height/2)
}
await p.waitForTimeout(800)
await p.screenshot({ path: '/tmp/armada-desktop.png', fullPage: true })
// mobile
let m = await b.newPage({ viewport: { width: 390, height: 844 }, deviceScaleFactor: 2 })
await m.goto(url, { waitUntil: 'networkidle' }).catch(()=>{})
await m.waitForTimeout(5000)
await m.screenshot({ path: '/tmp/armada-mobile.png', fullPage: true })
await b.close()
console.log('shots done')
