import { chromium } from "playwright"; const b = await chromium.launch({ headless: true, args: ["--host-resolver-rules=MAP canvas.flow-master.ai 65.21.71.186", "--ignore-certificate-errors"], }); const ctx = await b.newContext({ viewport: { width: 1440, height: 900 } }); const p = await ctx.newPage(); await p.goto("https://canvas.flow-master.ai/", { waitUntil: "networkidle" }); await p.waitForTimeout(2000); // Sign in first await p.locator("input[type='email']").fill("dev@flow-master.ai"); const devBtn = p.locator("button", { hasText: /developer|dev-login/i }); if (await devBtn.count() > 0) await devBtn.click(); await p.waitForTimeout(2500); console.log("after login theme:", await p.evaluate(() => document.documentElement.dataset.theme)); console.log("after login body bg:", await p.evaluate(() => getComputedStyle(document.body).backgroundColor)); const toggle = p.locator(".theme-toggle, .link-btn.theme-toggle, button[aria-label*='theme']").first(); const count = await toggle.count(); console.log("toggle count:", count); if (count > 0) { await toggle.click(); await p.waitForTimeout(800); console.log("after click theme:", await p.evaluate(() => document.documentElement.dataset.theme)); console.log("after click body bg:", await p.evaluate(() => getComputedStyle(document.body).backgroundColor)); } await b.close();