e2e 수정
CI / test (push) Failing after 5m19s
CI / e2e (push) Has been skipped
CI / pr_and_merge (push) Has been skipped

This commit is contained in:
2025-12-14 16:56:32 +09:00
parent d7ebc82e2a
commit 6ff6048f95
2 changed files with 24 additions and 14 deletions
+17 -14
View File
@@ -5,13 +5,20 @@ import { test, expect } from "@playwright/test";
// 에디터 E2E에서는 인증된 사용자 시나리오를 기본으로 가정한다. // 에디터 E2E에서는 인증된 사용자 시나리오를 기본으로 가정한다.
// /api/auth/me 를 항상 200 으로 목 처리해, auth 가드가 /login 으로 리다이렉트하지 않도록 한다. // /api/auth/me 를 항상 200 으로 목 처리해, auth 가드가 /login 으로 리다이렉트하지 않도록 한다.
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
await page.route("**/api/auth/me", async (route) => { await page.addInitScript(() => {
await route.fulfill({ try {
status: 200, window.localStorage.clear();
contentType: "application/json", } catch {
body: JSON.stringify({ id: "user-e2e", email: "e2e@example.com", tokenVersion: 1 }), }
}); });
});
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 }),
});
});
}); });
test("/editor 페이지가 존재하고 Page Editor 헤더를 보여줘야 한다", async ({ page }) => { test("/editor 페이지가 존재하고 Page Editor 헤더를 보여줘야 한다", async ({ page }) => {
@@ -70,14 +77,10 @@ test("프로젝트 설정 패널에서 캔버스 프리셋을 변경하면 에
const presetSelect = page.getByRole("combobox", { name: "Canvas width 프리셋" }); const presetSelect = page.getByRole("combobox", { name: "Canvas width 프리셋" });
await presetSelect.selectOption("mobile"); await presetSelect.selectOption("mobile");
const mobileMaxWidth = await inner.evaluate((el) => (el as HTMLElement).style.maxWidth); await expect(inner).toHaveCSS("max-width", "390px");
await presetSelect.selectOption("desktop"); await presetSelect.selectOption("desktop");
const desktopMaxWidth = await inner.evaluate((el) => (el as HTMLElement).style.maxWidth); await expect(inner).toHaveCSS("max-width", "1200px");
expect(mobileMaxWidth).toBe("390px");
expect(desktopMaxWidth).toBe("1200px");
expect(mobileMaxWidth).not.toBe(desktopMaxWidth);
}); });
test("텍스트 블록을 더블클릭해서 내용을 수정할 수 있어야 한다", async ({ page }) => { test("텍스트 블록을 더블클릭해서 내용을 수정할 수 있어야 한다", async ({ page }) => {
@@ -6,6 +6,13 @@ function parsePx(value: string): number {
} }
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
await page.addInitScript(() => {
try {
window.localStorage.clear();
} catch {
}
});
await page.route("**/api/auth/me", async (route) => { await page.route("**/api/auth/me", async (route) => {
await route.fulfill({ await route.fulfill({
status: 200, status: 200,