import { chromium } from "@playwright/test"; const b = await chromium.launch(); const p = await b.newPage({ viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true }); p.on("console", (m) => m.type() === "error" && console.log("console:", m.text().slice(0, 200))); await p.goto("http://localhost:3000/login", { waitUntil: "networkidle" }); await p.getByLabel(/email/i).fill(process.env.QA_EMAIL); await p.getByLabel(/^password$/i).fill(process.env.QA_PASSWORD); const [resp] = await Promise.all([p.waitForResponse((r) => r.url().includes("/api/auth/sign-in"), { timeout: 15000 }).catch(() => null), p.getByRole("button", { name: /sign in/i }).click()]); console.log("sign-in status:", resp?.status(), (await resp?.text())?.slice(0, 300)); await p.waitForTimeout(5000); console.log("url:", p.url()); console.log("alerts:", await p.locator('[role=alert], .text-danger').allTextContents()); await p.screenshot({ path: "qa/out/login-debug.png" }); await b.close();