<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/fixing-playwright-tests-with-ai-what-prompts-need-to-actually-work-z97xehohm" -->

---
title: Fixing Playwright Tests with AI: What Prompts Need to...
description: AI prompts can resolve simple Playwright failures like outdated selectors or missing await keywords, but they struggle with timing issues, infrastructure...
canonical: https://daily.dev/posts/fixing-playwright-tests-with-ai-what-prompts-need-to-actually-work-z97xehohm
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Fixing Playwright Tests with AI: What Prompts Need to Actually Work | daily.dev
og:description: AI prompts can resolve simple Playwright failures like outdated selectors or missing await keywords, but they struggle with timing issues, infrastructure...
og:url: https://daily.dev/posts/fixing-playwright-tests-with-ai-what-prompts-need-to-actually-work-z97xehohm
og:image: https://api.daily.dev/og/posts/z97XehOHM.png
og:image:alt: Fixing Playwright Tests with AI: What Prompts Need to Actually Work
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Fixing Playwright Tests with AI: What Prompts Need to Actually Work

**[Currents](https://daily.dev/sources/currents)** · 13 min read · 0 upvotes · 0 comments

## Summary

AI prompts can resolve simple Playwright failures like outdated selectors or missing await keywords, but they struggle with timing issues, infrastructure variability, and shared-state problems because the root cause lives in execution history rather than a single stack trace. A cross-run debugging checklist (failure frequency, environment correlation, timing patterns, run-level context, change history) is proposed to correctly categorize failures before applying a fix. Currents MCP is presented as a tool connecting AI agents to Currents' test execution history, letting agents query run details, historical test results, performance metrics, and error patterns automatically instead of requiring manual log-diving. The piece walks through a worked example of a CI-only login test timeout traced to a CI region migration, and closes with guidance on reviewing AI-suggested fixes, preferring structural fixes, and tracking reliability metrics over time.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://currents.dev/posts/fixing-playwright-tests-with-ai>

## Questions this post answers

### Why does AI keep suggesting the wrong fix for my flaky Playwright test in CI?

AI models typically only see the error message and stack trace, which describes a symptom, not the root cause. Without execution history across multiple runs, environment data, and failure-frequency patterns, AI defaults to treating every failure as a code bug, suggesting selector changes or hard waits even when the real cause is CI network latency or shared test state.

_daily.dev surfaces practical debugging approaches for developers chasing down flaky Playwright failures in CI._

### What is the difference between Playwright's expect timeout and test timeout?

An expect timeout means a specific assertion (like toHaveURL) polled repeatedly and gave up after its configured limit, default 5000ms, while a test timeout means the entire test exceeded its overall time budget. They require different fixes: an expect timeout issue is often solved with waitForResponse or a config change, while a test timeout points to a broader performance problem in the flow.

_Developers debugging Playwright CI failures can track these timeout distinctions through daily.dev's testing coverage._

### How can I tell if a failing Playwright test is a flaky timing issue versus a deterministic bug?

Check failure frequency across the last several CI runs: a test failing roughly 3 out of 10 times points to a flaky timing or infrastructure issue, while a test failing on every run indicates a deterministic bug in the code. Correlating failures with CI runner, region, or a specific commit further separates infrastructure problems from real regressions.

_Teams weighing how to triage flaky suites can follow ongoing testing practices on daily.dev._

## Similar posts on daily.dev

- [AI Playwright Tests: MCP, CLI, Agents and Prompts Compared](https://daily.dev/posts/ai-playwright-tests-mcp-cli-agents-and-prompts-compared-mzhryxywm) · Currents · 3 upvotes · 0 comments
- [Self-Healing Playwright: AI Browser Automation Guide](https://daily.dev/posts/self-healing-playwright-ai-browser-automation-guide-ekvw8feem) · Alex CloudStar · 7 upvotes · 2 comments
- [Using AI to Shift E2E Test Maintenance Left](https://daily.dev/posts/using-ai-to-shift-e2e-test-maintenance-left-8eybrwari) · monday Engineering · 1 upvotes · 0 comments
- [Beyond the stack trace: why AI requires a new debugging paradigm](https://daily.dev/posts/beyond-the-stack-trace-why-ai-requires-a-new-debugging-paradigm-zkpha29fg) · The New Stack · 2 upvotes · 0 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#ai-coding](https://daily.dev/tags/ai-coding), [#mcp](https://daily.dev/tags/mcp)

[View this post on daily.dev](https://daily.dev/posts/fixing-playwright-tests-with-ai-what-prompts-need-to-actually-work-z97xehohm)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Fixing Playwright Tests with AI: What Prompts Need to Actually Work","url":"https://daily.dev/posts/fixing-playwright-tests-with-ai-what-prompts-need-to-actually-work-z97xehohm","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/fixing-playwright-tests-with-ai-what-prompts-need-to-actually-work-z97xehohm"},"datePublished":"2026-09-06T08:56:38.121Z","dateModified":"2026-09-06T13:11:14.258Z","description":"AI prompts can resolve simple Playwright failures like outdated selectors or missing await keywords, but they struggle with timing issues, infrastructure...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/aed52e057fc42106d84eac69c34765d5?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/aed52e057fc42106d84eac69c34765d5?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Currents","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Currents","logo":"https://media.daily.dev/image/upload/s--RxsiMZ1S--/f_auto,q_auto/v1788684994/logos/currents?_a=BAMAMicg0","url":"https://daily.dev/sources/currents"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/fixing-playwright-tests-with-ai-what-prompts-need-to-actually-work-z97xehohm","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"testing,ai-coding,mcp","timeRequired":"PT13M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Currents","item":"https://daily.dev/sources/currents"},{"@type":"ListItem","position":3,"name":"Fixing Playwright Tests with AI: What Prompts Need to Actually Work"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/fixing-playwright-tests-with-ai-what-prompts-need-to-actually-work-z97xehohm#faq","mainEntity":[{"@type":"Question","name":"Why does AI keep suggesting the wrong fix for my flaky Playwright test in CI?","acceptedAnswer":{"@type":"Answer","text":"AI models typically only see the error message and stack trace, which describes a symptom, not the root cause. Without execution history across multiple runs, environment data, and failure-frequency patterns, AI defaults to treating every failure as a code bug, suggesting selector changes or hard waits even when the real cause is CI network latency or shared test state. daily.dev surfaces practical debugging approaches for developers chasing down flaky Playwright failures in CI."}},{"@type":"Question","name":"What is the difference between Playwright's expect timeout and test timeout?","acceptedAnswer":{"@type":"Answer","text":"An expect timeout means a specific assertion (like toHaveURL) polled repeatedly and gave up after its configured limit, default 5000ms, while a test timeout means the entire test exceeded its overall time budget. They require different fixes: an expect timeout issue is often solved with waitForResponse or a config change, while a test timeout points to a broader performance problem in the flow. Developers debugging Playwright CI failures can track these timeout distinctions through daily.dev's testing coverage."}},{"@type":"Question","name":"How can I tell if a failing Playwright test is a flaky timing issue versus a deterministic bug?","acceptedAnswer":{"@type":"Answer","text":"Check failure frequency across the last several CI runs: a test failing roughly 3 out of 10 times points to a flaky timing or infrastructure issue, while a test failing on every run indicates a deterministic bug in the code. Correlating failures with CI runner, region, or a specific commit further separates infrastructure problems from real regressions. Teams weighing how to triage flaky suites can follow ongoing testing practices on daily.dev."}}]}
```

