Playwright Tester Mode — GitHub Copilot subagent for Playwright tests
A GitHub Copilot subagent that walks the site through Playwright MCP first, then writes and runs TypeScript tests.
.github/agents/playwright-tester.agent.mdWhat Playwright Tester Mode does
Playwright Tester Mode sets the order of work for browser testing. The agent opens the site through Playwright MCP, takes a page snapshot and maps the key user flows. No code is written before that step, so locators come from the real markup instead of a guess.
After exploring, it generates TypeScript tests, runs them, diagnoses failures and iterates until the run is stable. Asked to improve existing tests, it navigates to the URL, reads the snapshot and fixes locators; a running dev server may be needed first. It closes with a short summary of what the tests cover and how the generated code is structured.
The agent carries tools such as runTests, testFailure, findTestFiles and playwright, and runs on Claude. The file goes to .github/agents/playwright-tester.agent.md, so without Playwright MCP and a working project setup the agent stalls at the very first navigation step.
What it helps with
- map key user flows before writing any tests
- pick locators from a real page snapshot
- generate TypeScript tests from scratch
- diagnose failing runs and make tests stable
- summarise test coverage and file structure
Example prompts for the agent
- Explore the site with Playwright MCP and write TypeScript tests for login
- Improve the existing tests: open the checkout page and fix the locators
- Run the tests, diagnose the failures and fix them
How to install Playwright Tester Mode
Manually: put the files in place
.github/agents/playwright-tester.agent.mdManually: put the files in place
.claude/agents/playwright-tester.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention. Copilot names tools its own way in the tools field: remove it or rewrite it for Claude Code
Manually: put the files in place
.codex/agents/playwright-tester.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/playwright-tester.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about Playwright Tester Mode
How do I install Playwright Tester Mode in GitHub Copilot?
Place the subagent file at .github/agents/playwright-tester.agent.md inside your project repository.
What does Playwright Tester Mode do?
It opens the site through Playwright MCP, maps the key flows, then writes TypeScript tests, runs them and refines the code until the run is stable.
What does the subagent need to work?
Playwright MCP for navigation and page snapshots. A running dev server may be required to verify the tests.
Source text
playwright-tester.agent.md · MIT
--- description: "Testing mode for Playwright tests" name: "Playwright Tester Mode" tools: ["changes", "codebase", "edit/editFiles", "fetch", "findTestFiles", "problems", "runCommands", "runTasks", "runTests", "search", "searchResults", "terminalLastCommand", "terminalSelection", "testFailure", "playwright"] model: Claude Sonnet 4 --- ## Core Responsibilities 1. **Website Exploration**: Use the Playwright MCP to navigate to the website, take a page snapshot and analyze the key functionalities. Do not generate any code until you have explored the website and identified the key user flows by navigating to the site like a user would. 2. **Test Improvements**: When asked to improve tests use the Playwright MCP to navigate to the URL and view the page snapshot. Use the snapshot to identify the correct locators for the tests. You may need to run the development server first. 3. **Test Generation**: Once you have finished exploring the site, start writing well-structured and maintainable Playwright tests using TypeScript based on what you have explored. 4. **Test Execution & Refinement**: Run the generated tests, diagnose any failures, and iterate on the code until all tests pass reliably. 5. **Documentation**: Provide clear summaries of the functionalities tested and the structure of the generated tests.
© github · MIT · github/awesome-copilot