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>
32 lines
2.4 KiB
JavaScript
32 lines
2.4 KiB
JavaScript
import { createRequire } from "node:module";
|
|
import fs from "node:fs"; 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 }, acceptDownloads: true });
|
|
const page = await ctx.newPage();
|
|
await page.goto("http://127.0.0.1:5402/", { 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 ws = () => page.evaluate(() => ({ ws: document.querySelector("main")?.getAttribute("data-workspace"), area: document.querySelector("main")?.getAttribute("data-editor-workflow-area") }));
|
|
console.log("START", JSON.stringify(await ws()));
|
|
const clickWs = (name) => page.evaluate((v) => {
|
|
const btns = [...document.querySelectorAll('nav[aria-label="工作区"] button')];
|
|
const b = btns.find(n => (n.textContent||"").trim() === v);
|
|
if (!b) return { found: false, names: btns.map(n => (n.textContent||"").trim()) };
|
|
b.click();
|
|
return { found: true, disabled: b.disabled, cls: b.className };
|
|
}, name);
|
|
console.log("CLICK-Modeling", JSON.stringify(await clickWs("Modeling")));
|
|
for (const t of [1000, 2000, 4000, 8000]) { await page.waitForTimeout(t === 1000 ? 1000 : t - (t === 2000 ? 1000 : t === 4000 ? 2000 : 4000)); console.log("T"+t, JSON.stringify(await ws())); }
|
|
console.log("F3TAP", JSON.stringify(await page.evaluate(() => { const b = document.querySelector('[aria-label="操作搜索"]'); b?.click(); return Boolean(b); })));
|
|
await page.waitForTimeout(2000);
|
|
await page.keyboard.press("Escape");
|
|
await page.waitForTimeout(1500);
|
|
console.log("CLICK-Scripting", JSON.stringify(await clickWs("Scripting")));
|
|
await page.waitForTimeout(5000);
|
|
console.log("AFTER-Scripting", JSON.stringify(await ws()));
|
|
await browser.close();
|