feat(web): panel scroll contract, layout probe and functional suite
- lock the three-column height chain on workbench/PartDesign pages so each side panel scrolls independently and the centre stage keeps its size - dock module task panels above the layout with their own scrollbar instead of letting them push the stage out of the viewport - add tools/layout-probe.mjs (page scroll, aside bounds, pane scrolling, stage stability) and CLI mode for tools/static-host.mjs with relative --root support - add the P0-P4 browser functional suite, manual scenarios and capture tooling; document it under docs/current/web-functional-suite Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
56
tools/functional-suite/executors/legacy.mjs
Normal file
56
tools/functional-suite/executors/legacy.mjs
Normal file
@@ -0,0 +1,56 @@
|
||||
// Runs the untouched manual runner (tools/run_user_manual_tests.mjs) as a child
|
||||
// process and folds its results into the functional-suite report as LEGACY-*.
|
||||
import { spawn } from "node:child_process";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { root } from "../runtime.mjs";
|
||||
import { persist } from "../report.mjs";
|
||||
|
||||
const MAP = {
|
||||
passed: { status: "passed", classification: "none", failureClass: null },
|
||||
blocked: { status: "blocked", classification: "precondition", failureClass: "fixture" },
|
||||
failed: { status: "failed", classification: "product-regression", failureClass: "product-regression" },
|
||||
};
|
||||
|
||||
export async function runLegacyCases(options, ctx) {
|
||||
const ids = options.legacyIds.includes("all") ? "" : options.legacyIds.join(",");
|
||||
const env = { ...process.env };
|
||||
if (ids) env.FREECAD_MANUAL_IDS = ids;
|
||||
const child = spawn(process.execPath, [path.join(root, "tools", "run_user_manual_tests.mjs")], {
|
||||
cwd: root, env, stdio: ["ignore", "pipe", "pipe"],
|
||||
});
|
||||
let stdout = "";
|
||||
let stderr = "";
|
||||
child.stdout.on("data", chunk => { stdout += chunk; process.stdout.write(chunk); });
|
||||
child.stderr.on("data", chunk => { stderr += chunk; });
|
||||
const code = await new Promise(resolve => child.on("close", resolve));
|
||||
|
||||
const lastJson = [...stdout.trim().split("\n")].reverse().find(line => line.startsWith("{") && line.includes('"output"'));
|
||||
if (!lastJson) {
|
||||
const message = `legacy runner exited ${code} without a result line: ${(stderr || stdout).slice(-400)}`;
|
||||
console.error(message);
|
||||
ctx.results.push({ id: "LEGACY-RUNNER", title: "Legacy manual runner", priority: "P4", executor: "legacy", status: "blocked", classification: "precondition", failureClass: "fixture", steps: [], seconds: 0, error: message, startedAt: new Date().toISOString(), artifacts: {} });
|
||||
persist(ctx);
|
||||
return [];
|
||||
}
|
||||
const { output: legacyDir } = JSON.parse(lastJson);
|
||||
const legacy = JSON.parse(fs.readFileSync(path.join(legacyDir, "results.json"), "utf8"));
|
||||
const imported = [];
|
||||
for (const item of legacy.results ?? []) {
|
||||
const mapped = MAP[item.status] ?? MAP.failed;
|
||||
const result = {
|
||||
id: `LEGACY-${item.id}`, title: item.title ?? item.id, priority: "P4", executor: "legacy",
|
||||
module: null, source: path.relative(root, legacyDir) + "/results.json",
|
||||
status: mapped.status, classification: mapped.classification, failureClass: mapped.failureClass,
|
||||
steps: item.steps ?? [], seconds: item.seconds ?? 0, error: item.error ?? null,
|
||||
startedAt: item.startedAt ?? null, artifacts: { legacy: path.relative(root, legacyDir) },
|
||||
};
|
||||
ctx.results.push(result);
|
||||
imported.push(result);
|
||||
if (mapped.status !== "passed") {
|
||||
ctx.gaps.push({ caseId: result.id, status: mapped.status, classification: mapped.classification, failureClass: mapped.failureClass, message: result.error ?? mapped.status, evidence: result.artifacts.legacy });
|
||||
}
|
||||
}
|
||||
persist(ctx);
|
||||
return imported;
|
||||
}
|
||||
Reference in New Issue
Block a user