一键导入
testing-with-playwright
Provides Playwright MCP testing workflow for the web application. Use when testing UI changes, verifying chat functionality, debugging frontend issues, or validating state transitions in the browser.
菜单
Provides Playwright MCP testing workflow for the web application. Use when testing UI changes, verifying chat functionality, debugging frontend issues, or validating state transitions in the browser.
Provides deployment commands and troubleshooting for Azure Container Apps. Use when running azd commands, deploying containers, debugging deployment failures, or updating infrastructure in this repository.
Provides research patterns for Azure AI Foundry Agent Service SDK. Use when implementing agent features, looking up SDK methods, finding code samples, or troubleshooting Azure.AI.Projects API usage.
Provides authentication troubleshooting for MSAL, JWT, and Entra ID. Use when debugging 401 errors, token issues, MSAL configuration problems, or credential failures in this repository.
Provides step-by-step procedures for validating UI features - theme toggle, new chat, cancel stream, markdown rendering, and token usage info.
Provides C# and ASP.NET Core coding standards for this repository. Use when writing or modifying C# code, implementing API endpoints, configuring middleware, or working with authentication in the backend. Use when writing or modifying C# code, implementing API endpoints,
Provides TypeScript and React coding standards for this repository. Use when writing or modifying TypeScript code, creating React components, implementing MSAL authentication, or working with the frontend.
| name | testing-with-playwright |
| description | Provides Playwright MCP testing workflow for the web application. Use when testing UI changes, verifying chat functionality, debugging frontend issues, or validating state transitions in the browser. |
CRITICAL: Always test changes before completion.
Screenshot operations blow up context fast (~2000-5000 tokens each). Delegate to subagent for:
runSubagent(
agentName: "WebAppAgent",
prompt: "TESTING task with Playwright MCP.
**Servers**: Frontend at localhost:5173, Backend at localhost:8080
**Test Scenario**: [describe what to verify]
**Steps**:
1. Navigate to http://localhost:5173
2. [specific actions to perform]
**Check in priority order** (stop when answer found):
1. Browser console logs - look for errors, state transitions (🔄)
2. Network requests - verify API calls and status codes
3. Accessibility snapshot - check element presence
4. Screenshot - ONLY if visual verification essential
**Return**:
- Pass/Fail result
- Specific evidence (error messages, status codes, element presence)
- Console action log if relevant (🔄 ACTION_TYPE entries)
Do NOT include raw screenshots or full accessibility dumps.",
description: "Test: [what being verified]"
)
| Delegate to Subagent | Keep Inline |
|---|---|
| Multi-page flows | Single console check |
| Visual verification needed | Network status check |
| Accessibility audit | Element presence (single) |
| Error reproduction | Quick state verification |
| Screenshot required | Reading console logs |
Key insight: Browser console shows React state changes (🔄 ACTION_TYPE), errors, and warnings. VS Code terminals show server logs and compilation output.
Start servers in VS Code terminals (preferred - logs visible to AI agent):
# Run these VS Code tasks:
# - "Backend: ASP.NET Core API" (dotnet watch, port 8080)
# - "Frontend: React Vite" (npm run dev, port 5173)
# Or use compound task: "Start Dev (VS Code Terminals)"
Then test with Playwright MCP:
Check server logs:
Each state change prints:
🔄 [HH:MM:SS] ACTION_TYPE
Action: { … }
Changes: { field: before → after }
| Scenario | What to Verify |
|---|---|
| Initial load | Auth redirect, agent metadata loads |
| Send message | User message appears, streaming starts |
| Streaming | Text chunks append, no flicker |
| Annotations | Citations render with links |
| Cancel stream | Input re-enabled, status → idle |
| Error recovery | Retry button works, error clears |
| Endpoint | Success | Failure |
|---|---|---|
POST /api/chat/stream | 200 + SSE events | 401 (auth), 400 (validation) |
GET /api/agent/info | 200 + JSON metadata | 500 (agent not found) |
Use available Playwright browser automation tools in order of preference: