Files
event-manager/e2e/tests/login-modal.spec.ts
T
xadm 786cbc724f
CI / Server (push) Has been cancelled
Linters / Frappe Linter (push) Has been cancelled
Linters / Vulnerable Dependency Check (push) Has been cancelled
UI Tests / Playwright E2E Tests (push) Has been cancelled
Initialize fork and rebrand app to event_manager
2026-05-11 09:56:57 +02:00

36 lines
1.5 KiB
TypeScript

import { test, expect } from "@playwright/test";
const FRAPPE_USER = process.env.FRAPPE_USER || "Administrator";
const FRAPPE_PASSWORD = process.env.FRAPPE_PASSWORD || "admin";
test.describe("Login Modal", () => {
test.use({ storageState: { cookies: [], origins: [] } });
test("email/password login via modal", async ({ page }) => {
await page.goto("/dashboard");
await page.waitForLoadState("networkidle");
await page.getByRole("button", { name: "Log In" }).first().click();
await expect(page.getByRole("dialog")).toBeVisible();
await expect(page.getByText("Login to Continue")).toBeVisible();
await page.getByLabel("Email").fill(FRAPPE_USER);
await page.getByLabel("Password").fill(FRAPPE_PASSWORD);
await page.getByRole("button", { name: "Login", exact: true }).click();
await expect(page.getByRole("dialog")).not.toBeVisible({ timeout: 10000 });
await expect(page.getByRole("button", { name: "Log In" })).not.toBeVisible();
});
test("shows error for invalid credentials", async ({ page }) => {
await page.goto("/dashboard");
await page.waitForLoadState("networkidle");
await page.getByRole("button", { name: "Log In" }).first().click();
await expect(page.getByRole("dialog")).toBeVisible();
await page.getByLabel("Email").fill("wrong@example.com");
await page.getByLabel("Password").fill("wrongpassword");
await page.getByRole("button", { name: "Login", exact: true }).click();
await expect(page.getByRole("dialog")).toBeVisible();
await expect(page.locator(".bg-surface-red-2")).toBeVisible();
});
});