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>
33 lines
2.5 KiB
JavaScript
33 lines
2.5 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.goto("http://127.0.0.1:5411/?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(3000);
|
|
const tree = () => page.evaluate(() => [...document.querySelectorAll('[role="treeitem"]')].map(n => ({ name: n.getAttribute('aria-label') ?? (n.textContent||'').trim().slice(0,26), level: n.getAttribute('aria-level'), parent: n.getAttribute('data-parent-id') })));
|
|
console.log("BEFORE", JSON.stringify(await tree()));
|
|
// select Payload, then ctrl-select NewParent via the tree
|
|
const clickTree = async (name, mods = []) => {
|
|
const el = page.getByRole('treeitem', { name, exact: true }).first().locator('.tree-node-name').first();
|
|
await el.click({ modifiers: mods });
|
|
await page.waitForTimeout(2500);
|
|
};
|
|
await clickTree('Payload');
|
|
await clickTree('NewParent', ['Control']);
|
|
console.log("SELECTED", JSON.stringify(await page.evaluate(() => document.querySelector('main')?.getAttribute('data-selected-object-ids'))));
|
|
await page.getByRole('button', { name: '物体', exact: true }).click();
|
|
await page.waitForTimeout(800);
|
|
await page.getByRole('menuitem', { name: '父级', exact: true }).click();
|
|
await page.waitForTimeout(800);
|
|
await page.getByRole('menuitem', { name: '设定父级', exact: true }).click();
|
|
await page.waitForTimeout(6000);
|
|
console.log("AFTER", JSON.stringify(await tree()));
|
|
console.log("ENGINE", JSON.stringify(await page.evaluate(() => ({ engine: document.querySelector('[data-testid="engine-status"]')?.textContent, detail: (document.querySelector("main")?.getAttribute("data-last-diagnostic-detail")||"").slice(0,160) }))));
|
|
await browser.close();
|