22 lines
996 B
JavaScript
22 lines
996 B
JavaScript
import { chromium } from "playwright";
|
|
|
|
const base = process.env.TESSERA_URL ?? "http://127.0.0.1:8787/";
|
|
const outFlow =
|
|
process.env.FLOW_SHOT ?? "/cursor/stores/self/media/tessera-galaxy-flow-polish.png";
|
|
const outLock =
|
|
process.env.LOCK_SHOT ?? "/cursor/stores/self/media/tessera-galaxy-locked-polish.png";
|
|
|
|
const browser = await chromium.launch({ headless: true });
|
|
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
|
|
await page.goto(base, { waitUntil: "networkidle", timeout: 30_000 });
|
|
await page.waitForTimeout(2500);
|
|
await page.screenshot({ path: outFlow, fullPage: false });
|
|
const svg = page.locator('[aria-label="Galaxy vault viewport"]');
|
|
const box = await svg.boundingBox();
|
|
if (!box) throw new Error("galaxy svg not found");
|
|
await page.mouse.click(box.x + box.width / 2, box.y + box.height / 2);
|
|
await page.waitForTimeout(1400);
|
|
await page.screenshot({ path: outLock, fullPage: false });
|
|
await browser.close();
|
|
console.log("saved", outFlow, outLock);
|