import { chromium } from "playwright"; const TOK = process.argv[2]; const b = await chromium.launch(); const ctx = await b.newContext({ viewport: { width: 1440, height: 900 } }); const p = await ctx.newPage(); const errs = []; p.on("console", m => { if (m.type()==="error") errs.push(m.text().slice(0,120)); }); p.on("pageerror", e => errs.push("PAGEERR: "+e.message.slice(0,150))); await p.goto("http://127.0.0.1:5173/", { waitUntil: "domcontentloaded" }); await p.evaluate((t) => localStorage.setItem("airshelf_token", t), TOK); for (const url of ["http://127.0.0.1:5173/model-photo", "http://127.0.0.1:5173/model-photo/demo-a"]) { errs.length = 0; await p.goto(url, { waitUntil: "networkidle" }); await p.waitForTimeout(700); const info = await p.evaluate(() => { const txt = document.body.innerText || ""; return { isLogin: txt.includes("AUTH/LOGIN") || txt.includes("使用团队邀请邮箱"), firstWords: txt.replace(/\s+/g," ").slice(0,80) }; }); console.log(url.split("5173")[1], JSON.stringify(info), "ERR:", errs.slice(0,3)); } await b.close();