// Wave 1 part-2 verify (scratch): S1 dashboard 橙=--heat / S8 hero 字重=700 / 截图. import { chromium } from "playwright"; import fs from "node:fs"; import path from "node:path"; const BASE = process.env.BASE || "http://localhost:5173"; const TOKEN = process.env.TOKEN || ""; const OUT = path.resolve("../../../_qa_shots/wave1b"); fs.mkdirSync(OUT, { recursive: true }); const browser = await chromium.launch({ headless: true }); const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 }, colorScheme: "light" }); const seed = await ctx.newPage(); await seed.goto(BASE + "/", { waitUntil: "domcontentloaded" }); await seed.evaluate((t) => localStorage.setItem("airshelf_token", t), TOKEN); await seed.close(); const r = {}; async function shot(route, name, fn) { const p = await ctx.newPage(); await p.goto(BASE + route, { waitUntil: "load" }); await p.waitForTimeout(1500); r[name] = await fn(p); await p.screenshot({ path: path.join(OUT, `${name}.png`) }); await p.close(); } await shot("/dashboard", "dashboard", async (p) => { const ic = p.locator(".shortcut .ic").first(); return { shortcutIcColor: await ic.evaluate((el) => getComputedStyle(el).color).catch(() => "n/a"), shortcutIcBg: await ic.evaluate((el) => getComputedStyle(el).backgroundColor).catch(() => "n/a"), tipColor: await p.locator(".tip").first().evaluate((el) => getComputedStyle(el).color).catch(() => "n/a"), }; }); await shot("/account", "account", async (p) => ({ balanceWeight: await p.locator(".balance-hero .v").first().evaluate((el) => getComputedStyle(el).fontWeight).catch(() => "n/a"), })); await shot("/team", "team", async (p) => ({ bannerNmWeight: await p.locator(".banner-id .nm").first().evaluate((el) => getComputedStyle(el).fontWeight).catch(() => "n/a"), })); await browser.close(); console.log(JSON.stringify(r, null, 2)); // 参照:--heat #fa5d19 = rgb(250, 93, 25);旧暖橙 #E55B26 = rgb(229, 91, 38)