- HIG(탭바 5~6·시트)·M3(바텀내비 3~5·48dp)·NN/g·CSS-Tricks 조사(research/mobile-app-ux-v1.md) 후 Nielsen 10 감사로 위반 도출 - 바텀 내비 5탭 + 더보기 바텀 시트(그룹 헤더), 뷰·다이얼로그 pushState/popstate — 안드로이드 백 키가 앱 내 뒤로 작동 - safe area(env+max)·입력 16px(iOS 확대 방지)·coarse 44px 타깃·tap-highlight·overscroll 위생, 인쇄에서 모바일 크롬 제거 - PWA: manifest + sharp 생성 아이콘(가온=장부 문항, 두레=시간표 블록) - tools/e2e.mjs L6 시나리오: RED 1,742 단언 318 실패 → GREEN 1,762/0, verify 체인 7계층 통과 - 실기기(안드로이드 에뮬레이터·Chrome) 텍스트 근거 검증 — 백 키·시트·탭 전환, iOS 는 WebKit(L4) 대체 - 스킬 내재화: mobile-app-ux.md, audit-gate 7계층·하니스 12~14, design-gate 터치타깃 검사, SKILL.md 규칙 7 - 도그푸드: 게이트가 죽은 선택자 8종·thresholds 병합 버그 적발 — CSS v22(양앱) 범프 후 전체 재검증
63 lines
3.4 KiB
JavaScript
63 lines
3.4 KiB
JavaScript
// QA 게이트 — L0~L5 전 계층 실행. 1건 실패라도 있으면 exit 1 (배포 금지).
|
|
// 사용: node tools/verify.mjs / npm run verify
|
|
// 기준 화면 갱신: node tools/visual.mjs --update-baseline 후 커밋.
|
|
import { spawnSync } from "node:child_process";
|
|
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import url from "node:url";
|
|
|
|
const here = path.dirname(url.fileURLToPath(import.meta.url));
|
|
const root = path.resolve(here, "..");
|
|
const npx = process.platform === "win32" ? "npx.cmd" : "npx";
|
|
|
|
const steps = [
|
|
{
|
|
layer: "L0-정적/stylelint",
|
|
cmd: () => spawnSync(npx, ["stylelint", "public/work/*/styles/*.css"], { cwd: root, encoding: "utf8", shell: true }),
|
|
},
|
|
{
|
|
layer: "L0-정식/html-validate",
|
|
cmd: () => spawnSync(npx, ["html-validate", "public/work/gaon-lms/index.html", "public/work/dure-enrollment/index.html"], { cwd: root, encoding: "utf8", shell: true }),
|
|
},
|
|
{ layer: "L1-단위/계산로직", cmd: () => spawnSync(process.execPath, ["tools/unit/calc.test.mjs"], { cwd: root, encoding: "utf8" }) },
|
|
{ layer: "L2-기능/감사", cmd: () => spawnSync(process.execPath, ["tools/audit.mjs"], { cwd: root, encoding: "utf8" }) },
|
|
{ layer: "L2-불변식/렌더", cmd: () => spawnSync(process.execPath, ["tools/invariants.mjs"], { cwd: root, encoding: "utf8" }) },
|
|
{ layer: "L3-시각회귀/diff", cmd: () => spawnSync(process.execPath, ["tools/visual.mjs"], { cwd: root, encoding: "utf8" }) },
|
|
{ layer: "L4-WebKit", cmd: () => spawnSync(process.execPath, ["tools/webkit.mjs"], { cwd: root, encoding: "utf8" }) },
|
|
{ layer: "L5-탐색/키보드", cmd: () => spawnSync(process.execPath, ["tools/exploratory.mjs"], { cwd: root, encoding: "utf8" }) },
|
|
{ layer: "L6-시나리오/E2E", cmd: () => spawnSync(process.execPath, ["tools/e2e.mjs"], { cwd: root, encoding: "utf8" }) },
|
|
];
|
|
|
|
const report = [];
|
|
const t0 = Date.now();
|
|
let failed = 0;
|
|
for (const step of steps) {
|
|
const s = Date.now();
|
|
const r = step.cmd();
|
|
const ok = r.status === 0;
|
|
if (!ok) failed++;
|
|
const out = (r.stdout || "") + (r.stderr || "");
|
|
const passLine = (out.match(/PASS\s+[^\n]/g) || []).length;
|
|
const failLines = (out.match(/FAIL\s+[^\n]/g) || []).length;
|
|
const tail = out.trim().split("\n").slice(-3).join(" | ").slice(0, 180);
|
|
report.push({ layer: step.layer, ok, ms: Date.now() - s, passLine, failLines, tail });
|
|
console.log(`${ok ? "✓" : "✗"} ${step.layer} (${((Date.now() - s) / 1000).toFixed(1)}s)${passLine ? ` — PASS ${passLine}` : ""}${failLines ? ` FAIL ${failLines}` : ""}`);
|
|
if (!ok) console.log(" " + tail);
|
|
}
|
|
|
|
const totalS = ((Date.now() - t0) / 1000).toFixed(1);
|
|
const stamp = new Date().toISOString().replace("T", " ").slice(0, 16);
|
|
const md = [
|
|
`# 검증 리포트 — ${stamp}`,
|
|
``,
|
|
`게이트: ${failed ? `**${failed}개 계층 실패 — 배포 금지**` : "**전 계층 통과 — 배포 가능**"} · 총 ${totalS}초`,
|
|
``,
|
|
`| 계층 | 결과 | 항목 | 소요 |`,
|
|
`|---|---|---|---|`,
|
|
...report.map((r) => `| ${r.layer} | ${r.ok ? "PASS" : "**FAIL**"} | ${r.failLines ? `FAIL ${r.failLines}` : `PASS ${r.passLine || "—"}`} | ${(r.ms / 1000).toFixed(1)}s |`),
|
|
``,
|
|
...report.filter((r) => !r.ok).map((r) => `## ${r.layer} 실패 상세\n\n\`\`\`\n${r.tail}\n\`\`\``),
|
|
].join("\n");
|
|
fs.writeFileSync(path.join(here, "verify-report.md"), md);
|
|
console.log(`\n${failed ? `게이트 실패(${failed}계층)` : "게이트 통과"} — 리포트: tools/verify-report.md`);
|
|
process.exit(failed ? 1 : 0);
|