Skip to content

About

No description, website, or topics provided.

Resources

Contributing

Stars

3 stars

Watchers

2 watching

Forks

Repository files navigation

Midscene Test Everything

Midscene Test Everything

If you can see it, you can test it.
Drive end-to-end tests on any interface with vision models — car screens, physical phones, embedded panels, and whatever you build next.

English / 简体中文

CI Docs License Node.js E2E by Midscene.js

💡 Why this project

Midscene.js is a vision-driven E2E testing framework: it interacts with screens visually like a human, without relying on DOM trees or OS accessibility labels.

However, many interfaces (car touchscreens, embedded panels, or locked-down iPhones) have no software test driver at all. As long as a screen can be seen (screenshots, cameras) and operated (HID, robot arms), vision models can test it.

This repository explores universal physical & device integrations, bringing vision AI testing to any screen.

🎬 Showcase

🦾 Robot Arm × Physical Touchscreen (Car Screens & Beyond)

Automate physical touchscreens (car cockpits, industrial panels) via a robotic arm and camera observation. We provide the complete physical automation toolchain:

  • Spatial Calibration & Mapping: Camera calibration and screen-to-arm coordinate transformation.
  • Motion Control Primitives: Reusable tap, swipe, and gesture execution for automated testing.
  • Modular Arm SDK (arm-kit): Pluggable interface to connect and control any robotic arm.
  • End-to-End Reference Demo: Ready-to-run setup based on the DOBOT MG400.

🎥 Video placeholder: robot arm demo coming soon.

Note

Special thanks to our community contributor — AVATR Robotic team

The core architecture and real-world production rollout of this robot arm testing solution were led and open-sourced by the AVATR team. Their extensive hands-on experience and calibration engineering in automotive cockpits made this universal infrastructure possible.

Note: The DOBOT MG400 robotic arm shown in the demo is strictly a reference implementation to showcase the end-to-end workflow, not a hardware endorsement or purchase recommendation. Developers are encouraged to choose hardware tailored to their own requirements.

📱 Bluetooth HID × Physical iPhone

Run automated tests on physical iPhones over Mac Bluetooth HID with zero jailbreak or Developer Mode. Uses USB, AirPlay, or cameras for screen capture.

🎥 Video placeholder: iOS AirLink demo coming soon.

Get started: ios-airlink

🤝 Showcase your solution

We warmly welcome community contributions of successful integrations across different devices and scenarios! If you have built an alternative hardware solution, connectivity protocol, or unique platform practice, feel free to open an issue to let us know. We would love to feature and link your project right here for the community to see.

🏗️ Architecture & Workflow

We provide the complete infrastructure needed to bridge any physical device into vision-based AI testing:

  • AI Testing Infrastructure (Provided): @midscene/connect in the Midscene repository provides natural-language test execution (aiAct, aiAssert), a Playground for live visual inspection, and Agent tooling (CLI, Skill).
  • Device Definition: A minimal contract. Developers connect screen capture (screenshot) and input primitives (tap, swipe, ...) in one .mjs file.
┌────────────────────────────────────────────────────────┐
│            Provided by @midscene/connect               │
│  • Natural-language E2E tests (aiAct / aiAssert)       │
│  • CLI, Skill, and browser Playground                  │
│  • HTTP server with token auth and Swagger docs        │
└───────────────────────────┬────────────────────────────┘
                            │ Midscene Connect protocol (HTTP)
┌───────────────────────────┴────────────────────────────┐
│            Implemented by developers (device.mjs)      │
│  • screenshot(): capture the screen (PNG/JPEG)         │
│  • actions: tap / swipe / typeText / homeButton / ...  │
│  • custom actions with JSON Schema params              │
└────────────────────────────────────────────────────────┘

1. Prerequisites: What you need to prepare

A complete physical test pipeline typically requires three fundamental components:

  • Target Screen: The physical display under test (e.g. in-car screen, physical smartphone, industrial panel);
  • Visual Sensing: A reliable way to capture the display (an overhead camera, HDMI/USB capture card, or screen mirroring);
  • Input Actuator: A mechanism to interact with the screen (a robotic arm, Bluetooth HID module, stylus, or dedicated control API).

2. End-to-End Demos

Demo 1: Define and serve a device

Describe your screen capture and actuator in one file, then serve it with @midscene/connect:

// my-screen.mjs
export default {
  name: 'My Screen',
  pointerType: 'touch',
  async connect() {
    return {
      screenshot: () => getScreenJpeg(), // 1. Visual sensing
      actions: {
        tap: (p) => myHardware.tap(p.x, p.y), // 2. Input
        swipe: (from, to) => myHardware.swipe(from, to),
      },
    };
  },
};
npx @midscene/connect serve ./my-screen.mjs

The service prints its URL and serves API docs at /api/docs/.

Demo 2: Visual debugging in the Playground (optional)

npx @midscene/connect playground --url http://127.0.0.1:5820

Demo 3: Natural-language E2E tests

import { agentOverConnectProtocol } from '@midscene/connect';

const agent = await agentOverConnectProtocol({ url: 'http://127.0.0.1:5820' });

try {
  await agent.aiAct('Open the music app and search for "Jay Chou"');
  await agent.aiAssert('The search results list shows songs by Jay Chou');
} finally {
  await agent.destroy();
}

iOS AirLink and the MG400 service host many devices. Each one is at http://<host>:<port>/devices/<id>, and GET /devices lists them.

📦 Packages

Package What it does
mg400-service DOBOT MG400 device service, including setup, calibration, and touchscreen control
arm-kit Adapter API for integrating custom robot arms
ios-airlink Connect to and control physical iPhones from macOS
robotics-vision Cross-platform camera capture, ArUco screen calibration, and perspective correction

🤝 Contributing

See the contributing guide for local setup and development checks.

🙏 Credits

  • Special thanks to our community contributor, the AVATR Robotic team, who spearheaded the development of the core architecture, camera calibration, and motion control for this physical testing solution, thoroughly validating it in real-world automotive cockpit scenarios.
  • iphone-use is the source of parts of the Bluetooth HID descriptors used in iOS AirLink.

📖 License

Midscene Test Everything is licensed under the MIT License. You are welcome to use it and contribute.

About

No description, website, or topics provided.

Resources

Contributing

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages