b93c92a3e2
Memind CI / Test, build, and release guards (push) Failing after 14m27s
The read_image poisoning fix had no end-to-end guard because scenarios could only send text. Add an upload_images step that renders and uploads visually distinct images, let chat steps attach them the same way the WeChat channel does, and assert the generated page actually embeds every upload. Co-authored-by: Cursor <cursoragent@cursor.com>
3.7 KiB
3.7 KiB
name, description
| name | description |
|---|---|
| memind-scenario-test | Run Memind end-to-end scenario simulations (login, multi-turn chat, page generation, public URL checks). Use when the user asks for 模拟场景测试, 场景测试, E2E 流程验证, 模拟用户操作, or describes a step-by-step chat/page test flow. |
Memind 场景模拟测试
用户说「帮我模拟场景测试」或描述多步聊天/做页面流程时,必须走本 skill,不要手动拼 curl 或浏览器点选。
唯一入口
node scripts/run-scenario-test.mjs --scenario <id>
列出场景:
node scripts/run-scenario-test.mjs --list
前置条件
- 本地 Portal 已运行(默认
http://127.0.0.1:8081,可用pnpm dev) - goosed / agent 链路可用(场景会真实发消息并等待 agent 回复)
- 账户默认
john/888888;密码可用JOHN_PASSWORD覆盖
启动前检查:
curl -sf http://127.0.0.1:8081/auth/status
默认场景:苏州攻略页面
对应用户定义的流程,场景文件 scenarios/suzhou-page.json:
- 登录
john/888888 - 发送
hi,等待 assistant 回复 - 发送
帮我看看苏州攻略,1日攻略,做一个页面 - 验证:收到回复、含苏州关键词、有公网页面链接、HTTP 200、页面内容命中关键词
执行:
node scripts/run-scenario-test.mjs --scenario suzhou-page
Agent 工作流
- 确认场景:用户未指定时默认
suzhou-page;说了别的流程则查--list或新建场景文件 - 确认服务:Portal
/auth/status必须 200 - 执行脚本:完整跑完,不要中途改用浏览器手点
- 失败处理:读失败项 → 修代码或环境 → 重跑同一场景
- 汇报:用下方模板
扩展新场景
复制 scenarios/_template.json 为 scenarios/<id>.json。
步骤类型(当前支持):
| action | 说明 |
|---|---|
login |
HTTP 登录,取 cookie + userId |
chat |
发消息(同 session 多轮),等 run 终态 + assistant 新回复 |
upload_images |
生成并上传测试图片到 MindSpace,供后续 chat 步骤引用 |
upload_images 字段:categoryCode(默认 oa)、images[]
(每项 filename / background / shape / accent,shape 支持
circle square triangle diamond)。后续 chat 步骤设
useUploadedAssets: true 即可把这些图作为本轮附件发出。
chat.expect 可选断言:
assistantMinChars/timeoutMsreplyKeywords:回复文本关键词forbidReplyPatterns:回复中不允许出现的字符串page.keywords/requirePublicLink/requireHttp200/requireMindspaceCoverpage.requireUploadedImages/page.minUploadedImages:页面必须嵌入upload_images上传的资产
新增更复杂步骤(截图、微信、多账户)时:先扩展 scripts/scenario-test-lib.mjs,再加场景 JSON,不要在 skill 里写死一次性命令。
结果模板
## 场景测试结果
- 场景:suzhou-page(苏州攻略一日游页面)
- Portal:http://127.0.0.1:8081
- 账户:john
- 结果:通过 / 失败
### 步骤
1. 登录 — 通过
2. hi → 回复 — 通过(N 字)
3. 苏州页面 — 通过 / 失败
### 页面(如有)
- 链接:
- HTTP:
- 关键词:
### 失败项与下一步
与 memind-test 的分工
| 诉求 | 用哪个 |
|---|---|
| 模拟真实用户聊天 + 做页面 | 本 skill(run-scenario-test.mjs) |
| 改代码后跑单测/回归守卫 | memind-test skill(run-memind-tests.mjs) |
| 103 发包 | portal-release skill |