Hello from MCP server
import { chromium } from "playwright";
const browser = await chromium.launch({
headless: false, // 👈 enables full browser UI
// slowMo: 100, // optional: slows down actions for visibility
});
const page = await browser.newPage();
page.on("console", (msg) => {
console.log(`🪵 Console [${msg.type()}]: ${msg.text()}`);
});
async function register() {
const url = "http://localhost:8100/register";
await page.goto(url);
await page
.getByPlaceholder("Email", { exact: true })
.fill("user@example.com");
await page.getByPlaceholder("Password", { exact: true }).fill("0123456789");
await page
.getByPlaceholder("Confirm Password", { exact: true })
.fill("0123456789");
await page.getByRole("button").click();
await page.waitForURL("http://localhost:8100/home");
}
async function login() {
await page.goto("http://localhost:8100/login");
await page.getByPlaceholder("Email").fill("user@example.com");
await page.getByPlaceholder("Password").fill("0123456789");
await page.getByRole("button").click();
await page.waitForURL("http://localhost:8100/home");
}
async function createOrg() {
console.log("--- create org");
await page.goto("http://localhost:8100/org/create");
await page.getByPlaceholder("Name").fill(`New Org - ${Date.now()}`);
await page.getByRole("button").click();
}
// await register();
await login();
await createOrg();