import { chromium } from "playwright"; const TOK = process.argv[2]; const b = await chromium.launch(); const ctx = await b.newContext({ viewport: { width: 1440, height: 900 }, deviceScaleFactor: 1 }); const p = await ctx.newPage(); await p.goto("http://127.0.0.1:5173/"); await p.evaluate((t) => localStorage.setItem("airshelf_token", t), TOK); await p.goto("http://127.0.0.1:5173/products/new", { waitUntil: "networkidle" }); await p.waitForTimeout(800); const r = await p.evaluate(() => { const d = document.querySelector(".pc-drawer"); if (!d) return { found: false, body: document.body.className, hasLogin: !!document.querySelector(".auth-exact-page") }; const cs = getComputedStyle(d); const rect = d.getBoundingClientRect(); return { found: true, width: cs.width, transform: cs.transform, left: rect.left, right: rect.right, rectW: rect.width, cls: d.className }; }); console.log(JSON.stringify(r, null, 2)); await b.close();