import { expect, test } from "./utils/test"; import { skipIfUnavailable } from "./utils/navigation"; /** * Public-Booking smoke (AK-P16b / DoD D.19): oeffentliche Buchungsseite * /b/{tenant}/{slug} oeffnen -> Buchungsformular sichtbar. * * Kein Login (public Route). Braucht eine published BookingPage im * Ziel-Environment; der Pfad kommt aus `E2E_PUBLIC_BOOKING_PATH` * (z.B. /b/demo-pro-crm/beratungstermin — Slug aus dem Staging-Seed * `seedDemoTenantBookingData`). Bewusst weicher Skip statt * REQUIRE_E2E_READINESS-fail-closed: die Readiness-Lane seedet (noch) * keine Booking-Fixtures. */ const bookingPath = process.env.E2E_PUBLIC_BOOKING_PATH; test.describe("public booking smoke", () => { test("renders the public booking page with the booking form", async ({ page }) => { test.skip(!bookingPath?.trim(), "E2E_PUBLIC_BOOKING_PATH not configured"); const response = await page.goto(bookingPath!, { waitUntil: "domcontentloaded" }); await skipIfUnavailable(page, response, "Public booking path is not reachable in this environment"); await expect(page.locator('[data-ui-id="ui.booking.public"]')).toBeVisible(); // Hauptaktion: das Buchungsformular (Slot-Auswahl + Submit) ist da — oder // die Seite meldet ehrlich "keine Slots" (Empty-State, DoD E.23). await expect(page.locator('[data-ui-id="ui.booking.public.form"], [data-ui-id="ui.booking.public.empty"]').first()).toBeVisible(); }); });