Playwright MCP
🎭 Playwright MCP - Automatización de Pruebas Impulsada por IA (OrangeHRM)
Un proyecto Prueba de Concepto que demuestra automatización de pruebas de navegador impulsada por IA usando Playwright integrado con el Protocolo de Contexto de Modelo (MCP). Las pruebas están escritas en TypeScript usando el patrón de diseño Modelo de Objeto de Página (POM), dirigido a la aplicación de demostración de OrangeHRM.
📋 Tabla de Contenidos
Related MCP server: MCP Playwright Server
🎯 Resumen
Este proyecto muestra cómo IA + Playwright puede automatizar pruebas de navegador usando indicaciones en inglés sencillo a través del Protocolo de Contexto de Modelo (MCP). En lugar de escribir cada línea de código de automatización manualmente, describes lo que quieres probar en lenguaje natural, y la IA ayuda a generar y ejecutar la automatización.
Conceptos Clave
Componente | Rol | Analogía |
LLM (Large Language Model) | Entiende solicitudes y genera instrucciones | 🧠 Cerebro |
Agente | Ejecuta tareas automáticamente | ⚡ Ejecutor |
MCP (Model Context Protocol) | Conecta la IA con herramientas reales (navegadores, APIs, etc.) | 🔗 Traductor |
🏗 Arquitectura
Plain English Prompt
│
▼
Large Language Model (LLM)
│
Generates Instructions
│
▼
AI Agent
│
Executes the Instructions
│
▼
Model Context Protocol (MCP)
│
Connects to Real Applications
│
▼
Playwright + Browser
│
▼
Browser Automation💻 Stack Tecnológico
Tecnología | Propósito |
Playwright ^1.60 | Marco de automatización de navegador |
Lenguaje de programación | |
Protocolo de comunicación de IA a herramienta | |
Análisis de CSV para pruebas basadas en datos | |
Node.js | Entorno de ejecución |
📁 Estructura del Proyecto
├── 📂 pages/ # Page Object Model classes
│ ├── LoginPage.ts # Login page locators & actions
│ └── PimPage.ts # PIM module locators & actions
│
├── 📂 tests/ # Test specifications
│ ├── example.spec.ts # Sample Playwright test
│ ├── orangehrm-login-data-driven.spec.ts # Data-driven login (inline)
│ ├── orangehrm-login-data-driven-csv.spec.ts # Data-driven login (CSV)
│ ├── orangehrm-logout.spec.ts # Logout flow test
│ ├── orangehrm-admin-system-users.spec.ts # Admin module test
│ ├── orangehrm-buzz-post.spec.ts # Buzz social feed test
│ ├── pim-search.spec.ts # PIM employee search
│ └── add-employee.spec.ts # Add employee (POM)
│
├── 📂 test_data/ # Test data files
│ └── loginData.csv # CSV test data for login
│
├── 📂 playwright-report/ # HTML test reports
├── 📂 test-results/ # Test execution artifacts
│
├── 📄 playwright.config.ts # Playwright configuration
├── 📄 package.json # Dependencies & scripts
├── 📄 README.md # This file
│
├── 📄 Playwright_MCP_Guide.md # Detailed MCP concepts guide
├── 📄 PlaywrightMCP_Vs_CLI.md # MCP vs CLI comparison
├── 📄 playwright-context.md # MCP test generator context
├── 📄 playwright-context-pom.md # MCP POM test generator context
├── 📄 prompts.md # Sample AI prompts used
└── 📄 notes.md # Architecture & concept notes🧪 Escenarios de Prueba
Archivo de Prueba | Descripción | Patrón |
| Validación de inicio de sesión con datos en línea (credenciales válidas e inválidas) | Data-Driven |
| Validación de inicio de sesión usando fuente de datos CSV | Data-Driven (CSV) |
| Iniciar sesión, cerrar sesión y verificar redirección a la página de inicio de sesión | Lineal |
| Navegar a Admin → verificar página de Usuarios del Sistema | Lineal |
| Publicar un mensaje en el feed de Buzz y verificar que aparezca | Lineal |
| Buscar empleados por nombre en el módulo PIM | Lineal |
| Agregar un nuevo empleado usando el Modelo de Objeto de Página | POM |
| Prueba de muestra predeterminada de Playwright | Lineal |
🚀 Comenzando
Requisitos previos
Instalación
# Clone the repository
git clone https://github.com/pavanoltraining/POC_Playwright_MCP_orangehrm.git
# Navigate to the project directory
cd POC_Playwright_MCP_orangehrm
# Install dependencies
npm install
# Install Playwright browsers
npx playwright install chromium▶️ Ejecutar Pruebas
Ejecutar todas las pruebas
npx playwright testEjecutar un archivo de prueba específico
npx playwright test tests/orangehrm-login-data-driven.spec.tsEjecutar pruebas en modo UI
npx playwright test --uiVer informe HTML
npx playwright show-reportEjecutar con modo de depuración
npx playwright test --debug🧩 Modelo de Objeto de Página
El proyecto utiliza el patrón de diseño Modelo de Objeto de Página (POM) para código de prueba mantenible y reutilizable.
Ejemplo: LoginPage.ts
export class LoginPage {
readonly usernameInput = page.getByPlaceholder("Username");
readonly passwordInput = page.getByPlaceholder("Password");
readonly loginButton = page.getByRole("button", { name: "Login" });
async login(username: string, password: string) {
await this.usernameInput.fill(username);
await this.passwordInput.fill(password);
await this.loginButton.click();
}
}Ejemplo: PimPage.ts
export class PimPage {
async navigateToPim() {
/* ... */
}
async openAddEmployee() {
/* ... */
}
async addEmployee(firstName: string, lastName: string) {
/* ... */
}
}📊 Pruebas Basadas en Datos
Datos en Línea
Las pruebas inician sesión con múltiples credenciales definidas en línea:
Usuario | Contraseña | Resultado Esperado |
Admin | admin123 | Panel |
fakeuser | fakepass | Credenciales inválidas |
ESSUser1 | ess123 | Credenciales inválidas |
Datos CSV
Las pruebas leen casos de prueba de test_data/loginData.csv:
Username,Password,Expected
Admin,admin123,Dashboard
fakeuser,fakepass,Invalid credentials
ESSUser1,ess123,Invalid credentials🤖 Playwright MCP vs Playwright CLI
Característica | Playwright CLI | Playwright MCP |
Propósito | Herramienta de línea de comandos para Playwright | Puente de IA entre LLM y Playwright |
Usado por | Desarrolladores y Probadores | Agentes de IA |
Entrada | Comandos de terminal | Indicaciones en lenguaje natural |
Control del navegador | Directamente a través de scripts de Playwright | A través de IA + Servidor MCP |
Requiere codificación | Sí | Codificación mínima |
Genera código | No | Sí (generado por IA) |
Ejecuta pruebas | Sí | Sí |
Usa árbol de accesibilidad | No | Sí |
Soporta automatización con IA | No | Sí |
Mejor para | Automatización tradicional | Automatización impulsada por IA |
📚 Recursos
📄 Licencia
Este proyecto es solo para fines educativos y de demostración.
Construido con ❤️ usando Playwright + MCP + IA
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables browser automation and web page interaction through Playwright's accessibility tree, allowing LLMs to navigate, fill forms, click elements, and extract content without requiring vision models or screenshots.4,588,713Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to control web browsers through Playwright automation, providing 50+ tools for navigation, interaction, testing, accessibility audits, and visual testing across Chromium, Firefox, and WebKit.10MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to execute browser automation, perform QA tasks, and generate test code through natural language commands using Playwright.5
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to drive Playwright-based browser automation for UI testing, returning JSON/HTML reports with screenshots without server-side LLM or test scripts.MIT
Related MCP Connectors
AI QA tester — real browsers scan sites for bugs, SEO, perf, and accessibility issues via chat.
Browser-backed QA with evidence and fix-ready reports for coding agents.
AI-powered browser automation — navigate, click, fill forms, and extract data from any website.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pavanoltraining/POC_Playwright_MCP_orangehrm'
If you have feedback or need assistance with the MCP directory API, please join our Discord server