DEV Community

Cover image for Playwright Agents: Or Once Again About AI Taking Away Our Job
Iryna Katmaieva
Iryna Katmaieva

Posted on

Playwright Agents: Or Once Again About AI Taking Away Our Job

Recently, Playwright introduced Playwright Agents.

In short, it’s an AI-driven companion integrated into VS Code (and also supported in Claude Code and OpenCode) that can plan, generate, and heal your Playwright tests — right inside your IDE.

To get started, all you need is the latest VS Code and an updated Playwright version.

Then just run:

npx playwright init-agents --loop=vscode

Enter fullscreen mode Exit fullscreen mode

After setup, you’ll see three agents available in your Copilot Chat dropdown:

  • Planner – generates a test plan with ideas and user flows
  • Generator – creates the actual spec files
  • Healer – fixes and stabilizes flaky tests

🧭 Step 1 — Planner: “Let’s brainstorm the test plan”

When I first tried the Planner, I typed something simple like:

Explore and generate a test plan for …

Playwright Planner

It generated a detailed markdown test plan covering scenarios and user flows. Perfect input for the next step — Generator.


⚙️ Step 2 — Generator: “Now implement the tests”

Next, I switched to the Generator agent and asked:

Implement test for 1. Landing Page Loads Successfully (Happy Path)

Playwright Generator

The agent created a new Playwright spec file and walked me through every step of its reasoning.

It even asked permission before running commands in the terminal — which felt like the AI politely asking, “Mind if I test this?”

And here’s where seniority comes into play:

If you’re a junior, the AI feels like a mentor.

If you’re senior, you realize how much control you still need to maintain.

Your understanding directly defines the quality of its output.

During my tests, I decided to let the AI guide me — pretending I was new to Playwright.

Playwright Generator reasoning

My goal: get a working spec that tests the Netflix landing page.


🚦 Step 3 — First run: “And... it failed”

Of course, it failed.

So I switched to the Healer agent and said:

Run and fix it.

That’s when the magic (and chaos) began.

The Healer started debugging, trying different fixes, and even went as far as creating an HTML mock fixture — just to make the test pass.

Playwright Healer

At that moment, I had to stop the “AI freedom experiment.”

It was fascinating… but painful to watch.

The model clearly lacked real context, over-engineering solutions like a junior dev who just discovered cy.intercept() for the first time.


🎯 What I Learned

After watching Debbie’s demo on YouTube, it became clear:

Playwright Agents shine when used inside an existing Test Automation System — once your repo already has meaningful specs, helpers, and Page Objects. Then the agents can work contextually, not blindly.

So no, the robots aren’t taking our jobs.

Playwright Agent isn’t your competitor — it’s another tool in your toolbox.

Used right, it can offload the boring parts of your day — setup, boilerplate, debugging — letting you focus on what actually matters: designing smarter tests and building better systems.

But comparing this workflow to what we had 2–3 years ago? It’s night and day.

  • Instead of searching StackOverflow, we ask LLMs.
  • Instead of Google, we use Perplexity or NotebookLM.
  • Instead of writing manual docs, we now discuss instructions with our agent.

💬 So What About You?

Have you tried Playwright Agents yet? How has your workflow evolved over the last two years?


🎥 Related Resource

Watch Debbie’s Playwright Agents Demo on YouTube

Top comments (0)