import { expect, test } from "../support/browser/strict-browser-test.ts"; /** * 1103/11-06. The preview server serves a build made from this process's * environment (playwright.config.ts webServer), and the build takes its * identity from VITE_BUILD_ID the way scripts/generate-runtime-config.ts * does: CI sets gitea--, a local run falls back to * "local-build". A fixed "local-build" failed FE-GATE-008 in every CI run. */ const EXPECTED_BUILD_ID = process.env["VITE_BUILD_ID"] || "local-build"; test("boots and navigates the compact production shell", async ({ page }) => { await page.goto("/"); await expect(page.getByRole("main")).toBeVisible(); const menu = page.getByRole("button", { name: "메뉴", exact: true }); await expect(menu).toHaveCSS("min-width", "44px"); await menu.click(); const navigation = page.getByRole("navigation", { name: "주요 탐색" }); await expect(navigation).toBeVisible(); // The drawer is a non-modal dialog, so page content stays in the // accessibility tree while it is open. Scope to the navigation and match the // whole name, or a route call to action on the page behind it also matches. await navigation .getByRole("link", { name: "플랫폼 구성", exact: true }) .click(); await expect(page).toHaveURL(/\/examples\/platform$/); await expect(page.locator("html")).toHaveAttribute("data-build-id", EXPECTED_BUILD_ID); const overflow = await page.evaluate( () => document.documentElement.scrollWidth - window.innerWidth, ); expect(overflow).toBeLessThanOrEqual(1); });