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>
28 lines
2.3 KiB
JavaScript
28 lines
2.3 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();
|
|
const errs = []; page.on("console", m => { if (m.type()==="error" || /worker|Worker/.test(m.text())) errs.push(m.type()+": "+m.text().slice(0,300)); });
|
|
page.on("pageerror", e => errs.push("pageerror: "+String(e).slice(0,300)));
|
|
await page.goto("http://127.0.0.1:5404/", { 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/basic_scene.blend"));
|
|
await page.waitForFunction(() => /Active Basic/.test(document.querySelector('[data-testid="scene-stats"]')?.textContent ?? ""), undefined, { timeout: 120000 });
|
|
await page.waitForTimeout(2000);
|
|
const full = () => page.evaluate(() => {
|
|
const m = document.querySelector("main");
|
|
const attrs = {}; for (const a of m.attributes) if (/worker|recovery|engine|main-revision|diagnostic/.test(a.name)) attrs[a.name] = a.value.slice(0,120);
|
|
return { ws: m.getAttribute("data-workspace"), engine: document.querySelector('[data-testid="engine-status"]')?.textContent, code: m.getAttribute("data-last-diagnostic-code"), detail: (m.getAttribute("data-last-diagnostic-detail")||"").slice(0,240), attrs };
|
|
});
|
|
const go = (n) => page.evaluate((v) => { const b=[...document.querySelectorAll('nav[aria-label="工作区"] button')].find(x=>(x.textContent||"").trim()===v); b?.click(); }, n);
|
|
const before = errs.length;
|
|
await go("Compositing"); await page.waitForTimeout(9000);
|
|
console.log("ENTER", JSON.stringify(await full()));
|
|
await go("Layout"); await page.waitForTimeout(8000);
|
|
console.log("LEAVE", JSON.stringify(await full()));
|
|
console.log("ERRS", JSON.stringify(errs.slice(before).slice(0,8), null, 1));
|
|
await browser.close();
|