Files
hms-licht-ton/frontend-nuxt-old/tests/e2e/equipment-detail.spec.ts
T
Agent Zero cd465e0564 feat: add MCP server with resources, tools, auth, and Traefik routing
- Add backend/app/mcp_server.py with FastMCP server (hms-cms)
- Resources: design-rules, page-structure, sync-status
- Tools: trigger_sync, get_sync_log, set_rentman_token, read_file,
  write_file, create_page, deploy, git_commit, git_status
- Bearer token auth via MCP_AUTH_TOKEN env var
- Mount MCP at /mcp with streamable HTTP transport
- Integrate session manager in FastAPI lifespan
- Add Traefik labels for external /mcp route on hms.media-on.de
- Add git, docker.io, curl to backend Dockerfile
- Mount repo root + docker socket in backend container
- Add mcp>=1.0.0 to requirements.txt
2026-07-12 15:58:22 +02:00

55 lines
2.2 KiB
TypeScript

import { test, expect } from "@playwright/test";
test.describe("Equipment Detail Page", () => {
test("should show error for non-existent ID", async ({ page }) => {
await page.goto("/mietkatalog/999999");
await expect(page.getByText("nicht gefunden")).toBeVisible();
});
test("should have link back to mietkatalog on error", async ({ page }) => {
await page.goto("/mietkatalog/999999");
const link = page.getByText("Zurück zum Mietkatalog");
await expect(link).toBeVisible();
});
test("should display breadcrumb navigation", async ({ page }) => {
await page.goto("/mietkatalog/1");
await expect(page.getByText("Home")).toBeVisible();
await expect(page.getByText("Mietkatalog")).toBeVisible();
});
test("should show equipment name as heading", async ({ page }) => {
await page.goto("/mietkatalog/1");
const name = page.getByTestId("equipment-name");
const errorState = page.getByText("nicht gefunden");
const hasContent = await name.isVisible().catch(() => false) || await errorState.isVisible().catch(() => false);
expect(hasContent).toBeTruthy();
});
test("should show specs section if equipment found", async ({ page }) => {
await page.goto("/mietkatalog/1");
const specs = page.getByTestId("equipment-specs");
const errorState = page.getByText("nicht gefunden");
const hasContent = await specs.isVisible().catch(() => false) || await errorState.isVisible().catch(() => false);
expect(hasContent).toBeTruthy();
});
test("should have Mietanfrage button", async ({ page }) => {
await page.goto("/mietkatalog/1");
const btn = page.getByTestId("add-to-cart-detail");
const errorState = page.getByText("nicht gefunden");
const hasContent = await btn.isVisible().catch(() => false) || await errorState.isVisible().catch(() => false);
expect(hasContent).toBeTruthy();
});
test("should navigate back to mietkatalog via breadcrumb", async ({ page }) => {
await page.goto("/mietkatalog/1");
const breadcrumbLink = page.locator('a[href="/mietkatalog"]').first();
if (await breadcrumbLink.isVisible()) {
await breadcrumbLink.click();
await page.waitForURL("/mietkatalog");
await expect(page).toHaveURL(/\/mietkatalog$/);
}
});
});