Skip to content
| Marketplace
Sign in
Visual Studio Code>Testing>Playwright AI InsightsNew to Visual Studio Code? Get it now.
Playwright AI Insights

Playwright AI Insights

AnilKumarKedia

|
6 installs
| (0) | Free
AI-powered test failure analysis and self-healing locator suggestions for Playwright
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Playwright AI Insights - VS Code Extension

AI-powered test failure analysis and self-healing locator suggestions directly in your VS Code editor.

Features

✨ Smart Analysis

  • 🤖 Instant AI analysis of test failures
  • 💡 AI-suggested locator improvements
  • 📊 Visual insights panel with statistics
  • ⚡ One-click failure analysis from explorer

🔧 Easy Integration

  • Works with any Playwright project
  • No code changes needed
  • Configure once, works everywhere
  • Minimal setup (just API key)

📈 Actionable Insights

  • Root cause analysis
  • Specific fix suggestions
  • Confidence scores
  • Import history tracking

Installation

  1. Install from VS Code Marketplace: Playwright AI Insights
  2. Set your OpenAI API key in settings or environment variable
  3. Run tests and analyze failures

Getting Started

Step 1: Configure API Key

Open VS Code Settings and search for playwright-ai:

Cmd + , (Mac) or Ctrl + , (Windows/Linux)

Search for playwright-ai.apiKey and enter your OpenAI API key.

Alternatively, set OPENAI_API_KEY environment variable.

Step 2: Analyze Test Failures

  1. Run your Playwright tests:

    npx playwright test
    
  2. Open Command Palette (Cmd + Shift + P / Ctrl + Shift + P)

  3. Search for Playwright AI: Analyze Test Failures

  4. View results in the AI Insights panel

Step 3: Apply Suggestions

  • Review suggested locators in the panel
  • Click "Apply Suggestion" to use AI recommendations
  • Improve your test selectors instantly

Commands

Command Description
Playwright AI: Analyze Test Failures Analyze failures from current workspace
Playwright AI: Open AI Insights Panel Show the insights panel
Playwright AI: Configure OpenAI API Key Set up your API key

Settings

{
  "playwright-ai.apiKey": "sk-...",           // Your OpenAI API key
  "playwright-ai.model": "gpt-4o-mini",       // AI model (gpt-4o, gpt-4o-mini, gpt-4-turbo)
  "playwright-ai.autoAnalyze": false,         // Auto-analyze after test runs
  "playwright-ai.debug": false                // Enable debug logging
}

Usage Examples

Automatic Analysis After Test Run

Enable autoAnalyze in settings for automatic analysis when tests complete.

Analyze Specific Test Result Directory

Right-click on test result folder in explorer and select "Analyze Test Failures"

View Historical Analysis

All analysis reports are saved in your workspace for review.

Pricing

Uses OpenAI's gpt-4o-mini model by default:

  • ~$0.015 per 1M input tokens
  • ~$0.06 per 1M output tokens

Typical cost per test failure: $0.001 - $0.003

Troubleshooting

Extension not activating?

  • Check that API key is configured
  • Restart VS Code
  • Check output channel for errors

No failures found?

  • Ensure test results exist in playwright-report or test-results directories
  • Run tests first: npx playwright test

Slow analysis?

  • Check OpenAI API status at status.openai.com
  • Verify network connectivity
  • Try smaller batch sizes

Privacy & Security

  • API key stored securely in VS Code
  • Analysis done via OpenAI API
  • No data stored long-term
  • Only failure info + DOM sent to API (capped at 6000 chars)

Learn More

  • Quick Start Guide
  • NPM Package Documentation
  • Examples & Recipes

Support

  • 🐛 Report Issues
  • 💬 Discussions
  • 📖 Documentation

License

MIT


Happy Testing! 🎭

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft