merge: PR #27을 합친 검사 브랜치에 넣는다
This commit is contained in:
@@ -23,7 +23,7 @@ paths:
|
||||
|
||||
## 함정
|
||||
|
||||
1. axe 통과를 접근성 완료로 적는다. e2e 스캔의 태그는 `wcag2a`·`wcag2aa`·`wcag21a`·`wcag21aa`뿐이다. WCAG 2.2에서 더해진 기준(포커스가 가려지지 않음, 목표 크기 최소, 드래그 대안 등)은 자동으로 보지 않는다. 그리고 critical·serious 위반만 막는다. — `tests/e2e/accessibility.spec.ts`, `docs/accessibility/manual-checklist.md`, `docs/design/2026-07-26-design-system-platform-design.md` 13절
|
||||
1. axe 통과를 접근성 완료로 적는다. 스캔 태그는 `tests/support/browser/axe-tags.ts` 하나다. WCAG 2.2 AA 태그(`wcag22aa`, 목표 크기 2.5.8)도 돌지만, 2.2에서 더해진 기준 대부분(포커스가 가려지지 않음, 드래그 대안 등)은 axe에 규칙이 없어 자동으로 보지 않는다. 그리고 critical·serious 위반만 막는다. — `tests/e2e/accessibility.spec.ts`, `docs/accessibility/manual-checklist.md`, `docs/design/2026-07-26-design-system-platform-design.md` 13절
|
||||
2. 자동 스캔이 본 상태를 넘겨 짐작한다. 보호 라우트는 데모 로그인 뒤, 목록은 빈 상태, 단건 읽기 상세는 실패 상태에서 스캔하고 `notChecked`로 남긴다. 데이터가 찬 목록·상세는 기능 시험과 수동 검토 몫이다. — `docs/accessibility/manual-checklist.md` 「자동 실행이 검사하는 것」
|
||||
3. 린트가 의미를 잡아 줄 거라 믿는다. `eslint.config.ts`에 접근성 규칙 플러그인이 없다. `div` + 키 핸들러로 만든 버튼, 이름 없는 아이콘 버튼은 component 시험·axe·리뷰가 잡는다. — `eslint.config.ts`, `docs/design/2026-07-26-design-system-platform-design.md` 13절
|
||||
4. 저장 중 버튼을 `disabled`로 바꿔 키보드 포커스를 잃게 한다. `pending`을 쓴다. — `docs/manual/02-decision-tables.md` 6절
|
||||
|
||||
@@ -38,7 +38,7 @@ Attestation: accepted
|
||||
M1 Keyboard: pass
|
||||
M2 Visible focus: pass
|
||||
M3 Route focus: pass
|
||||
M4 Modal focus: not-applicable (no modal on this route)
|
||||
M4 Modal focus: pass
|
||||
M5 Error association: not-applicable (no form error on this route)
|
||||
M6 Color signal: pass
|
||||
M7 Reduced motion: pass
|
||||
@@ -58,7 +58,9 @@ Notes: <observations and linked defect IDs>
|
||||
- Screen reader: 제목, live region, 오류, 동작이 한 번씩 읽힌다
|
||||
|
||||
form이나 dialog가 있는 route는 M4 modal 리뷰와 M5 필드 오류 리뷰를 실제로 해야
|
||||
한다. 그런 route에서는 그 항목을 not-applicable로 표시하면 안 된다. 자동 증거가
|
||||
한다. 그런 route에서는 그 항목을 not-applicable로 표시하면 안 된다. 셸(`AppShell`)의
|
||||
compact 탐색 drawer는 modal이고 셸 아래 모든 route에 있으므로, 셸 route의 M4는
|
||||
not-applicable이 아니다. 자동 증거가
|
||||
통과했다는 것은 이것만 뜻한다: 기록된 Chromium, Firefox, WebKit 실행에서
|
||||
테스트한 페이지에 critical이나 serious 등급의 axe 발견이 없었다.
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ Attestation: pending
|
||||
M1 Keyboard: pending
|
||||
M2 Visible focus: pending
|
||||
M3 Route focus: pending
|
||||
M4 Modal focus: not-applicable (no modal on this route)
|
||||
M4 Modal focus: pending
|
||||
M5 Error association: not-applicable (no form error on this route)
|
||||
M6 Color signal: pending
|
||||
M7 Reduced motion: pending
|
||||
|
||||
@@ -10,7 +10,7 @@ Attestation: pending
|
||||
M1 Keyboard: pending
|
||||
M2 Visible focus: pending
|
||||
M3 Route focus: pending
|
||||
M4 Modal focus: not-applicable (no modal on this route)
|
||||
M4 Modal focus: pending
|
||||
M5 Error association: not-applicable (no form error on this route)
|
||||
M6 Color signal: pending
|
||||
M7 Reduced motion: pending
|
||||
|
||||
@@ -10,7 +10,7 @@ Attestation: pending
|
||||
M1 Keyboard: pending
|
||||
M2 Visible focus: pending
|
||||
M3 Route focus: pending
|
||||
M4 Modal focus: not-applicable (no modal on this route)
|
||||
M4 Modal focus: pending
|
||||
M5 Error association: not-applicable (no form error on this route)
|
||||
M6 Color signal: pending
|
||||
M7 Reduced motion: pending
|
||||
|
||||
@@ -9,8 +9,9 @@ import {
|
||||
answerInstalledApiRequest,
|
||||
type InstalledApiAnswer,
|
||||
} from "./support/installed-api-answers.ts";
|
||||
import { WCAG_AXE_TAGS } from "../support/browser/axe-tags.ts";
|
||||
|
||||
const WCAG_TAGS = ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"];
|
||||
const WCAG_TAGS = [...WCAG_AXE_TAGS];
|
||||
const SIGN_IN_TITLE = KO_MESSAGES["route.auth.required.title"];
|
||||
const CATALOG = KO_MESSAGES as Readonly<Record<string, string>>;
|
||||
|
||||
@@ -127,11 +128,23 @@ test("@a11y skip link moves keyboard focus into main", async ({ page }) => {
|
||||
.toBe(true);
|
||||
});
|
||||
|
||||
// 1112/05-08. The policy is the reduced-motion rule (responsive.css): every
|
||||
// animation and transition becomes 0.01 ms. The browser default is 0s, so the
|
||||
// check reads the rule's own value and compares it with the default, or a
|
||||
// deleted rule passes.
|
||||
test("@a11y reduced-motion policy disables long animation", async ({ page }) => {
|
||||
await page.emulateMedia({ reducedMotion: "reduce" });
|
||||
const durations = () =>
|
||||
page.locator("body").evaluate((body) => {
|
||||
const style = getComputedStyle(body);
|
||||
return [style.animationDuration, style.transitionDuration];
|
||||
});
|
||||
const REDUCED = ["0.00001s", "1e-05s"];
|
||||
await page.goto("/");
|
||||
const duration = await page
|
||||
.locator("body")
|
||||
.evaluate((body) => getComputedStyle(body).animationDuration);
|
||||
expect(["0s", "0.00001s", "1e-05s"]).toContain(duration);
|
||||
expect(await durations()).toEqual(["0s", "0s"]);
|
||||
|
||||
await page.emulateMedia({ reducedMotion: "reduce" });
|
||||
|
||||
const [animation, transition] = await durations();
|
||||
expect(REDUCED).toContain(animation);
|
||||
expect(REDUCED).toContain(transition);
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import AxeBuilder from "@axe-core/playwright";
|
||||
import type { Page, Route } from "@playwright/test";
|
||||
import { WCAG_AXE_TAGS } from "../support/browser/axe-tags.ts";
|
||||
|
||||
import { KO_MESSAGES } from "../../src/presentation/i18n/catalog.ts";
|
||||
import { expect, test } from "../support/browser/strict-browser-test.ts";
|
||||
@@ -29,7 +30,7 @@ import { startBuildServer } from "./support/service-worker-builds.ts";
|
||||
*/
|
||||
const META = Object.freeze({ requestId: "req-e2e", traceId: "0af7651916cd43dd8448eb211c80319c" });
|
||||
const ITEM = Object.freeze({ id: "browser-order", name: "Browser order" });
|
||||
const WCAG_TAGS = ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"];
|
||||
const WCAG_TAGS = [...WCAG_AXE_TAGS];
|
||||
|
||||
let builds: FixtureBuilds<"a"> | undefined;
|
||||
let server: Awaited<ReturnType<typeof startBuildServer>> | undefined;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import AxeBuilder from "@axe-core/playwright";
|
||||
import { expect, test } from "../support/browser/strict-browser-test.ts";
|
||||
import { WCAG_AXE_TAGS } from "../support/browser/axe-tags.ts";
|
||||
|
||||
test("persists an explicit color scheme through the storage contract", async ({
|
||||
page,
|
||||
@@ -11,7 +12,7 @@ test("persists an explicit color scheme through the storage contract", async ({
|
||||
await expect(page.locator("html")).toHaveAttribute("data-theme", "dark");
|
||||
await expect(page.locator("html")).toHaveCSS("color-scheme", "dark");
|
||||
const results = await new AxeBuilder({ page })
|
||||
.withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"])
|
||||
.withTags([...WCAG_AXE_TAGS])
|
||||
.analyze();
|
||||
expect(
|
||||
results.violations.filter((violation) =>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import AxeBuilder from "@axe-core/playwright";
|
||||
import { WCAG_AXE_TAGS } from "../support/browser/axe-tags.ts";
|
||||
|
||||
import {
|
||||
expect,
|
||||
@@ -62,7 +63,7 @@ test("opened design-system dialog has no blocking violations", async ({
|
||||
await page.getByRole("button", { name: "모달 열기" }).click();
|
||||
const results = await new AxeBuilder({ page })
|
||||
.include(".ui-dialog")
|
||||
.withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"])
|
||||
.withTags([...WCAG_AXE_TAGS])
|
||||
.analyze();
|
||||
expect(
|
||||
results.violations.filter((violation) =>
|
||||
@@ -71,6 +72,31 @@ test("opened design-system dialog has no blocking violations", async ({
|
||||
).toEqual([]);
|
||||
});
|
||||
|
||||
// 1112/05-04. The galleries replaced the example screens, whose whole page
|
||||
// the route scan checked. With no feature installed they are the only place
|
||||
// the empty, error, sign-in and access surfaces are drawn, so the whole story
|
||||
// is scanned, in both colour schemes, as the screens were.
|
||||
for (const story of [
|
||||
{ id: "platform-galleries--design-system", heading: "UI 구성요소" },
|
||||
{ id: "platform-galleries--screen-states", heading: "화면 상태" },
|
||||
] as const) {
|
||||
for (const colorScheme of ["light", "dark"] as const) {
|
||||
test(`${story.id} has no blocking violations in ${colorScheme}`, async ({ page }) => {
|
||||
await page.emulateMedia({ colorScheme });
|
||||
await page.goto(`/iframe.html?id=${story.id}&viewMode=story&globals=a11y.manual:!true`);
|
||||
await expect(page.getByRole("heading", { level: 1, name: story.heading })).toBeVisible();
|
||||
const results = await new AxeBuilder({ page })
|
||||
.withTags([...WCAG_AXE_TAGS])
|
||||
.analyze();
|
||||
expect(
|
||||
results.violations
|
||||
.filter((violation) => ["critical", "serious"].includes(violation.impact ?? ""))
|
||||
.map((violation) => `${violation.id}: ${violation.nodes.map((node) => node.target.join(" ")).join(", ")}`),
|
||||
).toEqual([]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
test("runs menu typeahead, tabs and duplicate toast interactions", async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* The WCAG rule tags every axe scan runs. 1112/05-05. The product promises
|
||||
* WCAG 2.2 AA (PRODUCT.md), so the 2.2 AA rules axe implements (target size,
|
||||
* 2.5.8) run too. axe has no rule for most 2.2 criteria (focus not obscured,
|
||||
* dragging alternatives); the manual checklist covers those.
|
||||
*/
|
||||
export const WCAG_AXE_TAGS: readonly string[] = Object.freeze([
|
||||
"wcag2a",
|
||||
"wcag2aa",
|
||||
"wcag21a",
|
||||
"wcag21aa",
|
||||
"wcag22aa",
|
||||
]);
|
||||
Reference in New Issue
Block a user