AgentSkillsCN

testing-automation-mcp

采用 Playwright Model Context Protocol(MCP)进行自主端到端测试。

SKILL.md
--- frontmatter
name: testing-automation-mcp
description: Autonomous E2E testing using Playwright Model Context Protocol (MCP).
category: quality-assurance
version: 4.1.0-fractal
layer: tool-skill

🧪 Testing Automation MCP

This skill empowers AI Agents to autonomously write, execute, and debug E2E tests using the official Playwright MCP Server. It transforms passive testing into an active, agentic workflow.


🚀 Capabilities

  1. Browser Control: Navigate URLs, click elements, fill forms, and handle dialogs via MCP.
  2. Visual Verification: Capture screenshots and trace files for debugging.
  3. Self-Healing: Analyze failure logs and rewrite selector logic automatically.
  4. Cross-Browser: Execute tests on Chromium, Firefox, and WebKit.

🛠️ MCP Toolset (Playwright)

ToolDescriptionUsage
playwright_navigateGo to a specific URL.{"url": "http://localhost:3000"}
playwright_clickClick an element by selector.{"selector": "button[type='submit']"}
playwright_fillFill input fields.{"selector": "#email", "value": "test@example.com"}
playwright_screenshotTake a screenshot of the viewport.{"path": "debug/error.png"}
playwright_evaluateRun custom JS in the browser.{"script": "return document.title"}

♟️ Strategic Patterns

🧠 Knowledge Modules (Fractal Skills)

1. 1. The "Observer" Pattern (Test Creation)

2. 2. The "Healer" Pattern (Test Recovery)

3. 3. The "Simulator" Pattern (User Journey)