import { chromium } from "playwright"; const b = await chromium.launch({ headless: true }); const p = await b.newPage({ viewport: { width: 1440, height: 900 } }); const errors = []; p.on("pageerror", e => errors.push(`pageerror ${e.message}`)); p.on("console", m => { if (m.type() === "error") errors.push(`console.error ${m.text().slice(0, 200)}`); }); await p.goto("http://127.0.0.1:5173", { waitUntil: "networkidle" }); await p.locator(".sc-card").first().click(); await p.waitForSelector(".mc"); await p.waitForTimeout(400); // Open console first await p.locator(".link-btn", { hasText: "Console" }).first().click(); await p.waitForSelector(".console"); // Toggle live await p.locator(".mode-toggle").first().click(); await p.waitForTimeout(6000); // let all calls land const callCount = await p.locator(".call").count(); console.log("api calls logged:", callCount); const firstCall = await p.locator(".call-head").first(); if (await firstCall.count()) { console.log("first call:", await firstCall.innerText()); } // Click a call to expand if (callCount > 0) { await p.locator(".call-head").first().click(); await p.waitForTimeout(300); console.log("expanded has body:", await p.locator(".call-body").first().isVisible()); } // Sign in via settings await p.locator(".tab", { hasText: "Settings" }).click(); await p.waitForSelector(".settings"); await p.waitForTimeout(300); const userBtn = p.locator(".quick-users .link-btn", { hasText: "dev@flow-master.ai" }).first(); console.log("settings quick-user:", await userBtn.isVisible()); console.log("\nconsole errors:", errors.length); errors.slice(0, 5).forEach(e => console.log(" -", e)); await p.screenshot({ path: "qa/screenshots/v3-console-open.png", fullPage: false }); await b.close();