π Playwright Test Automation Framework
About
π Modern E2E Testing Framework | Playwright + TypeScript + MCP Server | Data-Driven POM Architecture | Advanced Test Recording & Playback
Details
- Author
- GoldiSaini
- GitHub stars
- 2
- Downloads
- 230
- Categories
- Developer Tools
Jump to
- ποΈ Page Object Model architecture for clean test design
- π Data-driven testing with external test data
- π§ TypeScript support for robust type checking
- β»οΈ Reusable components via base classes
- π₯ MCP Server integration for recording and playback
- π Scalable design for adding new scenarios easily
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
π Playwright Test Automation FrameworkCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Clone the repository, install dependencies with npm install, and install Playwright browsers with npx playwright install. Run all tests with npx playwright test; run a specific file with npx playwright test tests/specs/registration.spec.ts; use headed mode with --headed.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"\ud83c\udfad playwright test automation framework": {
"playwrightMCP_Demo": {
"command": "npx",
"args": [
"playwright",
"install"
]
}
}
}
}
McpServers
{
"playwrightMCP_Demo": {
"command": "npx",
"args": [
"playwright",
"install"
]
}
}
π Playwright Test Automation Framework
> π A powerful, data-driven test automation framework built with Playwright and TypeScript, leveraging @executeautomation/playwright-mcp-server for enhanced test recording and playback capabilities. Features Page Object Model design pattern for scalable and maintainable automated testing.
β¨ Highlights
- ποΈ Page Object Model - Clean and maintainable test architecture
- π Data-Driven Testing - Easily scale tests with external test data
- π§ TypeScript Support - Robust type checking and better IDE integration
- β»οΈ Reusable Components - Modular design for maximum code reuse
- π― Easy Maintenance - Centralized locators and data management
- π Scalable Design - Effortlessly add new test scenarios
- π₯ MCP Server Integration - Enhanced test recording and playback functionality
π Key Features
- Structured and organized test architecture
- Separation of test data from test logic
- Powerful helper methods for common operations
- Easy-to-follow page object pattern implementation
- Comprehensive test data management
- Ready-to-use registration flow example
- Test recording and playback using MCP Server
- Automated test script generation
Framework Structure
tests/
βββ data/ # Test Data Layer
β βββ interfaces/
β β βββ TestData.ts # Data type definitions
β βββ TestDataHelper.ts # Helper class for data management
β βββ testData.ts # Test scenarios data
βββ pages/ # Page Objects
β βββ BasePage.ts # Base page with common functionality
β βββ LoginPage.ts # Login page object
β βββ RegistrationPage.ts # Registration page object
βββ specs/ # Test Specifications
βββ registration.spec.ts # Test cases
Features
- Page Object Model: Separates test logic from page interactions
- Data-Driven Testing: Test data is separated from test logic
- TypeScript: Strong typing and better IDE support
- Reusable Components: Common functionality in base classes
- Easy Maintenance: Centralized locators and data management
- Scalable: Easy to add new test scenarios and page objects
Test Data Structure
The framework uses a structured approach to manage test data:
interface TestScenario {
name: string;
login: LoginData;
registration: RegistrationData;
}
Current test scenarios:
1. Valid Registration Flow (Male user)
2. Female User Registration
Setup
1. Clone the repository:
git clone <repository-url>
cd playwrightMCP_Demo
2. Install dependencies:
npm install
3. Install Playwright browsers:
npx playwright install
Running Tests
Run all tests:
npx playwright test
Run specific test file:
npx playwright test tests/specs/registration.spec.ts
Run tests in headed mode:
npx playwright test --headed
Adding New Test Scenarios
1. Add new test data in tests/data/testData.ts:
{
name: 'Your Scenario Name',
login: {
email: 'your.email@test.com'
},
registration: {
firstName: 'First',
lastName: 'Last',
address: 'Address',
email: 'email@test.com',
phone: '1234567890',
gender: 'Male' | 'Female',
country: 'Country Name'
}
}
2. The test will automatically execute for new scenarios.
Framework Components
Page Objects
- BasePage: Contains common methods and utilities
- LoginPage: Handles login functionality
- RegistrationPage: Manages registration form interactions
Data Management
- TestData.ts: Contains test scenarios
- TestDataHelper: Provides methods to access and manage test data
- Interfaces: Defines structure for test data
Best Practices
1. Keep page objects focused on page-specific functionality
2. Maintain test data separately from test logic
3. Use meaningful scenario names
4. Follow TypeScript naming conventions
5. Keep tests independent and atomic
Contributing
1. Create a new branch for your feature
2. Add/Update tests and page objects
3. Update test data if needed
4. Submit a pull request
Dependencies
- Playwright
- TypeScript
- Node.js
- @executeautomation/playwright-mcp-server - For enhanced test recording and playback
- @playwright/test - Core testing framework
Support
For any questions or issues, please create a new issue in the repository.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





