Playwright Tester Agent
A Copilot custom agent that explores a website with the Playwright MCP server, then writes, runs and iterates on TypeScript Playwright tests until they pass.
Overview
Playwright Tester Agent ("Playwright Tester Mode") is a .agent.md custom agent
for GitHub Copilot that pairs with the Playwright MCP
server to explore a real website before writing a single line of test code.
How it works
The agent's core responsibilities, defined directly in its instructions:
- Website exploration: navigate the site with the Playwright MCP, take a page snapshot, and identify key user flows like a real user would, before generating any code.
- Test improvements: when asked to improve existing tests, it navigates back to the live page and uses the snapshot to find the correct locators.
- Test generation: writes well-structured, maintainable Playwright tests in TypeScript based on what it actually explored (not guessed selectors).
- Test execution & refinement: runs the generated tests, diagnoses failures, and iterates until they pass reliably.
- Documentation: summarizes what was tested and how the tests are structured.
It's scoped to testing-related tools (findTestFiles, runTests, testFailure,
playwright, runCommands...) so it stays focused on the test-writing loop instead
of general-purpose coding.
Examples
"Explore the checkout flow on staging and write Playwright tests covering the
happy path and the empty-cart case."
"These login tests are flaky, go re-check the page and fix the locators."
Installation
You need VS Code with the GitHub Copilot extension, plus the Playwright MCP server configured in your MCP client.
- Set up the Playwright MCP server first if you haven't already (see its own entry for install steps).
- Create the agents folder and download the file into your repo:
mkdir -p .github/agents curl -o .github/agents/playwright-tester.agent.md \ https://raw.githubusercontent.com/github/awesome-copilot/main/agents/playwright-tester.agent.md - Reload VS Code, or open a new Copilot Chat; custom agents under
.github/agents/are picked up automatically. - Pick this agent from the mode picker in Copilot Chat and point it at a page or flow to confirm it explores the site before writing tests.
Works best paired with the Playwright MCP server, which lets the agent see the real DOM rather than infer selectors from the source code alone.
Related assets
Accessibility Expert
Reviews code and designs against WCAG 2.1/2.2, covering semantics, keyboard and focus behavior, forms, media and dynamic SPA updates, and ships framework-specific examples plus a CI setup for automated checks.
Address Comments Agent
Works through pull request review comments one at a time: applies the minimal fix for each, pushes back on comments that don't make sense, adds test coverage, and commits with a descriptive message before moving to the next comment.
ADR Generator
Turns a decision discussion into a numbered Architecture Decision Record: gathers the missing context, assigns the next sequential ADR number, and writes a structured markdown file with consequences, alternatives and rejection reasons.