WhoBuilt

Beyond Code Coverage: Functionality Testing with Playwright MCP

May 16, 2026· 20 min· 9.4K views·Watch on YouTube

Speaker

Senior developer advocate Marlene Mhangami, working at Microsoft and GitHub in the Core AI group, explains how to test application behavior with Playwright and AI coding agents.

More code calls for cleaner practices

Mhangami cites GitHub's 2025 total of about one billion commits and a COO estimate of 275 million commits per week in 2026. She asks whether the increase in code means greater developer productivity. A Stanford study of 120,000 developers, presented at AI Engineer the previous year, suggested that clean codebases amplify AI gains, while unchecked AI use can increase rework and code entropy.

Use TDD to focus on behavior

Mhangami describes red-green TDD: write a failing test for a feature, make it pass, then refactor for code quality. She notes that tests tied to implementation details can break when methods are renamed, even if functionality still works. Tests of outcomes, such as a final price, or stable contracts like an API, are more resilient to refactoring.

Test functionality with Playwright

AI-generated unit tests can pass and show coverage without validating what the system actually does. Mhangami introduces Playwright, an open-source Microsoft framework for browser-based end-to-end tests that simulate user interactions. Its supported languages include Python, TypeScript, and C#, and tests can run with a visible browser or in headless mode.

Pair coding agents with behavioral tests

Mhangami recommends asking AI agents to generate Playwright tests for each feature, then generate code to make those tests pass, leaving time for human review and refactoring. In her Tailspin Toys demo, Copilot helps develop search and category and price filters, with Playwright checking searches for Furby and Simon and testing the filters. She says Playwright agents include planner, generator, and healer instructions, and recommends saving test screenshots with pull requests, committing before asking an agent to fix tests, and writing one test per feature.

Takeaways

  • Use feature requests as the trigger for behavioral tests, not just new methods.
  • Test visible outcomes and stable contracts so refactors do not break tests unnecessarily.
  • Have coding agents write Playwright tests before implementation, then review and refactor the generated code.
  • Keep one test per feature and commit before asking an agent to make test fixes.
  • For applications with substantial state management, consider Playwright agents or testing APIs directly.

Mentioned in this talk

Search inside this talk

What was claimed 10

Related talks