[{"data":1,"prerenderedAt":255},["ShallowReactive",2],{"blog-article-/blog/fixing-failing-tests-automatically-with-playwrights-new-healer-agent":3,"blog-surround-/blog/fixing-failing-tests-automatically-with-playwrights-new-healer-agent":246},{"id":4,"title":5,"body":6,"canonical":231,"date":232,"description":12,"extension":233,"featured":234,"image":235,"meta":236,"navigation":237,"ogImage":235,"path":238,"provider":235,"published":237,"seo":239,"stem":240,"tags":241,"url":235,"__hash__":245},"blog/blog/fixing-failing-tests-automatically-with-playwrights-new-healer-agent.md","Fixing Failing Tests Automatically with Playwright's New Healer Agent",{"type":7,"value":8,"toc":222},"minimark",[9,13,18,21,27,30,38,42,45,48,85,88,92,95,105,114,117,121,124,137,140,144,147,150,165,168,199,202,206,209,212,215,218],[10,11,12],"p",{},"If you've ever returned to your test suite to find a sea of red, you're going to love this one. The Playwright Healer Agent is here — and it's changing how we think about test maintenance.",[14,15,17],"h2",{"id":16},"what-is-the-healer-agent","What Is the Healer Agent?",[10,19,20],{},"The Healer Agent is part of Playwright's new generation of AI-powered agents. Its goal is simple:",[22,23,24],"blockquote",{},[10,25,26],{},"Automatically diagnose, repair, and re-run your failing tests.",[10,28,29],{},"Instead of spending time manually debugging selector changes or broken assertions, the Healer Agent can step in, analyze what's wrong, and apply fixes directly to your test code.",[10,31,32,33,37],{},"And when it can't fix something because the real problem is in your app or backend, it's smart enough to mark that test with ",[34,35,36],"code",{},"test.fixme",", saving you time and frustration.",[14,39,41],{"id":40},"watching-the-healer-in-action","Watching the Healer in Action",[10,43,44],{},"When I ran the agent, it immediately found nine failing tests. Then I walked away, literally went to grab a sandwich. By the time I came back, the agent had already finished its work.",[10,46,47],{},"Here's what it did under the hood:",[49,50,51,59,73,79],"ol",{},[52,53,54,58],"li",{},[55,56,57],"strong",{},"Debugged each failing test"," — stepping through line by line to understand the failure.",[52,60,61,64,65,68,69,72],{},[55,62,63],{},"Identified UI mismatches"," — for example, a test looking for a ",[34,66,67],{},"textbox"," when the app now uses a ",[34,70,71],{},"combobox",".",[52,74,75,78],{},[55,76,77],{},"Applied fixes"," — updated the locators and assertions to match the actual UI.",[52,80,81,84],{},[55,82,83],{},"Re-ran the tests"," — verified that the fixes worked.",[10,86,87],{},"One particularly cool example: It saw that a test expected a heading with a certain regex pattern. But after checking a page snapshot, it found there were two separate heading elements. So it automatically adjusted the regex to make the test more flexible, then re-ran the test to confirm the fix.",[14,89,91],{"id":90},"smarter-than-just-making-tests-pass","Smarter Than Just \"Making Tests Pass\"",[10,93,94],{},"One of my favorite moments was when the agent encountered a failing test that wasn't fixable through code alone.",[10,96,97,98,101,102,104],{},"The test was failing because the backend API wasn't responding, it saw a ",[34,99,100],{},"Failed to fetch"," error in the console logs. Instead of forcing a bad fix or skipping it silently, the agent marked the test as ",[34,103,36],{},", with a clear message explaining why:",[22,106,107],{},[10,108,109,110,113],{},"\"Save operation is failing with ",[34,111,112],{},"fail to fetch"," error — likely a backend issue.\"",[10,115,116],{},"That's exactly how a responsible AI should behave — not hiding the problem, but documenting it.",[14,118,120],{"id":119},"reviewing-the-results","Reviewing the Results",[10,122,123],{},"At the end of the run, the agent produced a summary:",[10,125,126,127,130,131,133,134,136],{},"• ✅ 104 tests passing",[128,129],"br",{},"\n• ⚠️ 3 tests intentionally skipped (",[34,132,36],{},")",[128,135],{},"\n• 🧠 Clear explanations for every change",[10,138,139],{},"Every fix was committed right in the codebase, complete with comments and annotations. Reviewing those changes is as easy as opening your editor and scanning the updated tests.",[14,141,143],{"id":142},"the-future-of-test-maintenance","The Future of Test Maintenance",[10,145,146],{},"This is a huge leap forward for automated testing. The Playwright Healer Agent doesn't just \"fix\" your tests — it understands them.",[10,148,149],{},"It's capable of:",[10,151,152,153,155,156,158,159,161,162,164],{},"• Reading and interpreting test logs",[128,154],{},"\n• Inspecting DOM snapshots",[128,157],{},"\n• Updating selectors, regex patterns, and assertions",[128,160],{},"\n• Recognizing backend or configuration issues",[128,163],{},"\n• Writing and verifying code fixes automatically",[10,166,167],{},"You can literally tell it:",[169,170,175],"pre",{"className":171,"code":172,"language":173,"meta":174,"style":174},"language-bash shiki shiki-themes github-light github-dark","run and fix my tests\n","bash","",[34,176,177],{"__ignoreMap":174},[178,179,182,186,190,193,196],"span",{"class":180,"line":181},"line",1,[178,183,185],{"class":184},"sScJk","run",[178,187,189],{"class":188},"sZZnC"," and",[178,191,192],{"class":188}," fix",[178,194,195],{"class":188}," my",[178,197,198],{"class":188}," tests\n",[10,200,201],{},"…and then walk away. When you return, your test suite will be passing (or clearly annotated), ready for your review.",[14,203,205],{"id":204},"final-thoughts","Final Thoughts",[10,207,208],{},"The Healer Agent isn't just a convenience, it's a glimpse of where developer tooling is headed.",[10,210,211],{},"We're moving toward a world where AI doesn't just write code, but maintains and adapts it alongside us.",[10,213,214],{},"If you haven't tried it yet, give it a spin. Ask the Healer Agent to fix your failing tests, grab a coffee, and come back to review the magic.",[10,216,217],{},"👉 Happy healing — and happy testing!",[219,220,221],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":174,"searchDepth":223,"depth":223,"links":224},2,[225,226,227,228,229,230],{"id":16,"depth":223,"text":17},{"id":40,"depth":223,"text":41},{"id":90,"depth":223,"text":91},{"id":119,"depth":223,"text":120},{"id":142,"depth":223,"text":143},{"id":204,"depth":223,"text":205},"https://dev.to/debs_obrien/fixing-failing-tests-automatically-with-playwrights-new-healer-agent-13ck","2024-11-13","md",false,null,{},true,"/blog/fixing-failing-tests-automatically-with-playwrights-new-healer-agent",{"title":5,"description":12},"blog/fixing-failing-tests-automatically-with-playwrights-new-healer-agent",[242,243,244],"playwright","ai","testing","Oy9BKpoyC6aky3wxxAOx7PzJL2KHUcpWHcK2OjHrVeE",[247,251],{"title":248,"path":249,"stem":250,"children":-1},"Playwright MCP Servers Explained Automation and Testing","/blog/playwright-mcp-servers-explained-automation-and-testing","blog/playwright-mcp-servers-explained-automation-and-testing",{"title":252,"path":253,"stem":254,"children":-1},"I Built My Own AI Agent using n8n — And You Can Too","/blog/i-built-my-own-ai-agent-and-you-can-too","blog/i-built-my-own-ai-agent-and-you-can-too",1790839746428]