uniauto-mcp-server

Test Generation with UniAuto MCP

UniAuto MCP Server offers powerful AI-driven test generation capabilities that can automatically create test cases in various frameworks and styles by analyzing applications.

Features

Test Generation APIs

The server exposes several REST endpoints for test generation:

Generate Tests

Generate test cases for a specific URL using a chosen framework and style.

Endpoint: POST /api/generate-tests

Parameters:

Generate Full Test Suite

Generate a complete test suite with various test types (unit, integration, e2e, etc.) for an application.

Endpoint: POST /api/generate-full-suite

Parameters:

Scaffold Project

Create a complete test project structure with configuration files for a specific framework.

Endpoint: POST /api/scaffold-project

Parameters:

List Frameworks

Get a list of supported test frameworks, styles, and formats.

Endpoint: GET /api/test-frameworks

Model Context Protocol (MCP) Integration

Test generation capabilities are fully integrated with MCP, allowing AI assistants to generate tests directly.

MCP Actions

The following MCP actions are supported:

Example MCP Request

{
  "action": "generate_tests",
  "parameters": {
    "url": "https://demo.playwright.dev/todomvc",
    "framework": "playwright",
    "style": "bdd",
    "format": "javascript",
    "prompt": "Generate tests for a TODO application"
  },
  "executionId": "test-execution-id-123"
}

Example Usage

const axios = require('axios');

// Generate tests
const response = await axios.post('http://localhost:3000/api/generate-tests', {
  url: 'https://demo.playwright.dev/todomvc',
  framework: 'playwright',
  style: 'bdd',
  format: 'javascript',
  prompt: 'Generate tests for a TODO application'
});

console.log(response.data.testCode);

See the examples/test-generation-demo.js script for a complete demonstration.

Supported Frameworks

Supported Test Styles

Supported Output Formats