import { expect, test } from "./utils/test"; import { getTenantCredentials, loginAsTenantUser } from "./utils/auth"; import { skipIfUnavailable } from "./utils/navigation"; import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness"; /** * Projekt-Pipeline-Smoke (R-P8a/R-P8b / DoD D.19): Login -> /projects (Kanban) * oeffnen -> Board-Toolbar sichtbar -> Suche anwenden -> Loader-Roundtrip * (Query in der URL). * * Die Route ist modul-gegated (Projekt-Connector) + permission-gegated * (projekt.read_own). Bei aktivem Modul + Berechtigung rendert sie die interim * PipelineKanbanPage mit der Board-Toolbar (`data-ui-id="ui.projects.board.toolbar"`); * die Board-Suche navigiert mit `?q=` (server-seitiger Re-Load). Skippt * ohne E2E-Credentials / wenn die Route im Environment nicht erreichbar ist * (404 bei fehlendem Modul/Recht). */ const credentials = getTenantCredentials(); const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH ?? "/app/dashboard"; const projectsPath = process.env.E2E_TENANT_PROJECTS_PATH ?? dashboardPath.replace(/\/dashboard\/?$/u, "/projects"); test.describe("projekt smoke", () => { test("renders the pipeline kanban board and applies a search", async ({ page }) => { skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD"], "Projekt smoke inputs not configured"); await loginAsTenantUser(page, credentials!); const response = await page.goto(projectsPath, { waitUntil: "domcontentloaded" }); await skipIfUnavailable(page, response, "Projects path is not reachable in this environment"); await expect(page.locator('[data-ui-id="ui.projects.board.toolbar"]')).toBeVisible(); // Main action: type a board search term and apply it. The route reflects the // query into the URL via a server-side re-load, proving the loader roundtrip. const search = page.locator('[data-ui-id="ui.projects.board.search"]'); await search.fill("smoke"); await search.press("Enter"); await page.waitForURL(/[?&]q=smoke(?:&|$)/u); await expect(page.locator('[data-ui-id="ui.projects.board.toolbar"]')).toBeVisible(); }); });