Agent skill · software engineering · web-infra-dev
vitest-midscene-e2e
Enhances Vitest with Midscene for AI-powered UI testing across Web (Playwright), Android (ADB), and iOS (WDA). Scaffolds new projects, converts existing projects, and creates/updates/debugs/runs E2E tests using natural-language UI interactions. Triggers: write test, add test, create test, update test, fix test, debug test, run test, e2e test, midscene test, new project, convert project, init project, 写测试, 加测试, 创建测试, 更新测试, 修复测试, 调试测试, 运行测试, 新建工程, 转化工程.
Why this skill is useful
Adds executable scripts for scaffolding and managing E2E tests across multiple platforms using natural language interactions.
What it needs
Requires adb, playwright, vitest, webdriveragent installed locally. About 4k tokens when loaded. Last updated 2026-08-05. 285 stars on the source repository.
What this skill does
Vitest Midscene E2E Modules Module Role -------- ------ Vitest TypeScript test framework. Provides describe/it/expect/hooks for test organization, assertions, and lifecycle. Midscene AI-driven UI automation. Interacts with UI elements via natural language — no fragile selectors. Core API: aiAct. Supported platforms: Web — WebTest (Playwright Chromium): ctx.agent + ctx.page Android — AndroidTest (ADB + scrcpy): ctx.agent only iOS — IOSTest (WebDriverAgent): ctx.agent only Workflow Step 1: Clone boilerplate & ensure project ready The boilerplate at ~/.midscene/boilerplate/vitest-all-platforms-demo/ is the canonical reference for project structure, configs, platform context classes, and test conventions. Compare the current project against it. If anything is missing, ask the user which platform(s) they need (Web / Android / iOS), then fill in what's missing using the boilerplate as the target state. Only include files for the requested platform(s). Do NOT overwrite existing configs or files. Copy .env.example from the boilerplate as .env if it doesn't exist, and prompt the user to fill in the env vars. Step 2: Read the Midscene Agent API section below before writing tests It contains mandatory rules for using aiAct — the primary API for all UI operations. Do NOT skip this step. Step 3: Create, update, or run tests Use the boilerplate's e2e/ directory and src/context/ as reference for patterns and conventions. Before running tests, ensure dependencies are installed and .env is configured. When debugging failures, check troubleshooting.md. Midscene Agent API ctx.agent is a platform-specific agent instance. All methods return Promises. Web: PlaywrightAgent from @midscene/web/playwright Android: AndroidAgent from @midscene/android iOS: IOSAgent from @midscene/ios All three agents share the same AI methods below. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills web-infra-dev/vitest-midscene-e2e