test(performance): derive navigation target from route registry

This commit is contained in:
donghyeon-ka
2026-07-26 00:32:50 +09:00
parent 8ea825a8a1
commit 5a7a6c4ae5
+7 -1
View File
@@ -6,6 +6,7 @@ import process from "node:process";
import { chromium } from "@playwright/test";
import { evaluateLabBudget } from "../src/application/policies/performance-budgets.js";
import { ROUTE_REGISTRY } from "../src/contracts/routes.js";
const server = spawn(
"corepack",
@@ -66,8 +67,13 @@ try {
}).observe({ type: "layout-shift", buffered: true });
});
await page.goto(baseUrl, { waitUntil: "networkidle" });
const targetLabel =
ROUTE_REGISTRY.SAMPLE_RESOURCE_LIST.navigationLabel;
if (!targetLabel) {
throw new Error("Performance route must be present in navigation.");
}
const interactionStarted = performance.now();
await page.getByRole("link", { name: "샘플 리소스" }).click();
await page.getByRole("link", { name: targetLabel }).click();
await page.getByRole("heading", { name: "세션이 필요합니다." }).waitFor();
const namedInteractionMs = performance.now() - interactionStarted;
const paint = await page.evaluate(