import { chromium } from "playwright"; const TOK = process.argv[2]; const url = process.argv[3]; 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()); }); p.on("pageerror", e => errs.push("PAGEERR: "+e.message)); await p.goto("http://127.0.0.1:5173/"); await p.evaluate((t) => localStorage.setItem("airshelf_token", t), TOK); await p.goto(url, { waitUntil: "networkidle" }); await p.waitForTimeout(600); const info = await p.evaluate(() => ({ isLogin: !!document.querySelector(".auth-exact-page"), h1: document.querySelector("h1")?.textContent?.slice(0,30), token: localStorage.getItem("airshelf_token")?.length, })); console.log(url, JSON.stringify(info), "ERRORS:", errs.slice(0,5)); await b.close();