// frontend/playwright/federation.spec.ts // 연합 E2E 사용자 여정: 대시보드 → 인박스 캡처 → 분류 좋아요(확인) → // 작업 페이지(개인 › 여행 — 한국) 등장 → 리스크 레이더 → 대시보드 복귀. // 백엔드는 ARI_ALLOW_TEST_RESET=1 LLM_PROVIDER=heuristic 로 기동 가정. import { expect, test } from "@playwright/test"; import { resetSeed } from "./fixtures/seed-reset"; test.describe.configure({ mode: "serial" }); const RAW = "다음 주에 한국 놀러가는 비행기 티켓 사기"; test.beforeEach(async () => { await resetSeed(); }); test("연합: 캡처 → 분류 → 확인 → 작업 트리 등장 → 리스크 → 대시보드 집계", async ({ page }) => { // 0) 루트 → 대시보드 리다이렉트, 상단 내비 13항목 await page.goto("/"); await expect(page).toHaveURL(/\/dashboard$/); await expect(page.getByRole("navigation").getByText("작업")).toBeVisible(); await expect(page.getByRole("navigation").getByText("인박스")).toBeVisible(); // 1) 인박스로 이동 후 캡처 (내비로 스코프 — 카드 CTA 와 구분) const nav = page.getByRole("navigation"); await nav.getByRole("link", { name: "인박스" }).click(); await expect(page).toHaveURL(/\/inbox$/); const composer = page.getByLabel("인박스에 빠르게 캡처"); await composer.fill(RAW); await composer.press("Enter"); // 2) 분류 결과 — 작업 / 개인 › 여행 — 한국 / 구매(reason) const card = page.locator(".sb-cap.fresh").first(); await expect(card.getByText("작업", { exact: true })).toBeVisible(); await expect(card.locator(".r-chip.proj")).toContainText("개인 › 여행 — 한국"); await expect(card.locator(".sb-reason")).toContainText("작업"); // 3) 좋아요(확인=실체화) await card.getByRole("button", { name: /좋아요, 그렇게 해줘/ }).click(); await expect(card.locator(".sb-done")).toBeVisible(); // 4) 작업 페이지 → 개인 필터 → 여행 — 한국에 새 task 등장(개인도 숨기지 않음) await nav.getByRole("link", { name: "작업" }).click(); await expect(page).toHaveURL(/\/tasks/); await page.locator(".tree-row.folder", { hasText: "개인" }).click(); await expect(page.locator(".kcard-title", { hasText: "비행기 티켓" }).first()).toBeVisible(); // 5) 업무 필터 → 리스크 레이더 지연 위험 await page.locator(".tree-row.folder", { hasText: "업무" }).click(); const radar = page.locator(".rradar"); await expect(radar).toContainText("리스크 레이더"); await expect(radar).toContainText("지연 위험"); // 6) 대시보드 복귀 → 요약 갱신 await nav.getByRole("link", { name: "대시보드" }).click(); await expect(page).toHaveURL(/\/dashboard$/); await expect(page.getByText("아리 브리핑")).toBeVisible(); await expect(page.getByRole("heading", { name: "할 일" })).toBeVisible(); });