import { chromium } from "@playwright/test"; (async () => { const b = await chromium.launch(); const p = await b.newPage(); try { await p.goto("http://localhost:5265/login"); console.log("✓ 1. Login page loaded"); // Submit login await p.fill("input[name=\"username\"]", "admin"); await p.fill("input[name=\"password\"]", "admin"); await p.click("button[type=\"submit\"]"); console.log("✓ 2. Login submitted"); // Wait for navigation try { await p.waitForNavigation({ waitUntil: "load", timeout: 6000 }); } catch { } // Check cookies const cookies = await p.context().cookies(); const hasAuthCookie = cookies.some(c => c.name === "quant_auth_token"); console.log(`✓ 3. Auth cookie: ${hasAuthCookie ? "YES" : "NO"}`); const url = p.url(); const content = await p.content(); console.log(`\n📍 Final URL: ${url}`); if (url.includes("/dashboard")) { if (content.includes("ęī€ëĶŽėž ëŒ€ė‹œëģī드")) { console.log("✓✓✓ SUCCESS: Dashboard fully loaded!"); } else if (content.includes("Not Found")) { console.log("✗ Dashboard URL but Not Found error"); } else { console.log("✓ Dashboard page (content varies)"); } } else if (url.includes("/login")) { console.log("⚠ Back at login (auth failed)"); } else { console.log("? Other page"); } await p.screenshot({ path: "./final-login-test.png" }); } catch (e) { console.error("Error:", e.message.substring(0, 50)); } await b.close(); })();