Files
workinf_Blender_Wasm/tools/web/.probe22.mjs
mes123456 f3e21c6b98
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
chore: checkpoint web Blender migration source, tools and docs
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>
2026-11-10 11:18:01 +08:00

26 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 py = []; page.on("console", m => { const t = m.text(); if (/WBV2_PY_|REENTRANT/.test(t)) py.push(t.slice(0,160)); });
await page.goto("http://127.0.0.1:5407/", { 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 st = () => page.evaluate(() => ({ ws: document.querySelector("main")?.getAttribute("data-workspace"), display: document.querySelector('canvas[aria-label="Blender desktop"]')?.getAttribute("data-native-display"), detail: (document.querySelector("main")?.getAttribute("data-last-diagnostic-detail")||"").slice(0,200) }));
const go = (n) => page.evaluate((v) => { const b=[...document.querySelectorAll('nav[aria-label="工作区"] button')].find(x=>(x.textContent||"").trim()===v); b?.click(); }, n);
const mark = async (label) => { await page.waitForTimeout(300); py.push("--- " + label + " ---"); };
await go("Modeling"); await page.waitForTimeout(7000); await mark("after-entering-Modeling");
await go("Shading"); await page.waitForTimeout(9000); await mark("after-entering-Shading");
await go("Layout"); await page.waitForTimeout(8000); await mark("after-leaving-Shading");
console.log("STATE", JSON.stringify(await st()));
const enter = py.filter(l => l.startsWith("WBV2_PY_ENTER")).length;
const leave = py.filter(l => l.startsWith("WBV2_PY_LEAVE")).length;
console.log("COUNTS enter=", enter, "leave=", leave);
console.log(JSON.stringify(py.slice(-30), null, 1));
await browser.close();