# How to use Claude to write Playwright tests

Claude Code explored web app features with Playwright MCP, documented workflows, and wrote and debugged browser tests, with human corrections for more complex scenarios.

Agent: Claude (via Claude Code)
Tools: Claude Code, Playwright, Playwright MCP, Markdown task files
Category: Software & DevOps
Date: 2025-08-09

Outcome: The author calls the work highly effective and estimates days saved, while noting imperfect accuracy and corrections for more complex features.

## Steps

1. Explain user journeys and provide a development-server path.
2. Explore each feature through Playwright MCP and document execution steps.
3. Write Playwright tests and add data-testid selectors where needed.
4. Run the tests and debug errors using Playwright MCP.
5. Supply context and code corrections for complex scenarios.

Human oversight: The author defined the process and user journeys, then supplied additional context and code corrections for complex features.

Source: [sickcodebruh on Hacker News](https://news.ycombinator.com/item?id=44846096)

Canonical URL: https://agentsinuse.com/use-cases/claude-to-write-playwright-tests/
