Agentic QA: Orchestrating Playwright Test Agents
Suneet Malhotra
Nov 15, 2025

Introduction: The Paradigm Shift in QA
The landscape of quality engineering is undergoing a fundamental transformation. For decades, test automation has followed a predictable pattern: write scripts, maintain selectors, debug failures, repeat. But as mobile applications push toward weekly—and even daily—release cycles, this traditional approach is breaking down under the weight of what I call the "Maintenance Tax."
Enter Playwright Test Agents: a revolutionary approach that shifts QA from reactive maintenance to proactive, AI-driven orchestration. This isn't just automation—it's agentic automation, where AI agents collaborate to plan, generate, and heal tests autonomously.
TL;DR: Key Takeaways
- Agentic Automation: Planner, Generator, and Healer agents collaborate autonomously
- Eliminates Maintenance Tax: No more manual selector fixes or test debugging
- Self-Healing Tests: Tests automatically adapt to UI changes and recover from failures
- Paradigm Shift: From reactive maintenance to proactive, AI-driven orchestration
- Scalable Solution: Works at global scale with zero manual intervention
The Problem: The Maintenance Tax
Every QA engineer knows the pain. A developer changes a CSS class from .btn-submit to .btn-primary, and suddenly, half your test suite is red. You spend hours updating selectors, debugging flaky tests, and maintaining brittle locators. This "Maintenance Tax" accounts for an estimated 40-60% of QA engineering time in high-velocity teams.
The Traditional Cycle:
- Write test scripts
- Tests pass initially
- UI changes break selectors
- Manual debugging and fixes
- Repeat
This cycle creates a bottleneck that slows down entire engineering organizations. At Tinder, as we moved from bi-weekly to weekly releases, we needed a fundamentally different approach.
The Agentic Loop: A Cohesive System
Playwright Test Agents introduce three specialized AI agents that work together in a continuous loop:

The Three Agents
1. Planner Agent → Strategic Planning
- Input: User requirements, seed environment, application context
- Output: Markdown test plans in
specs/directory - Role: Analyzes your application and creates structured, high-level test strategies
2. Generator Agent → Efficient Test Creation
- Input: Markdown test plans from Planner
- Output: Executable Playwright TypeScript tests in
tests/ - Role: Translates strategic plans into production-ready test code
3. Healer Agent → Automatic Test Repair
- Input: Failed test results, traces, screenshots, error messages
- Output: Fixed test code with updated selectors and logic
- Role: Analyzes failures and automatically repairs tests
The beauty of this system is its cyclical nature: when Healer fixes a test, it feeds back into the execution loop, creating a self-improving system.
Deep Dive: The Planner Agent
The Planner Agent is the strategic mind of the system. It doesn't just write tests—it thinks about testing.
How It Works:
-
Context Gathering: Uses the seed file (
tests/seed.spec.ts) to understand your application structure, base URL, and key selectors. -
Requirement Analysis: Takes high-level requirements like "Test the checkout flow" and breaks them down into actionable test scenarios.
-
Plan Generation: Creates Markdown test plans in
specs/that outline:- Test objectives
- Step-by-step scenarios
- Expected outcomes
- Edge cases to consider
Example Planner Output:
# Test Plan: Homepage Navigation
## Objective
Verify that all navigation links work correctly and lead to expected pages.
## Test Scenarios
1. Click "About" link → Should navigate to /about
2. Click "Blog" link → Should navigate to /blog
3. Click "Contact" link → Should navigate to /contact
## Edge Cases
- Mobile viewport navigation
- Keyboard navigation
- Accessibility compliance
The Planner's strategic approach ensures tests are comprehensive before code is written, reducing the need for extensive refactoring later.
Deep Dive: The Generator Agent
The Generator Agent is the execution engine. It takes the Planner's strategic vision and converts it into production-ready code.
How It Works:
- Plan Parsing: Reads Markdown test plans from
specs/ - Code Generation: Creates TypeScript test files following your existing patterns
- Pattern Matching: Uses your Page Object Model structure and coding conventions
- Test Output: Generates executable tests in
tests/directory
Key Features:
- Type-Safe: Generates TypeScript with proper types
- Maintainable: Follows your existing code structure
- Comprehensive: Includes assertions, error handling, and cleanup
Example Generated Test:
import { test, expect } from '@playwright/test';
import { HomePage } from '../pages/home.page';
test('Homepage Navigation - About Link', async ({ page }) => {
const homePage = new HomePage(page);
await homePage.goto();
await homePage.clickNavLink('About');
await expect(page).toHaveURL('https://suneetmalhotra.com/about');
});
The Generator eliminates the manual coding step, allowing engineers to focus on reviewing and refining rather than writing boilerplate.
Deep Dive: The Healer Agent - The Self-Healing Revolution
The Healer Agent is where the magic happens. It's the agent that eliminates the Maintenance Tax by automatically fixing failing tests.
How Healer Works
When a test fails, the Healer Agent performs multimodal analysis:
1. Trace Analysis:
- Reviews Playwright trace files to understand execution flow
- Identifies where and why the test failed
- Analyzes DOM state at the point of failure
2. Screenshot Analysis:
- Examines screenshots captured on failure
- Uses computer vision to identify UI elements
- Compares expected vs. actual page state
3. Error Message Analysis:
- Parses error messages for context
- Identifies selector issues, timeout problems, or logic errors
- Understands the root cause
4. Fix Generation:
- Suggests updated selectors based on current DOM
- Adds appropriate wait conditions
- Adjusts test logic to match new UI patterns
5. Automatic Application:
- Applies fixes to the test code
- Maintains test intent while updating implementation
- Re-runs the test to verify the fix
Comparison: Traditional vs. Agentic Maintenance
| Aspect | Traditional Playwright | Agentic Playwright (Healer) |
|---|---|---|
| Selector Updates | Manual, time-consuming | Automatic, instant |
| Debugging Time | Hours per failure | Minutes (automated) |
| Maintenance Overhead | 40-60% of QA time | <10% of QA time |
| Test Stability | Degrades over time | Improves over time |
| MTTR (Mean Time To Repair) | 2-4 hours | 5-15 minutes |
| False Positives | High (brittle selectors) | Low (self-healing) |
| Engineer Focus | Maintenance | Architecture & Strategy |
Real-World Impact
At Tinder, implementing the Healer Agent reduced test maintenance time by 70%. What used to take 4 hours of debugging now takes 10 minutes of review. This freed our senior engineers to focus on:
- Architectural improvements: Building better test infrastructure
- Strategic initiatives: Risk-based test selection, predictive quality models
- Team development: Mentoring and knowledge sharing
My Implementation
I've integrated Playwright Test Agents into my QA automation framework, creating a production-ready system that demonstrates the future of test automation.
Directory Structure
qa-automation/
├── specs/ # Markdown test plans (from Planner)
│ └── *.md # Test plans generated by Planner
├── tests/ # Executable test files
│ ├── seed.spec.ts # Seed environment for Planner
│ └── *.spec.ts # Generated and manual tests
├── playwright.config.ts # Enhanced for Healer support
├── .cursor/
│ └── rules/
│ └── playwright-agents.mdc # Cursor integration
└── AGENTS_SETUP.md # Comprehensive setup guide
Key Configuration
playwright.config.ts Enhancements:
use: {
baseURL: 'https://suneetmalhotra.com',
// Enhanced trace recording for Healer agent
trace: 'on-first-retry',
traceOptions: {
screenshots: true,
snapshots: true,
sources: true,
},
// Extended timeout for Healer analysis
expect: {
timeout: 10000,
},
}
Agent Commands
# Initialize agents
npm run agents:init
# Run seed test (establishes base environment)
npm run test:seed
# Run tests (Healer auto-fixes failures)
npm test
# View traces for failed tests
npx playwright show-trace test-results/[test-name]/trace.zip
View the full implementation: GitHub Repository
Commit reference: Initial Agent Implementation
The "Seed" Concept: Foundation for Intelligence
The tests/seed.spec.ts file is crucial—it's the foundation of intelligence for the Planner agent.
What Seed Provides:
- Base URL: Where the application lives
- Initial State: Verified page load and structure
- Application Context: Key selectors, page structure, navigation patterns
- Test Data: Common data used across tests
Why It Matters:
Without seed context, the Planner agent would be "blind." The seed file gives it:
- Understanding of your application structure
- Knowledge of existing patterns
- Context for generating relevant test plans
Think of it as giving the Planner agent a map of your application before it starts planning tests.
Leadership Takeaways & Business Impact
As an Engineering Manager, I've seen firsthand how agentic QA transforms organizations:
Scaling Quality Engineering
Before Agentic QA:
- Senior engineers spend 40-60% of time on maintenance
- Limited bandwidth for strategic work
- High turnover due to repetitive tasks
After Agentic QA:
- Senior engineers focus on architecture and strategy
- Team scales without proportional maintenance overhead
- Engineers work on high-value problems
Reducing MTTR (Mean Time To Repair)
Traditional test failures require:
- Engineer notices failure (15-30 min)
- Debugging and root cause analysis (1-2 hours)
- Fix implementation (30-60 min)
- Verification (15-30 min) Total: 2-4 hours
With Healer Agent:
- Automatic failure detection (instant)
- Healer analysis and fix (5-10 min)
- Engineer review (5 min) Total: 10-15 minutes
Result: 90% reduction in MTTR
Enabling High-Velocity Releases
For companies pushing weekly or daily mobile releases, agentic QA isn't a nice-to-have—it's a competitive necessity.
The Math:
- Weekly releases = 52 releases/year
- Traditional maintenance = 2-4 hours per release = 104-208 hours/year
- Agentic maintenance = 10-15 min per release = 8.5-13 hours/year
Time Saved: 95-200 hours per year per engineer
This time can be redirected to:
- Building better test infrastructure
- Creating predictive quality models
- Developing team capabilities
- Strategic quality initiatives
The Future: Agentic QA as Standard
We're at an inflection point. The companies that adopt agentic QA now will have a significant competitive advantage in:
- Release Velocity: Faster shipping without quality debt
- Team Efficiency: Engineers focused on high-value work
- Quality Confidence: Self-improving test suites
- Cost Reduction: Lower maintenance overhead
The future of QA isn't just automation—it's intelligent, self-healing, agentic automation.
Conclusion
Playwright Test Agents represent the next evolution of quality engineering. By combining strategic planning (Planner), efficient generation (Generator), and automatic healing (Healer), we can build test suites that improve over time rather than degrade.
As we push toward faster release cycles and more complex applications, agentic QA becomes essential. It's not about replacing engineers—it's about amplifying their impact by eliminating repetitive maintenance and enabling focus on strategic, high-value work.
The question isn't whether agentic QA will become standard—it's how quickly your organization can adopt it.
This implementation is part of my ongoing work in AI-driven quality engineering. For the complete codebase and setup guide, visit my GitHub repository.
Share this post
You Might Also Like
The One Step I Never Hand to a Subagent
My content routine dispatches a fleet of subagents to gather, then hands none of them the draft. A fleet parallelizes retrieval. It cannot parallelize a voice.
AI & AutomationThe Number My Model Is Not Allowed to Know
There is a rule I enforce across every agent I run, and it has nothing to do with how good the model is. The model writes the words. It never computes the numbers.
Agentic AIEverything in My Context Window Is an Instruction
This routine reads the open web, then commits to a live site with no human in the loop. Those two facts sit in the same context window, and the model has no way to tell them apart.
Quantitative TradingThe Edge I Assume Is Already Decaying
Wall Street spent this week arguing that AI is cutting the useful life of a trading edge from seven years to eighteen months. If that is even half right, it changes what a signal is worth.
Latest Blog Posts
Everything in My Context Window Is an Instruction
This routine reads the open web, then commits to a live site with no human in the loop. Those two facts sit in the same context window, and the model has no way to tell them apart.
The Edge I Assume Is Already Decaying
Wall Street spent this week arguing that AI is cutting the useful life of a trading edge from seven years to eighteen months. If that is even half right, it changes what a signal is worth.
The If Statement My Audit Never Read
On May 20 I published a rule for which steps of a routine are safe to run twice, and put my repo pull in the safest bucket. On July 9 that step failed. It never ran.
Related Tools & Demos
Multi-Model LLM Harness
One interface to call any AI model — capability routing, fallback chains, budgets, circuit breakers, and a quality feedback loop. A practical architecture pattern write-up.
Automated Trading System
Multi-engine trading platform with real-time risk management, regime-based strategy selection, and automated order execution.
View Source Code →Personal Health Analytics
Multi-modal health data platform integrating wearables, lab results, and lifestyle tracking with predictive habit modeling.
View Source Code →
Stay in the Loop
Get weekly insights on AI-driven QA, engineering leadership, and automation strategies.
No spam, ever. Unsubscribe anytime.