Midscene Test overview
Midscene Test (@midscene/test) is a natural-language E2E testing framework designed for the AI era. It combines AI’s flexibility with the determinism of code in each test case: natural language expresses actions and expectations, while code handles business logic that requires precise control. Test flows have a clear, readable structure that both people and AI agents can understand, write, and maintain, allowing test intent and its 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.
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: {}BusinessTest cases maintained by people and AI
As your product evolves, your test project can grow a library of reusable business operations while keeping test intent clear in each case. People and AI agents can use the same capability reference to understand, write, and update cases, while the implementation of business operations is maintained independently.
Midscene Test provides custom Nodes for these business capabilities and generates a Markdown Node Spec from the operations registered in the project, giving people and AI agents a shared reference for authoring test cases. Explore custom Nodes
Next steps
- Create and run a test project: write YAML cases and inspect results.
- Develop custom Nodes: implement reusable business operations.
- Configure test projects: manage runtime resources and execution settings.
The legacy tasks/flow YAML runner is in maintenance mode, receiving compatibility updates and necessary fixes. Use Midscene Test for new projects and cases. Existing projects can continue using the midscene command; see Migrate to Midscene Test when switching to midscene-test.

