VincentJiang06/dsh-mp-automator

微信小程序自动化测试 dsh 插件 — 基于选择器寻址的操作、构建新鲜度检查门、面向纯文本模型的几何优先断言、视觉路径上的真实截图。

Project Overview项目介绍

dsh-mp-automator is a DeepSeek Harness (DSH) plugin purpose-built for automated testing of WeChat Mini Programs running inside WeChat DevTools. It exposes eight mp_* tools that let any DSH agent read pages, tap elements by selector, drive navigation, take screenshots, inspect the console, and run an escape-hatch eval in the AppService context. Instead of relying on prompt-level instructions, the plugin encodes discipline directly inside the tools: a freshness gate (G1) that refuses stale build artifacts, selector-addressed actions that never reuse a uid, byte-clamped results, sha256-deduplicated screenshots, and a per-session image budget. Installation is a two-step flow: first npm i -g vince-mp-cli to provide the JSON-contract CLI that owns the DevTools automation port, then dsh plugin --profile web add dsh-mp-automator to mount the plugin into a DSH profile.

The target audience is Mini Program QA engineers, frontend regression testers, and teams wiring DSH agents to UI automation. A typical session looks like the agent calling mp_query to confirm a button is fully-visible relative to the current scroll window, then mp_act to tap it, then mp_screenshot plus mp_console to verify the new route rendered without errors. The companion skill at skill/mp-testing/SKILL.md layers judgment on top of the tools by teaching the inspect→act→verify cadence, selector discipline, and honest eval rules, while the plugin enforces structural guarantees such as fail-closed parsing (ok === true is the only success), explicit <imageStatus> reporting so a text-only model cannot pretend to have seen an image, and remedies attached to every CLI error code.

Runtime dependencies are strict: Node 20 or above, macOS, DSH ≥ 0.1.0-rc.5, WeChat DevTools with the service port enabled under Settings → Security, and the bundled vince-mp CLI pinned to ≥0.2.0 and <0.3.0 — any out-of-window version triggers a NOT_INSTALLED-style refusal with upgrade guidance. Configuration is injected via cordis.patch.yml under the mp-automator block and accepts five keys: freshnessMode (block|warn|off, default block), enableEval (true/false, default true), imageBudget (clamped non-negative integer, default 3 per session), screenshotDir (constrained to the project tree, default captures), and binPath (absolute override when the CLI is not on PATH). The repository is MIT-licensed and ships 51/51 passing tests, but first-run users must launch DSH from the Mini Program project directory so tools can resolve project.config.json from the session's working directory.

dsh-mp-automator 是一个面向 DeepSeek Harness (dsh) 的微信小程序自动化测试原生扩展。它通过内置的八个 mp_* 工具集,让 dsh 智能体在真实运行的微信开发者工具中读取页面、点击元素、截图并查看控制台,工具内部固化了"选择器寻址、新鲜度门、字节预算、图片预算"等纪律,而非依赖提示词约束。安装时需全局安装 vince-mp-cli,再通过 dsh plugin 命令将 dsh-mp-automator 注入 dsh profile,之后在含有 project.config.json 的小程序目录里启动 dsh 会话即可自然语言下达测试任务。

该插件专为小程序 QA、前端回归测试以及 dsh 驱动 UI 自动化的开发者设计。典型流程是:智能体先以 mp_query 确认目标元素可见性,再用 mp_act 执行 tap、input、nav、scan 等动作,最后用 mp_screenshot 与 mp_console 验证视觉与控制台状态,全程拒绝过期的 uid 与陈旧的编译产物,并对每张截图输出几何事实表以便纯文本模型也能解析。它附带的 skill/mp-testing/SKILL.md 提供 inspect→act→verify 节奏与断言配方,是工具之上的判断力层。

运行时依赖 macOS、Node ≥ 20、开启服务端口的微信开发者工具,以及 ≥0.1.0-rc.5 版本的 dsh;底层 CLI vince-mp 必须落在 ≥0.2.0 与 <0.3.0 的版本窗口,否则工具会以错误码拒绝并附升级指引。配置通过 cordis.patch.yml 注入,支持 freshnessMode、enableEval、imageBudget、screenshotDir 与 binPath 五项键值;许可证为 MIT,配套技能可不装,但建议加装以保障测试质量,首次运行前必须先在小程序项目根目录打开 dsh 会话。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add dsh-mp-automator

把 VincentJiang06/dsh-mp-automator 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-mp-automator

微信小程序自动化测试 · DeepSeek Harness (dsh) 插件 WeChat Mini Program automated testing for dsh agents

npm license tests

让 dsh 智能体驱动微信开发者工具里真实运行的小程序:读页面、点元素、截图、看控制台。 你只需要在小程序项目目录里开一个 dsh 会话,然后用自然语言下测试任务:

你:测试首页的"立刻开始"按钮能进入扫码页 agent:(mp_query 确认按钮可见 → mp_act 点击 → 验证路由已跳转 → mp_console 确认无报错) ✅ 按钮可见、可点、路由跳转正确、无控制台错误

Eight mp_* tools let a dsh agent drive a real Mini Program in WeChat DevTools. The correctness discipline is built into the tools — not into prompts the model may ignore.


目录 · Contents

  1. 工作原理 · How it works
  2. 快速开始 · Quick start
  3. 八个工具 · The eight tools
  4. 为什么可信:三种静默失败与对应的门 · Why trust it
  5. 截图:双路径与图片经济 · Screenshots
  6. 配置 · Configuration
  7. 配套技能 · Companion skill
  8. 排障 · Troubleshooting
  9. 设计笔记 · Design notes

1. 工作原理 · How it works

  dsh agent(任意模型;视觉能力可选)
    │
    │  调用 mp_* 工具 —— 纪律层:新鲜度门、选择器寻址、字节预算、图片经济
    ▼
  dsh-mp-automator(本插件)
    │
    │  驱动 vince-mp CLI —— 全 JSON 契约,首次调用协商版本 >=0.2.0 <0.3.0
    ▼
  微信开发者工具 自动化端口
    ▼
  你的小程序(真实运行时、真实 WXML)

分层职责 · Layering:vince-mp-cli 拥有自动化事实(DevTools 连接、元素解析、路径策略);本插件拥有面向智能体的纪律 (什么时候拒绝执行、输出多少字节、图片何时该进上下文)。The CLI owns automation truth; this plugin owns agent-facing discipline.

2. 快速开始 · Quick start

前置 · Prerequisites:macOS · 微信开发者工具 (在 设置 → 安全设置 里开启服务端口)· Node ≥ 20 · dsh ≥ 0.1.0-rc.5

# ① 安装本插件驱动的自动化 CLI(拥有 DevTools 连接)
npm i -g vince-mp-cli

# ② 把插件装进你的 dsh profile
dsh plugin --profile web add dsh-mp-automator

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev workspace-metabolism 下一个 Next dsh-win-toolkit →