.
CI / test (push) Successful in 5m18s
CI / e2e (push) Failing after 5m58s
CI / pr_and_merge (push) Has been skipped

This commit is contained in:
2025-12-15 00:19:31 +09:00
parent 9e08ba284b
commit 8cbeb1a6ce
2 changed files with 24 additions and 22 deletions
+19 -8
View File
@@ -2,15 +2,26 @@ import { test, expect } from "@playwright/test";
// CTA / Features 템플릿이 현재 로케일에 따라 올바른 기본 텍스트로 생성되는지 검증한다.
// 모든 테스트에서 /api/auth/me 를 목 처리해 로그인 상태를 강제한다.
// 모든 테스트에서 /api/auth/me 를 목 처리해 로그인 상태를 강제하고,
// autosave 및 이전 localStorage 상태가 섞이지 않도록 진입 시점을 초기화한다.
test.beforeEach(async ({ page }) => {
await page.route("**/api/auth/me", async (route) => {
await route.fulfill({
status: 200,
contentType: "application/json",
body: JSON.stringify({ id: "user-e2e", email: "e2e@example.com", tokenVersion: 1 }),
});
});
await page.addInitScript(() => {
try {
window.localStorage.clear();
} catch {
// localStorage 접근 실패는 테스트 진행에 치명적이지 않으므로 조용히 무시한다.
}
(window as any).__PB_DISABLE_AUTOSAVE = true;
});
await page.route("**/api/auth/me", async (route) => {
await route.fulfill({
status: 200,
contentType: "application/json",
body: JSON.stringify({ id: "user-e2e", email: "e2e@example.com", tokenVersion: 1 }),
});
});
});
function getLocaleToggle(page: import("@playwright/test").Page) {