From 5fc070d8d859b9c83ff91eeea9e8d9e2ff1472f2 Mon Sep 17 00:00:00 2001 From: mes123456 Date: Sat, 14 Nov 2026 10:37:29 +0800 Subject: [PATCH] test(web): record image editor selection evidence Co-Authored-By: Claude Code --- .../WBV2-P1425-001-web-operator-dispatch.md | 4 ++ .../continuation-20261113-web-export.json | 8 +++- tools/web/complete/probe-image-editor.mjs | 48 +++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 tools/web/complete/probe-image-editor.mjs diff --git a/docs/status/WBV2-P1425-001-web-operator-dispatch.md b/docs/status/WBV2-P1425-001-web-operator-dispatch.md index 0d375c5cd..c8027cb63 100644 --- a/docs/status/WBV2-P1425-001-web-operator-dispatch.md +++ b/docs/status/WBV2-P1425-001-web-operator-dispatch.md @@ -462,6 +462,10 @@ - UV Editor 控件:展开“展开 UV”面板,ANGLE_BASED 展开后 UV 归一化到 0.0001–0.9999;“打包 UV 岛屿”执行后 revision r5、范围保持。证据 `tools/web/complete/probe-uv-controls.mjs`。 +- Image Editor(Shading 工作区):图像选择器列出 `PBR Studio Environment`, + 选中后 `Image view` 显示图像;证据 + `tools/web/complete/probe-image-editor.mjs`。`Fit View` 按钮在自动化中 + 未定位到可见元素,未判定为缺陷。 - Sequencer:Properties 的 Sequencer Strip Editing → Add Strip 创建 `Web MOVIE`(MOVIE);证据 `tools/web/complete/probe-sequencer.mjs`。 - Outliner:右键 `Data` 菜单 → 重命名,`PBR Studio Ground` → `GroundRenamed`, diff --git a/tests/golden/WBV2-P1425-001/continuation-20261113-web-export.json b/tests/golden/WBV2-P1425-001/continuation-20261113-web-export.json index 19d202fa6..fb3a7ee4b 100644 --- a/tests/golden/WBV2-P1425-001/continuation-20261113-web-export.json +++ b/tests/golden/WBV2-P1425-001/continuation-20261113-web-export.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "task": "WBV2-P1425-001", - "updatedAt": "2026-11-14T09:31:00+08:00", + "updatedAt": "2026-11-14T09:36:00+08:00", "status": "in_progress", "focus": "COMPLETE-TUTORIAL-001 backend export gap (USD/Alembic)", "breakpoint": "blender-5.2.0/source/blender/web_engine/CMakeLists.txt (USD wiring); WASM 6ee2b261", @@ -298,5 +298,11 @@ "result": "ANGLE_BASED unwrap → UV 0.0001–0.9999; pack islands → r5, range preserved", "script": "tools/web/complete/probe-uv-controls.mjs", "acceptance": "NOT_CLAIMED" + }, + "imageEditorProbe": { + "result": "Shading image editor lists PBR Studio Environment and renders it (hasImage true)", + "note": "Fit View button not located visibly in automation; not claimed as a defect", + "script": "tools/web/complete/probe-image-editor.mjs", + "acceptance": "NOT_CLAIMED" } } diff --git a/tools/web/complete/probe-image-editor.mjs b/tools/web/complete/probe-image-editor.mjs new file mode 100644 index 000000000..b084a75cf --- /dev/null +++ b/tools/web/complete/probe-image-editor.mjs @@ -0,0 +1,48 @@ +#!/usr/bin/env node +/** + * Focused case: Shading workspace Image Editor selects an image and fits it. + * + * node tools/web/complete/probe-image-editor.mjs --base-url http://127.0.0.1:5176 + */ +import { ASSETS, parseArgs, launchBrowser, newPage, openFile, waitScene, switchWorkspace } from "../course/lib/lesson-recorder.mjs"; + +const args = parseArgs(); +const BASE = args.baseUrl || "http://127.0.0.1:5176"; +const browser = await launchBrowser(args.gpu); +const { context, page, consoleErrors } = await newPage(browser, { baseUrl: BASE }); +page.setDefaultTimeout(90_000); +const log = (...parts) => console.log(new Date().toISOString().slice(11, 19), ...parts); +const state = async () => page.evaluate(() => ({ + images: Array.from(document.querySelectorAll('select[aria-label="图像"] option')).map((node) => ({ value: node.value, text: node.textContent })), + hasImage: Boolean(document.querySelector('[aria-label="Image view"] img')), + viewStatus: document.querySelector('.image-view-status')?.textContent ?? null, + status: document.querySelector('[data-testid="engine-status"]')?.textContent ?? "", +})); +try { + await openFile(page, ASSETS.studio); + await waitScene(page, { objects: 6, timeout: 240_000 }); + await switchWorkspace(page, "Shading"); + const view = page.locator('[aria-label="Image view"]').first(); + await view.waitFor({ timeout: 30_000 }); + log("before", JSON.stringify(await state())); + const select = page.locator('select[aria-label="图像"]').first(); + const options = await select.locator('option').evaluateAll((nodes) => nodes.map((node) => node.value).filter(Boolean)); + if (!options.length) throw new Error("no image options"); + await select.selectOption(options[0]); + for (let index = 0; index < 60; index++) { + await page.waitForTimeout(500); + const current = await state(); + if (current.hasImage) { log("loaded", JSON.stringify(current)); break; } + if (index === 59) log("timeout", JSON.stringify(current)); + } + await page.locator('button:visible').filter({ hasText: "Fit View" }).first().evaluate((element) => element.click()); + await page.waitForTimeout(800); + log("fit", JSON.stringify(await state())); +} catch (error) { + log("probe error", error instanceof Error ? error.message : String(error)); + log("state", JSON.stringify(await state().catch(() => null))); +} finally { + log("consoleErrors", JSON.stringify(consoleErrors.slice(-8))); + await context.close(); + await browser.close(); +}