Use when designing, testing, fixing, or extending the OpenClaw Control UI GUI, including UI stress-test galleries with feedback inputs, Vitest + Playwright end-
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-control-ui-e2e-6dda7a59100f ,按照其中的说明把「control-ui-e2e」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Use this for Control UI design feedback and real browser flows with deterministic Gateway data.
For substantial UI changes, build a local HTML stress-test gallery early so the user can compare meaningful states and give feedback against concrete examples. Use it when changing layouts, interactions, or components with multiple states; small copy or icon edits can skip it when a gallery adds no useful comparison.
The gallery supports design review; it does not replace focused behavior tests or inspected before/after proof from the running UI. Preserve final proof using the fresh capture directories described below, separately from the evolving gallery.
ui/src/**/*.e2e.test.ts for full GUI flows.ui/src/test-helpers/control-ui-e2e.ts to start the Vite Control UI and install a mocked Gateway WebSocket..browser.test.ts or unit tests for narrow rendering logic; use this E2E lane when the proof should cover routing, app boot, Gateway handshake, requests, and visible UI behavior together.node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-flow.messaging.e2e.test.ts
pnpm test:ui:e2e
Use an existing ready dependency installation or a prepared normal checkout;
do not reconcile a shared install while other jobs use it. Follow
$openclaw-testing: trusted development proof may run locally, and remote
proof needs a browser/platform, clean-environment, or source-isolation reason.
For appearance changes, capture inspected before/after visual evidence. For other behavior, use the clearest appropriate boundary proof; a video and a screenshot set are not mandatory when assertions already demonstrate the change.
pnpm dev:ui:mock -- --port <port>.browser.newContext({ recordVideo: { dir, size }, viewport }), page.screenshot({ path }), and close the context before reporting the video path.createControlUiE2eArtifactDir(scope, parentDir?) from ui/src/test-helpers/control-ui-e2e-artifacts.ts. Each call atomically creates a fresh directory and logs its actual path. An explicit parent wins, then the trimmed existing OPENCLAW_UI_E2E_ARTIFACT_DIR, then the repository's .artifacts/control-ui-e2e parent. Existing custom output controls select parents; do not add or rewrite env vars to enable capture.beforeEach, once per attempt; standalone scripts allocate once per invocation. Pass the owner explicitly to shared capture helpers. Keep the original gates, feature/stage names, viewports, waits, and recording options. Use distinct filenames for distinct stages and keep screenshots, reports, and video together.chat-outbox-*, and chat-attachment-read-lifecycle remain separate owners; coordinate before claiming replay-safe retention there.Start the app server, install the mock before page.goto, then assert both Gateway traffic and visible UI:
const server = await startControlUiE2eServer();
const page = await context.newPage();
const gateway = await installMockGateway(page, {
historyMessages: [{ role: "assistant", content: [{ type: "text", text: "Ready." }] }],
});
await page.goto(`${server.baseUrl}chat`);
await page.locator(".agent-chat__composer-combobox textarea").fill("hello");
await page.getByRole("button", { name: "Send message" }).click();
const request = await gateway.waitForRequest("chat.send");
await gateway.emitChatFinal({ runId: String(request.params.idempotencyKey), text: "Done." });
await page.getByText("Done.").waitFor();
Extend installMockGateway with typed scenario options or method responses when a new flow needs more Gateway surface.
For narrated captions, eased target zooms, or fast-forwarded pauses, use the proof-video dev skill. Its standalone template records raw evidence plus a cue sidecar and renders a captioned MP4 with system ffmpeg; keep the raw capture and attach the inspected polished video.
When recording an already-running mocked Control UI URL, use a temporary Playwright script or playwright test spec and keep the recording flow focused:
data-* selectors or user-facing role selectors, and wait on asserted states instead of relying on fixed sleeps.sessions.list was called with the expected search, offset, and limit.