Playwright Testing Framework
ai_driven_test_automation_with_playwright_cursor_mcp_server
lupusludens-se
README
Playwright Testing Framework
This project contains UI and API tests for the Zeigo Network Dashboard using Playwright for end-to-end (E2E) testing.
What We're Using
Playwright enables reliable end-to-end testing for modern web apps with features like:
- Cross-browser testing support
- Cross-platform testing capability
- Multi-language support (TypeScript, JavaScript, Python, .NET, Java)
- Mobile web testing
- Parallel test execution
- Built-in debugging tools
Documentation
Structure
.vscode/
: Workspace-specific settings.ui-tests/specs/
: UI test specifications.api-tests/specs/
: API test specifications.pages/
: Page Object Model (POM) files.utils/
: Utility functions or helpers..env
: Environment variables..gitignore
: Files to exclude from version control.
Prerequisites
-
Node.js: Install Node.js v20 or higher
-
Environment Setup: Create a
.env
file with the following configuration:# Base URLs API_BASE_URL=https://your-api-url UI_BASE_URL=https://your-ui-url
Getting Started
-
Install Playwright and dependencies:
npm install npx playwright install npm install dotenv
-
Install VS Code Playwright extension:
code --install-extension ms-playwright.playwright
-
Run tests:
Test Execution Options
Using VS Code Test Explorer
- Open VS Code
- Click on the Testing icon in the Activity Bar (beaker icon)
- Click the Play button to run all tests
- Or run individual tests by clicking the play button next to each test
Using Command Line
Basic Test Commands
# Run all tests
npx playwright test
# Run tests in headed mode
npx playwright test --headed
# Run tests in specific browser
npx playwright test --project=chromium
# Debug mode
npx playwright test --debug
# Generate tests with Codegen
npx playwright codegen
Environment-Specific Test Execution
Windows PowerShell
# Test environment
$env:CI="true"; $env:target_env="test"; npx playwright test --reporter=list
# PreProd environment
$env:CI="true"; $env:target_env="preprod"; npx playwright test --reporter=list
macOS/Linux
# Test environment
CI=1 target_env="test" npx playwright test --reporter=list
# PreProd environment
CI=1 target_env="preprod" npx playwright test --reporter=list
Running Specific Tests
# Run by test name
npx playwright test -g "name of my test" --project=chromium
# Run specific test file
npx playwright test tests/specific-test.spec.js
# Run tests with specific tag
npx playwright test --grep @tag_name
Browser-Specific Test Execution
# Chrome
npm run regression:chromium
# Safari
npm run regression:safari
# All browsers in headless mode
npm run regression
# All browsers in headed mode
npm run regression:headed
Test Scheduler
To run tests in batches with delays:
.\run_tests_scheduler.bat
Test Explorer Features
- 🔍 Browse tests in a tree view
- ▶️ Run/Debug individual tests or test files
- 🔄 Re-run failed tests
- 📊 View test results inline
- 🎯 Jump to test definitions
- 📋 Filter tests by status or tags
- 🎯 Debug tests with breakpoints
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
MCP Package Docs Server
Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
@kazuph/mcp-taskmanager
Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.
Linear MCP Server
Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.
mermaid-mcp-server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.
Jira-Context-MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor

Linear MCP Server
A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.