微信小程序自动化测试

v1.0.0

WeChat Mini Program automation testing toolkit. Supports launching DevTools, page navigation, element interaction, screenshots, console log reading, and more...

1· 166·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for eumenides-k/weapp-automated-testing.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "微信小程序自动化测试" (eumenides-k/weapp-automated-testing) from ClawHub.
Skill page: https://clawhub.ai/eumenides-k/weapp-automated-testing
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install weapp-automated-testing

ClawHub CLI

Package manager switcher

npx clawhub@latest install weapp-automated-testing
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
The skill implements WeChat DevTools automation (launching DevTools, navigation, clicks, screenshots, console reading) and the included Python modules align with that purpose. However, the package metadata lists no required binaries or credentials while the code clearly relies on Node.js, npm, the global npm package 'miniprogram-automator', and the WeChat DevTools CLI. That omission is a transparency/information gap but not necessarily malicious.
Instruction Scope
SKILL.md and the scripts restrict actions to DevTools automation: generating temporary Node.js scripts, connecting to a local WebSocket service port (default ws://localhost:9420), driving pages, taking screenshots, and reading console/log data. The ConsoleReader also attempts to locate DevTools log files under user profile directories (AppData/Library paths) which is relevant to console log reading but is the only part that touches user filesystem outside a project directory.
Install Mechanism
There is no install spec (instruction-only skill + shipped scripts). That reduces install-surface risk. The runtime does create temporary JS files and runs them with 'node' and attempts to set NODE_PATH using 'npm root -g' (shell=True). Those are expected for this tooling but mean the environment must trust the npm package 'miniprogram-automator' and have Node/npm available.
Credentials
The skill requests no environment variables or credentials (correct). Still, it reads DevTools log files from standard user profile locations and prints/exports systemInfo/getCurrentPages data collected via the automator script; such data can include device/system details. No external network endpoints are contacted except the local WebSocket to DevTools. Overall the requested access is proportionate to automation/testing, but users should note the log-file access and local system info collection.
Persistence & Privilege
The skill does not request persistent/always-on privileges and does not modify other skills or system-wide agent settings. It writes temporary scripts to the system temp directory during execution and removes them afterward (normal behavior for this approach).
Assessment
This skill appears to do what it says: drive WeChat DevTools and run automated tests by generating and executing temporary Node.js scripts that use the 'miniprogram-automator' package and the DevTools CLI. Before installing or running it: 1) Ensure you have Node.js, npm, and WeChat DevTools installed and understand that the skill will call the DevTools CLI and open a local automation WebSocket (default ws://localhost:9420). 2) The skill will create temporary .js files in the system temp dir and execute them with node; review the shipped Python/JS source (included) and only run if you trust the code and the npm package 'miniprogram-automator'. 3) The ConsoleReader scans common DevTools log locations under your user profile — expect reading of log files and collection of systemInfo/getCurrentPages data; avoid running in environments with sensitive logs you don't want read. 4) Run first in an isolated/non-privileged account or container if you are unsure, and verify npm package provenance (use a known npm registry and inspect package version).

Like a lobster shell, security has layers — review code before you run it.

latestvk97agj0nvafsqs3gj811yc9c8583ebby
166downloads
1stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

WeChat Mini Program Automation Testing

CRITICAL: Batch Execution Rule

ALWAYS write a single Python script that uses WeappTestRunner to batch ALL operations, then execute it with ONE python call.

Each tool call costs ~30-60s overhead. A test with 10 individual CLI calls takes 5-15 minutes; the same 10 operations batched into one script take ~5 seconds.

Execution pattern

  1. Plan all operations the user needs
  2. Write a single Python script using WeappTestRunner
  3. Run with one python command
  4. Read output and report results

Example

import sys
sys.path.insert(0, r"path_to_weapp-automation_skill\scripts")
from weapp_automation import AutomationConfig, WeappTestRunner

config = AutomationConfig(
    project_path=r"path_to_your_miniapp\my_mini_app",
    ws_endpoint="ws://localhost:9420"
)

runner = WeappTestRunner(config)
results = (runner
    .navigate("pages/index/index")
    .wait(2)
    .screenshot("home.png")
    .click(".category-item")
    .wait(1)
    .screenshot("after_click.png")
    .get_results())

print(runner.get_summary())
for r in results:
    print(r)

Save as a .py file and run with python script.py.


Prerequisites

  1. Install: npm install -g miniprogram-automator
  2. Open WeChat DevTools -> Settings -> Security Settings -> Enable "Service Port"
  3. Ensure the project is imported into DevTools

CLI paths:

  • macOS: /Applications/wechatwebdevtools.app/Contents/MacOS/cli
  • Windows: C:\Program Files (x86)\Tencent\微信web开发者工具\cli.bat

WeappTestRunner Chainable Methods

MethodDescription
.navigate(page_path)Navigate to a page
.click(selector)Tap an element
.input(selector, text)Type text into an input field
.screenshot(filename)Take a screenshot
.scroll(selector, direction, distance)Scroll an element
.get_wxml(selector)Extract WXML DOM structure
.get_data(path)Read page data
.wait(seconds)Wait for a duration
.run()Execute all queued steps
.get_results()Execute and return results list
.get_summary()Return pass/fail summary dict

Other APIs

  • WeappAutomation - Single-step API for one-off operations
  • WeappLauncher - Launch/close WeChat DevTools
  • ConsoleReader - Read and analyze console logs
  • PerformanceMonitor - Collect performance metrics
  • TestScenarios - Pre-built test scenario templates (smoke, navigation, form, UI regression, user journey)

For detailed usage, parameters, and examples of all APIs, see references/api_reference.md.


Script Inventory

ScriptPurpose
scripts/weapp_launcher.pyLaunch/close WeChat DevTools
scripts/weapp_automation.pyCore automation engine (batch + single-step)
scripts/console_reader.pyConsole log reading and analysis
scripts/test_scenarios.pyPre-defined test scenario templates

Comments

Loading comments...