Playwright MCP
🎭 Playwright MCP - AI 기반 테스트 자동화 (OrangeHRM)
Playwright를 **Model Context Protocol (MCP)**과 통합하여 AI 기반 브라우저 테스트 자동화를 시연하는 개념 증명(Proof of Concept) 프로젝트입니다. 테스트는 Page Object Model (POM) 디자인 패턴을 사용하는 TypeScript로 작성되었으며, OrangeHRM 데모 애플리케이션을 대상으로 합니다.
📋 목차
Related MCP server: MCP Playwright Server
🎯 개요
이 프로젝트는 **Model Context Protocol (MCP)**을 통해 일반 영어 프롬프트를 사용하여 AI + Playwright가 브라우저 테스트를 자동화하는 방법을 보여줍니다. 자동화 코드의 모든 줄을 수동으로 작성하는 대신, 자연어로 테스트하려는 내용을 설명하면 AI가 자동화를 생성하고 실행하는 데 도움을 줍니다.
핵심 개념
구성 요소 | 역할 | 비유 |
LLM (대규모 언어 모델) | 요청을 이해하고 지침을 생성 | 🧠 두뇌 |
Agent | 작업을 자동으로 실행 | ⚡ 실행자 |
MCP (Model Context Protocol) | AI를 실제 도구(브라우저, API 등)와 연결 | 🔗 번역기 |
🏗 아키텍처
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💻 기술 스택
기술 | 용도 |
Playwright ^1.60 | 브라우저 자동화 프레임워크 |
프로그래밍 언어 | |
AI-도구 통신 프로토콜 | |
데이터 기반 테스트를 위한 CSV 파싱 | |
Node.js | 런타임 환경 |
📁 프로젝트 구조
├── 📂 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🧪 테스트 시나리오
테스트 파일 | 설명 | 패턴 |
| 인라인 데이터로 로그인 검증 (유효 + 무효 자격 증명) | 데이터 기반 |
| CSV 데이터 소스를 사용한 로그인 검증 | 데이터 기반 (CSV) |
| 로그인, 로그아웃, 로그인 페이지로의 리다이렉트 확인 | 선형 |
| Admin → System Users 페이지 확인 | 선형 |
| Buzz 피드에 메시지 게시 및 표시 확인 | 선형 |
| PIM 모듈에서 직원 이름으로 검색 | 선형 |
| Page Object Model을 사용하여 새 직원 추가 | POM |
| 기본 Playwright 샘플 테스트 | 선형 |
🚀 시작하기
사전 요구 사항
설치
# 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▶️ 테스트 실행
모든 테스트 실행
npx playwright test특정 테스트 파일 실행
npx playwright test tests/orangehrm-login-data-driven.spec.tsUI 모드로 테스트 실행
npx playwright test --uiHTML 보고서 보기
npx playwright show-report디버그 모드로 실행
npx playwright test --debug🧩 Page Object Model
프로젝트는 유지 관리 및 재사용 가능한 테스트 코드를 위해 Page Object Model (POM) 디자인 패턴을 사용합니다.
예시: 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();
}
}예시: PimPage.ts
export class PimPage {
async navigateToPim() {
/* ... */
}
async openAddEmployee() {
/* ... */
}
async addEmployee(firstName: string, lastName: string) {
/* ... */
}
}📊 데이터 기반 테스트
인라인 데이터 기반
인라인으로 정의된 여러 자격 증명으로 로그인을 테스트합니다:
사용자 이름 | 비밀번호 | 예상 결과 |
Admin | admin123 | 대시보드 |
fakeuser | fakepass | 잘못된 자격 증명 |
ESSUser1 | ess123 | 잘못된 자격 증명 |
CSV 데이터 기반
test_data/loginData.csv에서 테스트 케이스를 읽는 테스트:
Username,Password,Expected
Admin,admin123,Dashboard
fakeuser,fakepass,Invalid credentials
ESSUser1,ess123,Invalid credentials🤖 Playwright MCP vs Playwright CLI
기능 | Playwright CLI | Playwright MCP |
목적 | Playwright용 명령줄 도구 | LLM과 Playwright 사이의 AI 브리지 |
사용자 | 개발자 및 테스터 | AI 에이전트 |
입력 | 터미널 명령 | 자연어 프롬프트 |
브라우저 제어 | Playwright 스크립트를 통해 직접 | AI + MCP 서버를 통해 |
코딩 필요 | 예 | 최소한의 코딩 |
코드 생성 | 아니요 | 예 (AI 생성) |
테스트 실행 | 예 | 예 |
접근성 트리 사용 | 아니요 | 예 |
AI 자동화 지원 | 아니요 | 예 |
가장 적합한 용도 | 전통적인 자동화 | AI 기반 자동화 |
📚 리소스
📄 라이선스
이 프로젝트는 교육 및 데모 목적으로만 사용됩니다.
Playwright + MCP + AI로 ❤️를 담아 제작됨
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