Preface¶
uni-app and uni-app x projects often maintain .vue / .uvue pages and the routing structure under pages/ simultaneously. End-to-end testing also requires distinguishing between scripts for multiple platforms such as Web, App, HarmonyOS, and WeChat Mini Programs. Hand-writing *.test.js, adjusting selectors to match pages, and executing npm run test:* separately can easily lead to a back-and-forth switch between “adding test cases — running platforms — fixing failures.” Below is an introduction to uniapp-test on SkillHub, which organizes “reading page structure → generating or supplementing tests → running on specified platforms → fixing until passed” into a workflow that Agents can follow, rather than providing scattered suggestions in a single Q&A session.
What is this¶
uniapp-test (coordinate @user_3141f90e/uniapp-test, version 1.0.0) is a community-sourced Agent Skill categorized under dev-programming. It is maintained by the publisher user_3141f90e. The SkillHub page is marked with requires_api_key=false, requiring no additional API Key.
One-sentence positioning: An automated test engineer workflow Skill for uni-app / uni-app x—analyzing .uvue or .vue pages, generating or refining *.test.js with the same names, running tests on Web / Android / iOS / HarmonyOS / WeChat Mini Programs, and assisting in rewriting cases until they pass upon failure.
Official Entrances:
- API / Installation clues: https://api.skillhub.cn/user_3141f90e/uniapp-test
- SkillHub Display Page: https://www.skillhub.cn/skills/user_3141f90e/uniapp-test
(SkillHub current display: Rating 100000, Downloads 2382.)
Core Features¶
The following capabilities are derived from the official brief and the SkillHub page description. Implementation details that are not explicitly expanded upon are not speculated upon.
-
Page Structure Analysis
Provides a structural basis for subsequent test cases targeting.uvue,.vue, and pages within thepages/directory in the project. -
Test Case Generation and Refinement
Produces or completes*.test.jscorresponding to pages, covering common uni automation API scenarios (such asprogram.reLaunch,page.$,page.waitFormentioned in the brief). -
Multi-platform Execution
Aligns the workflow with existing npm test scripts in the project, including but not limited to:
-npm run test:web
-npm run test:app-android
-npm run test:app-ios
-npm run test:app-harmony
-npm run test:mp-weixin -
Failure Fix Loop
Continues to modify test cases under the guidance of the same Skill after a run failure until the tests pass. -
Broad Trigger Scope
The Skill should be enabled when the user mentions uni-app, uniapp, uni-app x, uvue, uni automated testing,pages/page testing,*.test.js, or expresses a need to “write tests / run tests / fix tests for a certain page,” even if the four words “automated testing” are not explicitly stated.
Installation and Activation¶
SkillHub official recommendation: First configure the CLI according to the SkillHub Installation Instructions, then install this Skill to the skills directory actually read by the current Agent (installing to the wrong directory will result in the Agent failing to recognize it).
1. Check or Install skillhub CLI¶
command -v skillhub && skillhub --version
If not installed, you can use the official full installation script (the documentation notes that sandbox environments require network permissions):
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash
If only the CLI is needed:
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only
2. Install uniapp-test¶
When installing, you must use --dir to point to the skills directory of the current environment. Common path examples given in the SkillHub documentation:
| Environment | skills Directory (Example) |
|---|---|
| Cursor | ~/.cursor/skills/ |
| Claude Code | ~/.claude/skills/ |
| Codex | ~/.codex/skills/ or .agents/skills/ under the project |
Taking Cursor as an example:
skillhub install @user_3141f90e/uniapp-test --dir ~/.cursor/skills/
You can also hand the installation prompt directly to the Agent: “Please install @user_3141f90e/uniapp-test based on https://skillhub.cn/install/skillhub.md.”
After installation, restart or refresh the Agent according to the requirements of the client being used to enable the Skill.
Typical Usage¶
No independent long-form example repository is provided on the public page; the reproducible usage is within a project that already possesses uni automated testing infrastructure, driving the above workflow via natural language.
-
Supplement tests for a single page
Specify the page path underpages/or the.vue/.uvuefile, and request the generation or refinement of the corresponding*.test.js. -
Run by platform
Explain the target platform and let the Agent select the matching script, for example, for the Web platform:
npm run test:web
App Android:
npm run test:app-android
Similarly, use test:app-ios, test:app-harmony, and test:mp-weixin for other platforms.
- Post-failure repair
Paste the failure log or explain assertion/wait timeouts, and request adjustments to the test cases based on APIs likepage.$,page.waitFor,program.reLaunch, and repeat the execution until it passes.
Through the above steps, the value of the Skill lies in binding “writing cases, selecting commands, and modifying selectors” into a single conversational workflow, rather than just generating a piece of example code that cannot align with the project scripts.
Applicable Scenarios and Notes¶
Who it is for
- Teams or individuals already using
*.test.jsandnpm run test:*in uni-app / uni-app x projects. - Those who need cross-platform regression across Web, Native App, HarmonyOS, and WeChat Mini Programs but wish for the Agent to handle page analysis and test case iteration.
Limitations and Notes
- This Skill does not replace the local testing environment: each platform still relies on the project’s own testing framework, simulators/real devices, and dependency installation; the Skill guides the workflow and test case content.
- The installation directory must be consistent with the current Agent; official documentation emphasizes that if installed to the default
./skills/, many Agents will not automatically load it. - The public SkillHub page does not include a full mirror of the
SKILL.mdtext; specific step details are subject to the Skill files installed locally. - Ratings and download counts come from the SkillHub display and will change over time; refer to the official website when citing.
Conclusion¶
uniapp-test converges uni-app multi-platform page testing into an Agent workflow of “Analyze Page → Maintain *.test.js → Run corresponding npm run test:* → Fix Failures,” which is suitable for reducing manual orchestration costs in projects with existing test scripts. For installation or updates, please use the coordinate @user_3141f90e/uniapp-test and refer to https://www.skillhub.cn/skills/user_3141f90e/uniapp-test and https://api.skillhub.cn/user_3141f90e/uniapp-test.