con un clic
automator
负责页面操作:点击、输入、滚动、截图、验证。
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
负责页面操作:点击、输入、滚动、截图、验证。
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
微信开发者工具 任务执行的根入口。用于在执行前先完成环境检查,再路由到预览、自动化、调试与云相关操作。
负责云操作:云环境、云函数、云数据库、云存储。
负责编译:项目编译、单文件编译、编译到指定页面、构建 npm、刷新模拟器。
负责排查:查日志、查运行时、定位问题原因,也包括模拟器相关的状态检查与刷新。
初始化 微信开发者工具 开发环境与基础信息。用于项目窗口打开或接管、登录信息获取、AppID 信息获取以及运行时上下文读取。
负责预览和发布:推送手机预览、生成预览码、真机预览、上传代码包。
| name | automator |
| description | 负责页面操作:点击、输入、滚动、截图、验证。 |
在当前小程序项目内做确定性的 UI 操作和验证。
典型情况:
执行小程序页面导航。
wechatide -c <clientName> -t automation_navigate --project <project> --action navigateTo --url pages/index/index
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
project | string | 是 | 项目本地绝对路径 |
action | string | 是 | navigateTo、redirectTo、navigateBack、reLaunch、switchTab |
url | string | 否 | 目标页面路径(navigateBack 时不需要) |
delta | number | 否 | 回退层数(仅 navigateBack) |
执行元素点击、输入、文本读取、样式读取和触摸操作。点击和输入都用这个工具。
wechatide -c <clientName> -t automation_element_action --project <project> --selector button --action tap
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
project | string | 是 | 项目本地绝对路径 |
action | string | 是 | 见下方动作列表 |
selector | string | 是 | CSS 选择器,定位目标元素 |
type | string | 否 | trigger 的事件类型 |
detail | object | 否 | trigger 的事件 detail;CLI 使用 --detail-file |
value | string | 否 | input 的输入值 |
name | string | 否 | attribute 的属性名 |
x | number | 否 | 触摸坐标 x |
y | number | 否 | 触摸坐标 y |
touches | array | 否 | 触摸点列表;CLI 使用 --touches-file |
changedTouches | array | 否 | 变化的触摸点列表;CLI 使用 --changed-touches-file |
支持动作:tap、longpress、trigger、input、size、offset、text、attribute、value、property、wxml、outerWxml、style、scrollWidth、scrollHeight、scrollTo、touchstart、touchmove、touchend
执行页面数据读取、查询、等待和页面方法调用。
wechatide -c <clientName> -t automation_page_action --project <project> --action querySelectorAll --selector button
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
project | string | 是 | 项目本地绝对路径 |
action | string | 是 | getData、setData、waitFor、querySelector、querySelectorAll、size、callMethod、scrollTop |
path | string | 否 | getData 的数据路径 |
patch | string | 否 | setData 的补丁(JSON 字符串) |
condition | string | 否 | waitFor 的条件表达式 |
selector | string | 否 | querySelector/querySelectorAll 的选择器 |
method | string | 否 | callMethod 的方法名 |
args | array | 否 | callMethod 的参数;CLI 使用 --args-file |
执行全局操作:截图、页面滚动等。不支持 tap/input。
wechatide -c <clientName> -t automation_viewport_action --project <project> --action screenshot --wait-for-selector .submit-btn --path <localOutputPath>
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
project | string | 是 | 项目本地绝对路径 |
action | string | 是 | pageScrollTo、screenshot、testAccounts、stopAudits、getTicket、setTicket、refreshTicket、remote、close |
scrollTop | number | 否 | 页面滚动目标位置 |
path | string | 否 | 截图本地输出路径 |
waitForSelector | string | 截图时二选一 | 截图前等待该选择器出现,推荐优先使用 |
waitSeconds | number | 截图时二选一 | 截图前固定等待秒数,范围 0-10 |
ticket | string | 否 | ticket 值 |
截图要求:
action: "screenshot" 必须传入 waitForSelector 或 waitSeconds 之一。waitForSelector,让截图等待页面关键元素出现后再执行。waitSeconds。在小程序上下文中执行受控 evaluate。
wechatide -c <clientName> -t automation_evaluate --project <project> --fn-source 'function() { return 1 }'
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
project | string | 是 | 项目本地绝对路径 |
action | string | 固定 | 固定为 evaluate(CLI 自动注入,无需传参) |
fnSource | string | 是 | 要执行的函数源码 |
args | array | 否 | 函数参数;CLI 使用 --args-file |
获取 pageStack、currentPage 或 systemInfo。
wechatide -c <clientName> -t automation_runtime_info --project <project> --action currentPage
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
project | string | 是 | 项目本地绝对路径 |
action | string | 是 | pageStack、currentPage、systemInfo |
调用、mock 或恢复 wx API。
wechatide -c <clientName> -t automation_wx_api --project <project> --action call --method getSystemInfo
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
project | string | 是 | 项目本地绝对路径 |
action | string | 是 | call、mock、restore |
method | string | 是 | wx API 方法名 |
args | array | 否 | 调用参数;CLI 使用 --args-file |
result | object | 否 | mock 返回值;CLI 使用 --result-file |
functionDeclaration | string | 否 | mock 函数声明 |
把已记录调用生成可运行的 automator 脚本。生成结果作为草稿,使用前应人工检查。
wechatide -c <clientName> -t automation_generate_script [--include-failed] [--clear-history]
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
includeFailed | boolean | 否 | 是否包含失败的调用 |
clearHistory | boolean | 否 | 是否清除历史 |
| 用户意图 | 选择 |
|---|---|
| 想进入某个页面 | automation_navigate(action: navigateTo) |
| 想点击某个元素 | automation_element_action(action: tap) |
| 想输入文字 | automation_element_action(action: input) |
| 想读取元素文本 | automation_element_action(action: text) |
| 想查看页面有哪些元素 | automation_page_action(action: querySelectorAll) |
| 想截图 | automation_viewport_action(action: screenshot) |
| 想滚动页面 | automation_viewport_action(action: pageScrollTo) |
| 想读取页面数据 | automation_page_action(action: getData) |
| 想执行自定义表达式 | automation_evaluate |
点击页面中第一个 button:
wechatide -c CodeBuddy -t automation_element_action --project <project> --selector button --action tap
向 input 输入文字:
wechatide -c CodeBuddy -t automation_element_action --project <project> --selector input --action input --value hello
读取某元素的文本内容:
wechatide -c CodeBuddy -t automation_element_action --project <project> --selector .title --action text
查找页面中所有 button 元素:
wechatide -c CodeBuddy -t automation_page_action --project <project> --action querySelectorAll --selector button
截图(推荐等待关键元素出现):
wechatide -c CodeBuddy -t automation_viewport_action --project <project> --action screenshot --wait-for-selector .submit-btn --path <localOutputPath>
automation_element_action 完成,不是 automation_viewport_actionautomation_viewport_action 仅用于全局操作(截图、页面滚动等),不支持 tap/inputwaitForSelector 或 waitSeconds;优先选择能代表页面已渲染完成的 selectorautomation_element_action 必须提供 selector 参数(CSS 选择器),用于定位目标元素automation_page_action(action: querySelectorAll)列出元素如果自动化相关调用出现 timeout,不要只停留在报错本身。
推荐处理方式:
使用提醒: