Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer, web workflow engine and protocol, tooling, docs and task records. Large generated evidence, user-testing archives, build snapshots and imported test assets remain untracked. Co-Authored-By: Claude Code <noreply@anthropic.com>
36 lines
2.4 KiB
JavaScript
36 lines
2.4 KiB
JavaScript
import { createRequire } from "node:module";
|
|
import path from "node:path";
|
|
const { chromium } = createRequire(import.meta.url)(path.resolve("web/node_modules/playwright"));
|
|
const browser = await chromium.launch({ headless: true, executablePath: "/usr/bin/google-chrome-stable",
|
|
args: ["--no-sandbox","--use-gl=swiftshader","--enable-unsafe-swiftshader","--enable-unsafe-webgpu","--enable-dawn-features=allow_unsafe_apis","--use-webgpu-adapter=swiftshader"] });
|
|
const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } });
|
|
const page = await ctx.newPage();
|
|
await page.addInitScript(() => {
|
|
const reg = []; window.__w = reg;
|
|
window.Worker = new Proxy(window.Worker, { construct(t, a) { const w = Reflect.construct(t, a); reg.push({ url: String(a[0]), worker: w }); return w; } });
|
|
});
|
|
await page.goto("http://127.0.0.1:5412/?ui=web", { waitUntil: "domcontentloaded" });
|
|
await page.waitForFunction(() => document.body.innerText.includes("WASM ABI: ready"), undefined, { timeout: 120000 });
|
|
await page.getByTestId("blend-file-input").setInputFiles(path.resolve("tests/files/web/hierarchy_simplify_combined.blend"));
|
|
await page.waitForFunction(() => /SceneIR r\d+/.test(document.querySelector('[data-testid="engine-status"]')?.textContent ?? ""), undefined, { timeout: 120000 });
|
|
await page.waitForTimeout(3500);
|
|
const snap = await page.evaluate(() => new Promise((resolve, reject) => {
|
|
const worker = window.__w.find(x => /web-engine\.worker/.test(x.url))?.worker;
|
|
if (!worker) return reject(new Error('no engine'));
|
|
const requestId = 'p-' + Math.random();
|
|
const timer = setTimeout(() => reject(new Error('timeout')), 30000);
|
|
const recv = ({ data }) => { if (data.requestId === requestId) { clearTimeout(timer); resolve(data); } };
|
|
worker.addEventListener('message', recv);
|
|
worker.postMessage({ requestId, command: { type: 'snapshot' } });
|
|
}));
|
|
const s = snap.result?.snapshot;
|
|
const wf = s?.editorWorkflow;
|
|
const ws = wf?.workspaces?.find(w => w.id === wf.context.workspaceId);
|
|
for (const area of (ws?.areas ?? [])) {
|
|
if (area.space?.outliner) {
|
|
console.log("OUTLINER-ROWS", JSON.stringify(area.space.outliner.rows.map(r => ({ label: r.label, depth: r.depth, objectId: r.objectId, remapId: r.remapId })), null, 1));
|
|
}
|
|
}
|
|
console.log("COLLECTIONS", JSON.stringify((s?.collections ?? []).map(c => ({ id: c.id, name: c.name, master: c.isMaster, children: c.childCollectionIds, objects: c.objectIds }))));
|
|
await browser.close();
|