.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user