Member-only story
Featured
🤖“Fix with AI” Button in Playwright Reports
Step-by-Step Guide to Fixing Bugs with AI in Playwright

End-to-end tests are essential for ensuring the reliability of your application, but they can also be a source of frustration. Even small changes to the user interface can cause tests to fail, leading developers and QA teams to spend hours troubleshooting.
In this blog post, I’ll show you how to harness the power of AI tools like ChatGPT or Copilot to automatically fix Playwright tests. You’ll learn how to create an AI prompt for any test that fails and attach it to your HTML report. This way, you can easily copy and paste the prompt into AI tools for quick suggestions on fixing the test. Join me to streamline your testing process and improve application reliability!
Let’s dive in!
If you are behind the Medium paywall and can’t read this article, click here this publication is open to everyone.
Plan
The solution comes down to three simple steps:
1. Identify when a Playwright test fails.
2. Create an AI prompt with all the necessary context:
- The error message
- A snippet of the test code
- An ARIA snapshot of the page