e2e 오류 수정
This commit is contained in:
@@ -19,7 +19,16 @@ async function setLocale(page: import("@playwright/test").Page, target: "EN" | "
|
||||
|
||||
// 프리뷰 E2E에서도 기본적으로 로그인된 사용자를 가정한다.
|
||||
// /editor 와 /preview 모두 auth 가드가 /api/auth/me 를 호출하므로, 200 으로 목 처리해 리다이렉트를 막는다.
|
||||
// 또한 테스트 간 autosave 스냅샷 및 기타 localStorage 상태가 섞이지 않도록, 각 테스트 진입 전에 localStorage 를 초기화한다.
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.addInitScript(() => {
|
||||
try {
|
||||
window.localStorage.clear();
|
||||
} catch {
|
||||
// localStorage 접근 실패는 테스트 진행에 치명적이지 않으므로 조용히 무시한다.
|
||||
}
|
||||
});
|
||||
|
||||
await page.route("**/api/auth/me", async (route) => {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
@@ -380,6 +389,9 @@ test("폼 라디오 옵션 라벨 이미지 업로드 후 에디터/프리뷰
|
||||
await page.getByRole("button", { name: "Radio group" }).click();
|
||||
|
||||
const canvas = page.getByTestId("editor-canvas");
|
||||
const blocks = canvas.getByTestId("editor-block");
|
||||
await blocks.last().click({ force: true });
|
||||
|
||||
const propertiesSidebar = page.getByTestId("properties-sidebar");
|
||||
|
||||
const firstOptionLabel = propertiesSidebar.getByPlaceholder("Label").first();
|
||||
|
||||
Reference in New Issue
Block a user