Files
sql-server-query-ai/scripts/e2e-debug.mjs
T

25 lines
1.4 KiB
JavaScript

import { chromium } from "@playwright/test";
const b = await chromium.launch();
const page = await (await b.newContext()).newPage();
page.on("console", (m) => console.log("QAI console", m.type(), m.text().slice(0, 200)));
page.on("pageerror", (e) => console.log("QAI pageerror", String(e).slice(0, 300)));
await page.goto("http://localhost:3000/signup");
await page.fill("#email", `dbg4328+${Date.now()}@qai.test`);
await page.fill("#password", "playwright password");
await page.getByRole("button", { name: "Create account" }).click();
await page.waitForTimeout(3000);
console.log("QAI url after signup", page.url());
console.log("QAI body after signup", (await page.locator("body").innerText()).replace(/\n+/g, " | ").slice(0, 260));
console.log("QAI cookie", (await page.context().cookies()).map(c=>c.name+"="+c.value.slice(0,8)).join(","));
await page.getByRole("link", { name: "Next" }).click();
await page.waitForTimeout(2000);
await page.fill("#analyst_base_url", "http://192.168.88.131:8888/v1");
await page.fill("#analyst_key", "EMPTY");
await page.fill("#analyst_model", "qwen3.8-flash-next");
await page.fill("#jev_key", "ts-test-key");
await page.getByRole("button", { name: "Save" }).click();
await page.waitForTimeout(4000);
console.log("QAI url after save", page.url());
console.log("QAI body", (await page.locator("body").innerText()).replace(/\n+/g, " | ").slice(0, 320));
await b.close();