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.

100 lines
5.2 KiB
TypeScript

// frontend/playwright/tasks.spec.ts
// 주의: 백엔드(:8000) 시드 DB 를 변경하는 테스트 포함 → 단일 워커 직렬 실행.
import { expect, test } from "@playwright/test";
test.describe.configure({ mode: "serial" });
test("초기 진입: 업무 스코프 + 칸반 5컬럼 + 리스크 레이더", async ({ page }) => {
await page.goto("/tasks");
await expect(page.locator(".tree-row.folder.on .tree-name")).toHaveText("업무");
await expect(page.locator(".kboard .kcol")).toHaveCount(5);
await expect(page.locator(".rradar")).toBeVisible();
await expect(page.locator(".rr-ht b")).toHaveText("리스크 레이더");
});
test("폴더 펼침 → 프로젝트 필터 + 브레드크럼", async ({ page }) => {
await page.goto("/tasks");
await page.locator(".tree-row", { hasText: "분기 리포트" }).first().click();
await expect(page.locator(".kcard-title", { hasText: "분기 리포트 초안 마무리" })).toBeVisible();
await expect(page.locator(".kcard-title", { hasText: "사용자 인터뷰 5건 정리" })).toHaveCount(0);
await expect(page.locator(".crumbs .cur")).toContainText("분기 리포트");
});
test("뷰 전환 칸반 ↔ 리스트", async ({ page }) => {
await page.goto("/tasks");
await page.locator(".view-seg button", { hasText: "리스트" }).click();
await expect(page.locator(".lgroups")).toBeVisible();
await expect(page.locator(".lgroup").first()).toBeVisible();
await page.locator(".view-seg button", { hasText: "칸반" }).click();
await expect(page.locator(".kboard")).toBeVisible();
});
test("리스크 레이더 CTA → 작업 드로어 열기", async ({ page }) => {
await page.goto("/tasks");
await page.locator(".rr-item.t-coral .rr-cta", { hasText: "작업 열기" }).click();
await expect(page.locator(".dpanel .dp-title")).toContainText("분기 리포트 초안 마무리");
});
test("드로어: 하위작업 드릴다운 → 상위 복귀 → 댓글", async ({ page }) => {
await page.goto("/tasks");
await page.locator(".kcard", { hasText: "분기 리포트 초안 마무리" }).click();
await expect(page.locator(".dpanel")).toBeVisible();
await page.locator(".subrow", { hasText: "매출 섹션 작성" }).click();
await expect(page.locator(".dp-crumbs .cz.cur")).toHaveText("매출 섹션 작성");
await page.locator(".dp-crumbs button.cz", { hasText: "분기 리포트 초안 마무리" }).click();
await page.locator(".cmt-compose input").fill("진행 상황 공유드립니다");
await page.locator(".cmt-compose input").press("Enter");
await expect(page.locator(".cmt-text", { hasText: "진행 상황 공유드립니다" })).toBeVisible();
});
test("Auto-Scaffolding 미리보기 → 적용", async ({ page }) => {
await page.goto("/tasks");
await page.locator(".kcard", { hasText: "OKR 중간 점검 자료 준비" }).click();
await page.locator(".scaffold-trigger", { hasText: "아리에게 업무 쪼개기 맡기기" }).click();
await expect(page.locator(".scaffold-panel .sp-item").first()).toBeVisible();
const n = await page.locator(".scaffold-panel .sp-item").count();
expect(n).toBeGreaterThanOrEqual(4);
await page.locator(".sp-apply").click();
// 기존 하위 2개 + 신규 n개
await expect(page.locator(".dpanel .subrow")).toHaveCount(n + 2);
});
test("새 프로젝트 생성 → 서버 영속(새로고침 유지)", async ({ page }) => {
await page.goto("/tasks");
await page.locator(".tree-add", { hasText: "새 프로젝트" }).first().click();
await page.locator(".tree-addrow input").fill("신규 프로젝트 E2E");
await page.locator(".tree-addrow input").press("Enter");
await expect(page.locator(".tree-name", { hasText: "신규 프로젝트 E2E" })).toBeVisible();
await page.reload();
await expect(page.locator(".tree-name", { hasText: "신규 프로젝트 E2E" })).toBeVisible();
});
test("작업 상태 이동(드로어 상태 메뉴) → 영속", async ({ page }) => {
await page.goto("/tasks");
await page.locator(".kcard", { hasText: "스프린트 회고 문서 배포" }).click();
await page.locator(".status-pill").click();
await page.locator(".status-menu button", { hasText: "완료" }).click();
await page.locator(".dp-close").click();
const doneCol = page.locator(".kcol", { hasText: "완료" });
await expect(doneCol.locator(".kcard", { hasText: "스프린트 회고 문서 배포" })).toBeVisible();
await page.reload();
await expect(
page.locator(".kcol", { hasText: "완료" }).locator(".kcard", { hasText: "스프린트 회고 문서 배포" }),
).toBeVisible();
});
test("즐겨찾기: 핀 토글 → 즐겨찾기 스코프 필터", async ({ page }) => {
await page.goto("/tasks");
const wireRow = page.locator(".tree-row", { hasText: "와이어프레임" }).first();
await wireRow.hover();
await wireRow.locator(".tree-pin").click();
const favFolder = page.locator(".tree-row.folder", { hasText: "즐겨찾기" });
// 즐겨찾기 배지 1로 증가
await expect(favFolder.locator(".tree-badge")).toHaveText("1");
await favFolder.click();
// 즐겨찾기 스코프 → onb-wire(와이어프레임) 작업만 메인에 표시
await expect(
page.locator(".kcard-title", { hasText: "온보딩 와이어프레임 피드백 정리" }),
).toBeVisible();
});