Files
workinf_Blender_Wasm/web/tests/deployed/support/chapters.ts
mes123456 a5f772e18f
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled
feat(web): deployed functional suite, outliner expansion fix and local-first runs
Outliner: react-accessible-treeview's controlled expandedIds sync expands a
node together with its parent, then the next pass treats that extra parent id
as removed from the controlled set and collapses the whole branch. Reproduced
as a collapsed tree after ch11 -> ch12 (scene rows complete in React, one
collapsed row in the DOM). Keep OUTLINER_ROOT_ID in the controlled set so both
passes agree, and drop the rows-digest memo that regressed the normal path.
Also arm a bounded post-open OUTLINER_REFRESH loop so the tree settles on rows
of the newly opened Main instead of the previous one.

Tests: web/playwright.deployed.config.ts + web/tests/deployed walk the 31
manual chapters and the 31 capability rows headed against a deployed origin,
and tools/web/run-deployed-functional-tests.mjs preflights, runs and reports.
--local serves the production bundle from web/dist on loopback with the same
COOP/COEP/CORP/CSP headers, so a case costs compile time instead of a 300 MB
download: full local suite 60/60 in 10.3 min, also 60/60 against the deployed
release. Report dirs are resolved absolute and [ch28a]-style tags map to their
chapter.

Area layout: split from the clamped source rect and keep the area switcher
inside a narrow header.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 16:12:26 +08:00

47 lines
1.6 KiB
TypeScript

import fs from "node:fs";
import path from "node:path";
import { REPO_ROOT } from "./deployed";
/**
* The user manual is the coverage yardstick for this suite: every chapter has
* objectives and `checks`, but no selectors, so it is used for grouping and
* acceptance wording, not executed as a script.
*/
export interface ChapterInfo {
id: string;
number: number;
title: string;
part: string;
workspace: string;
checks: string[];
}
interface ManualChapter { id: string; number: number; title: string; workspace: string; checks?: string[] }
interface ManualPart { id: string; title: string; chapterIds: string[] }
interface Manual { chapters: ManualChapter[]; parts: ManualPart[] }
const MANUAL_PATH = path.join(REPO_ROOT, "user-manual/WEB_Blender_Web_Manual_20261113/manual.json");
function load(): ChapterInfo[] {
if (!fs.existsSync(MANUAL_PATH)) throw new Error(`user manual not found: ${MANUAL_PATH}`);
const manual = JSON.parse(fs.readFileSync(MANUAL_PATH, "utf8")) as Manual;
const partOf = new Map<string, string>();
for (const part of manual.parts) for (const id of part.chapterIds) partOf.set(id, part.title);
return manual.chapters.map((chapter) => ({
id: chapter.id,
number: chapter.number,
title: chapter.title,
part: partOf.get(chapter.id) ?? "",
workspace: chapter.workspace,
checks: chapter.checks ?? [],
}));
}
export const CHAPTERS: ChapterInfo[] = load();
export function chapter(id: string): ChapterInfo {
const found = CHAPTERS.find((item) => item.id === id);
if (!found) throw new Error(`manual chapter not found: ${id}`);
return found;
}