feat(web): finish RE 5000PBR lesson video and fix non-ASCII GLB import
- Add 11:07 Chinese-narrated lesson video, VTT, poster and 13 chapter screenshots. - Regenerate 20-render WebGL2 matrix and 15 operation captures on RTX 4060. - Fix WASM staging for non-ASCII import filenames (猴头.glb); rebuild web_engine. - Harden lesson video recording pipeline; fix stale lesson-link E2E selector. - Add RE PBR derived libraries, lesson page, evidence and status report. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
32
web/tests/e2e/pbr-tutorial-accessibility.spec.ts
Normal file
32
web/tests/e2e/pbr-tutorial-accessibility.spec.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import AxeBuilder from "@axe-core/playwright";
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
const TAGS = ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa", "wcag22aa"];
|
||||
const severity = (violations: Awaited<ReturnType<AxeBuilder["analyze"]>>["violations"]) =>
|
||||
violations.filter((violation) => violation.impact === "critical" || violation.impact === "serious").map((violation) => violation.id);
|
||||
|
||||
test.use({ viewport: { width: 1440, height: 900 } });
|
||||
|
||||
test("PBR tutorial landing and overlay are keyboard and screen-reader accessible", async ({ page }) => {
|
||||
test.setTimeout(180_000);
|
||||
await page.goto("/?ui=web&tutorial=pbr");
|
||||
const landing = page.locator('main[data-course="pbr"]');
|
||||
await expect(landing).toBeVisible({ timeout: 60_000 });
|
||||
await expect(landing.getByRole("heading", { level: 1 })).toContainText("PBR");
|
||||
expect(severity((await new AxeBuilder({ page }).withTags(TAGS).analyze()).violations)).toEqual([]);
|
||||
|
||||
await page.getByRole("button", { name: /开始学习|继续学习/ }).click();
|
||||
const overlay = page.locator('.parts-tutorial-overlay[data-course="pbr"]');
|
||||
await expect(overlay).toBeVisible({ timeout: 120_000 });
|
||||
await expect(overlay).toHaveAttribute("data-tutorial-step", "intro");
|
||||
await expect(page.getByRole("button", { name: /^下一步/ })).toBeEnabled({ timeout: 180_000 });
|
||||
await expect(page.getByRole("progressbar", { name: "教程完成进度" })).toBeVisible();
|
||||
|
||||
await page.getByRole("button", { name: /^下一步/ }).click();
|
||||
await expect(overlay).toHaveAttribute("data-tutorial-step", "workspace-shading");
|
||||
await expect(overlay.locator(".tutorial-checks")).toHaveAttribute("aria-live", "polite");
|
||||
expect(severity((await new AxeBuilder({ page }).include(".parts-tutorial-overlay").withTags(TAGS).analyze()).violations)).toEqual([]);
|
||||
|
||||
await page.getByRole("button", { name: "查看课程目录" }).click();
|
||||
await expect(page.getByRole("navigation", { name: "课程目录" })).toBeVisible();
|
||||
});
|
||||
Reference in New Issue
Block a user