web-infra-dev/midscene

See interfaces like a human. E2E testing in natural language.

What it solves

Traditional E2E tests require writing and maintaining brittle CSS selectors or XPath, and they often miss what users actually see (colors, layout, canvas content, native UI). Midscene lets you describe test steps and expected results in plain English, and it uses AI vision to locate elements by appearance and verify visible outcomes — no selectors, no semantic annotations.

How it works

Midscene employs a visual GUI agent that observes screenshots of the app. It identifies elements by their look and position (so icon-only buttons, custom controls, <canvas>, and cross-origin iframes work), then performs actions like clicking, typing, or scrolling. For assertions, it checks the rendered UI against your natural-language expectation. You can write tests as YAML cases in the Midscene Test framework, or use the JavaScript agent (e.g., PlaywrightAgent) inside existing test suites. The same Agent API works across web, Android, iOS, HarmonyOS, desktop, and custom interfaces because it only needs screenshots and action capabilities.

Who it's for

Developers and QA engineers who want to write E2E tests in natural language, avoid selector maintenance, and cover web, mobile, and desktop apps with one approach. It's also useful for teams that want AI-assisted test authoring and step-level debugging via HTML reports.

Highlights

  • Write test steps and assertions in natural language (YAML or JavaScript).
  • Visual localization — no selectors needed; works with canvas, custom controls, cross-origin iframes.
  • Cross-platform: Playwright, Puppeteer, desktop Chrome, Android/iOS/HarmonyOS, desktop, and custom interfaces.
  • Supports many models (GPT, Qwen, Doubao Seed, DeepSeek, Gemini, Kimi, and self-hosted open-source options).
  • Midscene Test framework provides lifecycle hooks, retries, timeouts, concurrency, and step-level reports.
  • Generates a Node Spec (Markdown) so humans and AI agents can write cases without reading TypeScript.
  • Benchmarks: AndroidWorld 93.1%, MobileWorld 78.6%, AppControlBench 96.7% (specific model runs).

Related

  • Project
  • Project
  • Project
  • Project
  • Project