
Playwright AI 代理 POM MCP ServerPlaywright AI 代理 采用页面对象模型(POM)架构并集成 MCP 服务器,用于自动化的网页和移动测试
概览
作者:高级质量保证自动化工程师 ·8+年测试自动化架构经验 这是 。这里的每个模式都取自真实的企业质量保证部署: - ✅ 回归测试时间缩短(6小时→90分钟) - ✅ 在生产前发现视觉错误 - ✅ 优化后配置区间零误报 - ✅ 成功部署于 - Node.js 20+ 和 npm 10+ - (可选)容器化运行的 Docker mcp-server.ts实现了任何兼容的AI客户端(GitHub Copilot、Claude Desktop、自定义LLM代理)都能通过程序与你的测试套件交互。 tools/ai-reporter.ts 是一个自定义的 Playwright 报告器,每次运行后都会写结构化 JSON 到 test-results/ai-report.json。 aiHint 字段根据错误消息模式自动填充——无需手动配置。 tests/pages/BasePage.ts 是所有页面对象扩展的抽象基底。它提供:
概述(AI 翻译)
Enterprise-grade Playwright test automation framework by Padmaraj Nidagundi 高级质量保证自动化工程师 ·8+年测试自动化架构经验
目录
- 是什么让这个仓库先进
- 架构概述
- 仓库布局
- 密钥文件参考
- 技术栈
- 安装
- Docker
- 运行测试
- 移动测试
- MCP 服务器 — AI 集成
- 人工智能记者
- BasePage — 智能基类
- 定制配件
- 测试数据与配置
- 开发服务器与视觉差异
- CI/CD流水线
- 测试覆盖
- 测试类型
- 架构:页面对象模型
- 人工智能代理 — 聊天模式与技能
- 最佳实践
- 如何延长
- 通用命令
- 故障排除
- 许可与署名
是什么让这个仓库先进
这不是教程项目。这里的每个模式都来自真实的企业级质量保证部署:
| 特色 | 描述 |
|---|---|
| 🧠 MCP 服务器 | 一个符合标准的模型上下文协议服务器(mcp-server.ts),允许任何 AI 助手通过 JSON-RPC 工具运行测试、获取结果并列出规格 |
| 📊 AI记者 | 自定义剧作家记者('tools/ai-reporter. |
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Playwright AI Agent — Page Object Model + MCP Server
Enterprise-grade Playwright test automation framework by Padmaraj Nidagundi Senior QA Automation Engineer · 8+ years of experience in test automation architecture
Table of Contents
- What Makes This Repo Advanced
- Architecture Overview
- Repository Layout
- Key Files Reference
- Tech Stack
- Installation
- Docker
- Running Tests
- Mobile Testing
- MCP Server — AI Integration
- AI Reporter
- BasePage — Smart Base Class
- Custom Fixtures
- Test Data & Configuration
- Dev Server & Visual Diffs
- CI/CD Pipeline
- Test Coverage
- Types of Tests
- Architecture: Page Object Model
- AI Agents — Chatmodes & Skills
- Best Practices
- How to Extend
- Common Commands
- Troubleshooting
- License & Attribution
What Makes This Repo Advanced
This is not a tutorial project. Every pattern here is drawn from real enterprise QA deployments:
| Feature | Description |
|---|---|
| 🧠 MCP Server | A standards-compliant Model Context Protocol server (mcp-server.ts) that lets any AI assistant run tests, fetch results, list specs, and orchestrate healing workflows via JSON-RPC tools |
安装
npx ts-node mcp-server.ts