Initialize fork and rebrand app to event_manager
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

This commit is contained in:
2026-05-11 09:56:57 +02:00
parent f82bb803ac
commit 786cbc724f
500 changed files with 41152 additions and 2 deletions
+59
View File
@@ -0,0 +1,59 @@
import { test, expect } from "@playwright/test";
import { LoginPage } from "../pages";
import { isLoggedIn } from "../helpers";
/**
* Tests for authentication that already have auth state from setup.
*/
test.describe("Authentication - Pre-authenticated", () => {
test("should access event_manager when authenticated", async ({ page }) => {
// Already authenticated via setup project
await page.goto("/dashboard/");
await page.waitForLoadState("networkidle");
// Should not be redirected to login
await expect(page).not.toHaveURL(/.*login.*/);
});
test("should verify session via API", async ({ request }) => {
// Already authenticated via setup project
const loggedIn = await isLoggedIn(request);
expect(loggedIn).toBe(true);
});
});
/**
* Tests for authentication that need fresh (unauthenticated) state.
* Uses storageState reset to clear any auth cookies.
*/
test.describe("Authentication - Fresh state", () => {
// Reset storage state to test without authentication
test.use({ storageState: { cookies: [], origins: [] } });
test("should login via UI", async ({ page }) => {
const loginPage = new LoginPage(page);
await loginPage.login(process.env.FRAPPE_USER || "Administrator", process.env.FRAPPE_PASSWORD || "admin");
// Should be redirected away from login
await expect(page).not.toHaveURL(/.*login.*/);
});
test("should show error for invalid credentials", async ({ page }) => {
const loginPage = new LoginPage(page);
await loginPage.goto();
await loginPage.fillCredentials("invalid@example.com", "wrongpassword");
await loginPage.submit();
// Should stay on login page
await loginPage.expectToBeOnLoginPage();
});
test("should show login button when not authenticated", async ({ page }) => {
await page.goto("/dashboard");
await page.waitForLoadState("networkidle");
await expect(page.getByRole("button", { name: "Log In" }).first()).toBeVisible();
});
});