You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.3 KiB
TypeScript

// frontend/playwright/federation.spec.ts
// 연합 E2E: 대시보드 → 인박스 캡처 → 확인 → 작업 등장 → 대시보드 복귀.
// phase-16+: 휴리스틱 제거 → 분류는 실 Ollama. 정확 라벨/지연위험(시드 없음) 대신 '흐름'을 검증.
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 }) => {
test.setTimeout(150_000); // 실 Ollama 35B 콜드스타트 + 분류 여유
// 0) 루트 → 대시보드 + 내비
await page.goto("/");
await expect(page).toHaveURL(/\/dashboard$/);
const nav = page.getByRole("navigation");
await expect(nav.getByText("작업")).toBeVisible();
await expect(nav.getByText("인박스")).toBeVisible();
// 1) 인박스 캡처
await nav.getByRole("link", { name: "인박스" }).click();
await expect(page).toHaveURL(/\/inbox$/);
const composer = page.getByLabel("인박스에 빠르게 캡처");
await composer.fill(RAW);
await composer.press("Enter");
// 2) 실 Ollama 분류(수초) → 확인 버튼
const card = page.locator(".sb-cap.fresh").first();
await expect(card.getByRole("button", { name: /좋아요, 그렇게 해줘/ })).toBeVisible({
timeout: 90000,
});
await card.getByRole("button", { name: /좋아요, 그렇게 해줘/ }).click();
// 3) 연합: 확인 → 작업 실체화. 작업 페이지에 카드 등장(분류에 따라 업무/개인)
await expect
.poll(
async () => {
await page.goto("/tasks");
await page.locator(".tree-row.folder", { hasText: "개인" }).click();
const p = await page.locator(".kcard").count();
await page.locator(".tree-row.folder", { hasText: "업무" }).click();
const w = await page.locator(".kcard").count();
return p + w;
},
{ timeout: 30000 },
)
.toBeGreaterThan(0);
// 4) 대시보드 복귀 → 정상 렌더
await nav.getByRole("link", { name: "대시보드" }).click();
await expect(page).toHaveURL(/\/dashboard$/);
await expect(page.getByText("아리 브리핑")).toBeVisible();
});