• English
  • See interfaces like a human
    E2E testing in natural language

    Midscene.js provides a vision-based GUI Agent and a natural-language E2E testing framework for web, mobile, and desktop apps.

    🔥 Latest news Starting with v1.16, Midscene supports using Jev 1.4’s visual capabilities to drive E2E testing. See what’s new

    15k+Github Stars
    MITFully open source
    #2No.2 in Github trending

    Describe steps and expectations in natural language

    Describe what a user wants to do and what they should see. Express the same intent in YAML or in your existing JavaScript tests.

    YAML · @midscene/test
    Vitest + JavaScript
    beforeEach:
      - gotoUrl: https://your-shop.example
    
    cases:
      - name: "Find headphones under $100"
        steps:
          - aiAct: "Search for headphones and filter the results to prices under $100"
          - aiWaitFor: "The filtered search results are visible"
          - aiAssert: "There are products in the search results, and each costs less than $100"

    A GUI Agent built for testing

    Midscene’s GUI Agent brings visual actions and assertions to your existing JavaScript tests. We recommend Playwright Test for web apps and Vitest for mobile and desktop apps.

    See, act, and verify like a human

    E2E testing aims to verify complete workflows from the user’s perspective. Midscene uses vision to interact as a user would: observe the screen, find the target, act, and check what the user actually sees. See real-world examples

    One API, across platforms

    Visual localization does not depend on a particular UI rendering stack. Platform adapters provide screenshots and actions, bringing the same approach to web, mobile, and desktop interfaces, including HTML canvas.

    PlatformPackageDescription
    Web@midscene/webPlaywright · Puppeteer · Desktop Chrome
    Android@midscene/androidDevices / emulators · ADB
    iOS@midscene/iosDevices / simulators · WebDriverAgent
    HarmonyOS@midscene/harmonyHarmonyOS NEXT · HDC
    Desktop@midscene/computermacOS · Windows · Linux, with remote RDP
    Custom interfaces@midscene/coreConnect through screenshots and actions

    Model options and cost

    Benchmarks

    A new E2E testing framework designed for natural language

    Midscene Test (@midscene/test) is a natural-language E2E testing framework. In a single YAML case, you can describe UI actions and expected outcomes in natural language while encapsulating business logic that requires precise control in TypeScript. Cases have a clear, readable structure that both people and AI agents can write and maintain, allowing test intent and underlying implementation to evolve independently. Get started with Midscene Test

    AI and business operations in one YAML file

    Each YAML step calls a Node: an AI operation, a platform operation, or a custom business operation. Compose these Nodes into test cases that people and AI agents can read, write, and review.

    cases/refund.yaml
    beforeEach:  - order.prepare: { status: paid }Business  - gotoUrl: ${shopUrl}/orders/latestBusinesscases:  - name: A paid order supports a full refund    steps:      - aiAct: Apply for a full refund and submitAI      - aiAssert: The page shows that the refund was submittedAI      - order.checkRefund: { status: refunding }BusinessafterEach:  - clearCookies: {}Business

    Test cases maintained by people and AI

    As your product evolves, you can encapsulate reusable business logic into custom Nodes, keeping YAML cases focused on test intent while maintaining business implementations independently. Midscene Test automatically generates a Markdown Node Spec from the Nodes registered in the project, listing all available operations and their input schemas. Both QA engineers and AI agents can reference this spec directly to write and update test cases without reading the underlying TypeScript code. Learn how to develop custom Nodes

    1. nodes/order.ts
      defineNode({
        name: 'order.prepare',
        description: "Create a test order",
        inputSchema: z.strictObject({
          status: z.literal('paid'),
        }),
        async execute({ input }) {
          await orders.create(input);
        },
      });
    2. midscene-node-spec.md
      ### order.prepare
      Create a test order
      - status: "paid"
    3. case.yaml
      steps:
        - order.prepare:
            status: paid

    Who is using Midscene

    Next steps

    To let AI coding agents operate your UI, explore Midscene Skills.