feat(web): deployed functional suite, outliner expansion fix and local-first runs
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

Outliner: react-accessible-treeview's controlled expandedIds sync expands a
node together with its parent, then the next pass treats that extra parent id
as removed from the controlled set and collapses the whole branch. Reproduced
as a collapsed tree after ch11 -> ch12 (scene rows complete in React, one
collapsed row in the DOM). Keep OUTLINER_ROOT_ID in the controlled set so both
passes agree, and drop the rows-digest memo that regressed the normal path.
Also arm a bounded post-open OUTLINER_REFRESH loop so the tree settles on rows
of the newly opened Main instead of the previous one.

Tests: web/playwright.deployed.config.ts + web/tests/deployed walk the 31
manual chapters and the 31 capability rows headed against a deployed origin,
and tools/web/run-deployed-functional-tests.mjs preflights, runs and reports.
--local serves the production bundle from web/dist on loopback with the same
COOP/COEP/CORP/CSP headers, so a case costs compile time instead of a 300 MB
download: full local suite 60/60 in 10.3 min, also 60/60 against the deployed
release. Report dirs are resolved absolute and [ch28a]-style tags map to their
chapter.

Area layout: split from the clamped source rect and keep the area switcher
inside a narrow header.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-11-24 16:12:26 +08:00
parent 570aa2dd54
commit a5f772e18f
162 changed files with 9341 additions and 8 deletions

View File

@@ -0,0 +1,25 @@
# tests/deployed — 线上功能测试用例
运行入口不在本目录,而是仓库根的 `tools/web/run-deployed-functional-tests.mjs`(它做预检、生成报告)。直接跑 Playwright 也可以:
```bash
cd web
DISPLAY=:1 WEB_ORIGIN=https://49.232.250.35:58014 \
npx playwright test --config playwright.deployed.config.ts --workers=1 tests/deployed/01-files.spec.ts
```
## 写作规范
- 标题形如 `"[ch07] …"`:方括号里的 `chNN` 会进入报告的章节覆盖统计;`manual-page`、`preflight-http`、`cap-layout` 等自定义标签同理。
- 每条用例必须至少一个**用户可见**断言:对象数、面数、状态栏文本、下载文件名、OPFS 内容、渲染像素宽度。禁止只断言「元素被点击」。
- 结束前调用 `receipt(testInfo, {...})` 写入 `{status, screenshot, …}`;`shot(page, testInfo, name)` 存关键截图。
- 需要打开工程时用 `openProject(page, path)`(内含启动等待 + `SceneIR` 等待),不要自己写 `waitForTimeout`。
- 默认入口(`gotoApp(page, "native")`)有原生覆盖层,指针点击会被吞掉,须用 `element.click()`。
## 辅助文件
| 文件 | 内容 |
| --- | --- |
| `support/deployed.ts` | `gotoApp`、`waitEngineBoot`、`waitEngineReady`、`openProject`、`openBlend`、`waitForObjects`、`shot`、`receipt`、`opfsProjectIds`、`FIXTURES` |
| `support/chapters.ts` | 手册 31 章的 `CHAPTERS` / `chapter(id)` |
| `support/matrix.ts` | 能力矩阵 31 行的 `CAPABILITIES` |