SPB Git forge

spb/polyllm

Public
15commits 1branches 0releases
2.2 MBsize
maindefault branch
13 days agolast push
TypeScript 97.4% SQL 1% JavaScript 0.9% CSS 0.6%
975 B · 14 lines javascript
Raw Blame History
1import { chromium } from "@playwright/test";2const b = await chromium.launch(); const p = await b.newPage({ viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true });3p.on("console", (m) => m.type() === "error" && console.log("console:", m.text().slice(0, 200)));4await p.goto("http://localhost:3000/login", { waitUntil: "networkidle" });5await p.getByLabel(/email/i).fill(process.env.QA_EMAIL);6await p.getByLabel(/^password$/i).fill(process.env.QA_PASSWORD);7const [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()]);8console.log("sign-in status:", resp?.status(), (await resp?.text())?.slice(0, 300));9await p.waitForTimeout(5000);10console.log("url:", p.url());11console.log("alerts:", await p.locator('[role=alert], .text-danger').allTextContents());12await p.screenshot({ path: "qa/out/login-debug.png" });13await b.close();14