ModelPhotoDemoPage variant A/B pixel-restored to model-photo-demo-a/b.html (product rail + model grid + batch result cards / task-stream layout). Sibling AssetFactoryPage/ImageWorkbenchPage untouched. + QA: shot-aitools.mjs / shot-pipeline.mjs. verified: tsc --noEmit clean; A/B + model-photo screenshots match. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
20 lines
1.1 KiB
JavaScript
20 lines
1.1 KiB
JavaScript
import { chromium } from "playwright";
|
|
import { mkdirSync } from "node:fs";
|
|
const BASE = "http://127.0.0.1:5180", API = "http://127.0.0.1:8010";
|
|
const OUT = process.argv[2] || "shots-aitools";
|
|
mkdirSync(OUT, { recursive: true });
|
|
const tok = (await (await fetch(`${API}/api/auth/login/`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ username: "airshelf", password: "Restraint2026" }) })).json()).token;
|
|
const pages = [["model-photo", "/model-photo"], ["platform-cover", "/platform-cover"], ["demo-a", "/model-photo/demo-a"], ["demo-b", "/model-photo/demo-b"]];
|
|
const browser = await chromium.launch();
|
|
const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 }, deviceScaleFactor: 1 });
|
|
await ctx.addInitScript((t) => localStorage.setItem("airshelf_token", t), tok);
|
|
const page = await ctx.newPage();
|
|
for (const [name, route] of pages) {
|
|
await page.goto(BASE + route, { waitUntil: "networkidle", timeout: 30000 });
|
|
await page.waitForTimeout(1500);
|
|
await page.screenshot({ path: `${OUT}/${name}.png`, fullPage: true });
|
|
console.log("shot", name);
|
|
}
|
|
await browser.close();
|
|
console.log("DONE");
|