ui-test-generation-mcp

ui-test-generation-mcp

Provides comprehensive UI test automation capabilities including intelligent test creation, test healing, and manual test conversion through browser automation using Playwright.

Category
Visit Server

README

Playwright UI Test Automation MCP Server

A specialized Model Context Protocol (MCP) server that provides comprehensive UI test automation capabilities for web applications. This server enables intelligent test creation, test healing, and manual test conversion through browser automation.

šŸŽÆ Primary Use Cases

1. Create New UI Test Automation

  • Analyze web applications and generate automated test scripts
  • Support for multiple frameworks (Playwright, Cypress, Selenium)
  • Generate tests in JavaScript, TypeScript, or Python
  • Intelligent element detection and selector generation

2. Heal Broken UI Test Automation

  • Analyze failing test cases and identify root causes
  • Compare current page state with test expectations
  • Automatically suggest fixes for broken selectors or timing issues
  • Generate healed test code with updated selectors and improved reliability

3. Convert Manual Test Cases to Automation

  • Transform manual test steps into automated test scripts
  • Parse natural language test instructions
  • Map manual actions to browser automation commands
  • Generate comprehensive test suites from manual test documentation

šŸš€ Key Features

  • šŸ”§ Intelligent Test Generation: Automatically creates test automation from web app analysis
  • šŸ› ļø Test Healing & Recovery: Fixes broken tests by analyzing current page state
  • šŸ“‹ Manual Test Conversion: Converts manual test cases to automated scripts
  • 🌐 Multi-Framework Support: Playwright, Cypress, and Selenium compatibility
  • šŸ’» Multi-Language Output: JavaScript, TypeScript, and Python test generation
  • šŸŽÆ Smart Element Detection: Advanced selector generation with fallback strategies
  • šŸ” Page Analysis Engine: Deep analysis of forms, navigation, and user workflows
  • šŸ›”ļø Enterprise Ready: No external API dependencies, VDI-compatible deployment

šŸ“‹ Requirements

  • Node.js 18 or higher
  • Compatible MCP client (Amazon Q, VS Code, or other MCP-enabled tools)
  • Modern web browser (Chrome, Firefox, Safari)

šŸ› ļø Installation

Quick Setup

git clone <repository-url>
cd playwright-test-generator
npm install

MCP Client Configuration

Add to your MCP client configuration file:

{
  "mcpServers": {
    "playwright-test-automation": {
      "command": "node",
      "args": ["/path/to/playwright-test-generator/cli.js"],
      "env": {
        "NODE_ENV": "production"
      },
      "timeout": 60000
    }
  }
}

šŸŽÆ Core Tools

Test Generation Tools

  • generate_test_from_manual_steps - Convert manual test steps to automated code
  • analyze_test_failure - Analyze and fix broken test automation
  • create_test_suite - Generate comprehensive test suites from web app exploration

Browser Automation Tools

  • browser_navigate - Navigate to URLs and pages
  • browser_snapshot - Capture page structure and accessibility tree
  • browser_click - Click elements with intelligent targeting
  • browser_type - Type text into form fields and inputs
  • browser_evaluate - Execute JavaScript for advanced interactions
  • browser_take_screenshot - Capture visual evidence for test validation

Analysis & Debugging Tools

  • browser_console_messages - Monitor console logs and errors
  • browser_network_requests - Track network activity and API calls
  • browser_wait_for - Handle dynamic content and timing

šŸ’” Usage Examples

Generate Test from Manual Steps

// Manual test steps to automate:
const manualSteps = [
  "Fill in customer name field with 'John Doe'",
  "Enter email address 'john@example.com'",
  "Select 'Medium' from pizza size options",
  "Check 'Extra Cheese' topping",
  "Click 'Submit Order' button",
  "Verify order confirmation appears"
];

// Generate automated test
await generate_test_from_manual_steps({
  manual_steps: manualSteps,
  test_name: "Pizza Order Form Test",
  test_framework: "playwright",
  output_format: "javascript"
});

Heal Broken Test

// Analyze and fix failing test
await analyze_test_failure({
  test_code: `
    await page.click('#submit-btn');
    await expect(page.locator('.success')).toBeVisible();
  `,
  error_message: "Element not found: #submit-btn",
  test_framework: "playwright"
});

Create Comprehensive Test Suite

// Generate full test suite for web application
await create_test_suite({
  base_url: "https://your-webapp.com",
  test_scenarios: [
    "User login flow",
    "Product search and filtering",
    "Shopping cart operations",
    "Checkout process"
  ],
  framework: "playwright",
  include_assertions: true
});

šŸ—ļø Architecture

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│   MCP Client    │◄──►│  MCP Server      │◄──►│  Web Browser    │
│  (Amazon Q)     │    │ Test Generator   │    │ (Live Web App)  │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
                                │
                                ā–¼
                       ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
                       │  Generated Tests │
                       │ • Playwright     │
                       │ • Cypress        │
                       │ • Selenium       │
                       ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

The MCP server acts as an intelligent bridge between your MCP client and web applications, providing:

  1. Real-time browser automation for test creation
  2. Intelligent analysis of page structure and user workflows
  3. Automated test generation in multiple frameworks and languages
  4. Test healing capabilities for maintaining test reliability
  5. Enterprise-grade security with local-only operation

šŸ›”ļø Enterprise & Security Features

  • Local Operation Only: All processing happens locally, no external API calls
  • No Cloud Dependencies: Completely self-contained for secure environments
  • VDI Compatible: Optimized for Virtual Desktop Infrastructure deployment
  • Data Privacy: Web application data never leaves your environment
  • Audit Trail: Complete logging of all automation activities
  • Access Control: Configurable capabilities and tool filtering

šŸ”§ Configuration Options

Environment Variables

NODE_ENV=production          # Production mode
BROWSER_TYPE=chromium        # Browser selection (chromium, firefox, webkit)
HEADLESS=true               # Headless browser operation
OUTPUT_DIR=/path/to/output   # Directory for screenshots and logs

Capability Management

The server supports granular capability control:

  • core - Essential browser automation tools
  • test-generation - Test creation and healing tools
  • vision - Visual testing and analysis (optional)
  • pdf - PDF generation capabilities (optional)

šŸ“Š Test Generation Capabilities

Supported Test Frameworks

  • Playwright - Modern, reliable, cross-browser testing
  • Cypress - Developer-friendly testing framework
  • Selenium - Industry-standard web automation

Output Languages

  • JavaScript - Most common test automation language
  • TypeScript - Type-safe test development
  • Python - Popular choice for test automation teams

Test Types Generated

  • Smoke Tests - Basic functionality verification
  • Integration Tests - Multi-component workflow testing
  • Regression Tests - Change impact validation
  • User Journey Tests - End-to-end user experience testing

šŸŽÆ Workflow Examples

New Test Creation Workflow

  1. Navigate to target web application
  2. Analyze page structure and user flows
  3. Generate test automation code
  4. Validate generated tests
  5. Export to your test framework

Test Healing Workflow

  1. Identify failing test cases
  2. Analyze current page state vs. test expectations
  3. Compare element selectors and page structure
  4. Generate healed test code with fixes
  5. Validate repaired test functionality

Manual Test Conversion Workflow

  1. Import manual test case documentation
  2. Parse test steps and expected outcomes
  3. Map manual actions to automation commands
  4. Generate executable test scripts
  5. Review and customize generated automation

šŸš€ Getting Started

Quick Start Guide

  1. Install the MCP server following the installation instructions
  2. Configure your MCP client (Amazon Q recommended for enterprise use)
  3. Navigate to your web application using browser_navigate
  4. Analyze the application with browser_snapshot for page structure
  5. Generate your first test using generate_test_from_manual_steps
  6. Verify test quality by running the generated automation code

Best Practices

  • Use descriptive test names that clearly indicate the test purpose
  • Include assertions to validate expected outcomes
  • Prefer data-testid attributes for reliable element selection
  • Test incrementally - start with simple flows, then add complexity
  • Review generated code before adding to your test suite
  • Maintain test data separately for better test maintainability

šŸ“ˆ Enterprise Benefits

  • Accelerated Test Creation: Reduce manual test automation development time by 70%
  • Improved Test Reliability: Intelligent healing reduces test maintenance overhead
  • Consistent Quality: Standardized test generation patterns across teams
  • Knowledge Transfer: Convert manual testing expertise into automated assets
  • Scalable Testing: Generate comprehensive test coverage efficiently
  • Cost Effective: Reduce QA automation development and maintenance costs

šŸ” Troubleshooting

Common Issues

Test Generation Fails

  • Ensure web application is fully loaded before analysis
  • Check that interactive elements are visible and accessible
  • Verify element selectors are stable and unique

Element Not Found Errors

  • Use test healing functionality to update selectors
  • Consider using data-testid attributes for better stability
  • Check for dynamic content that may require wait conditions

Performance Issues

  • Increase timeout values for slow-loading applications
  • Use headless mode for faster execution
  • Consider element visibility checks before interactions

The Playwright UI Test Automation MCP Server - Transforming manual testing into intelligent automation for modern web applications!# ui-test-generation-mcp

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured