← back

Beyond Code Coverage: Functionality Testing with Playwright MCP — Marlene Mhangami, Microsoft

9.2K views · May 16, 2026 · 19:45 min · Watch on YouTube ↗
Takeaway

Use AI to accelerate behavioral testing and implementation while reserving deliberate effort for refactoring and code quality.

Summary

  • Rapid growth in AI-authored code does not guarantee productivity when poor quality creates additional rework.
  • Red-green-refactor development separates establishing desired behavior, making tests pass, and improving implementation quality.
  • Implementation-coupled and self-affirming generated tests can pass without verifying the user-visible behavior that matters.
  • Playwright automates browser interactions for functional testing and can connect to coding agents through MCP, a CLI, or Playwright agents.
playwrightbehavioral-testingtdd
Original description
When an LLM writes your tests, it tends to write tests that confirm what the code does rather than tests that verify what the user experiences. Your test suite goes green. The app still breaks in ways none of those tests would catch.

Marlene Mhangami from Microsoft makes the case for flipping the order: get the agent to write failing Playwright tests against the expected behavior first, then generate code to pass them. The demo runs this live with GitHub Copilot and the Playwright MCP server on a toy store search feature, with the browser open so you can watch the agent click through filters and validate results in real time.

Speaker info:
https://x.com/marlene_zw
  / marlenemhangami  
https://github.com/marlenemhangami

Timestamps:
0:00 Introduction to GitHub Octoverse stats and 2025/2026 growth
2:13 Does AI actually increase developer productivity?
3:52 Importance of maintaining a clean codebase
4:36 Test-Driven Development (TDD) and the Red-Green-Refactor cycle
6:07 Common criticisms of TDD and unit testing
7:43 The problem with AI-generated self-affirming tests
8:09 Introduction to Playwright for functional testing
9:18 Integrating AI agents with Playwright for faster TDD
10:54 Live Demo: Adding search and filter features to a toy store app
12:25 Using GitHub Copilot CLI and Work IQ for feature requests
13:50 Generating and running Playwright tests live
16:10 Best practices for using AI with Playwright
17:30 Q&A: Handling state management and testing across different screen sizes