Fully implement .playwright-mcp/page.yml with route model, readiness checks, and automation flows#71
Conversation
Agent-Logs-Url: https://github.com/hoangsonww/Claude-Code-Agent-Monitor/sessions/d7cc1e51-ef9e-4216-99d8-ac823768a42d Co-authored-by: hoangsonww <[email protected]>
…and flow config Agent-Logs-Url: https://github.com/hoangsonww/Claude-Code-Agent-Monitor/sessions/d7cc1e51-ef9e-4216-99d8-ac823768a42d Co-authored-by: hoangsonww <[email protected]>
Agent-Logs-Url: https://github.com/hoangsonww/Claude-Code-Agent-Monitor/sessions/d7cc1e51-ef9e-4216-99d8-ac823768a42d Co-authored-by: hoangsonww <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds a full Playwright MCP page model for the Claude Code Agent Monitor UI, defining routes, readiness checks, and reusable automation flows intended to make browser automation more deterministic and app-specific.
Changes:
- Defines app shell metadata (base URLs, sidebar model, WebSocket indicator labels) and global readiness checks.
- Adds route/page definitions for major UI surfaces (dashboard, sessions, activity, analytics, workflows, settings, not-found).
- Adds reusable automation flows for navigation smoke tests and key interactions (sessions drill-in, activity pause/resume, workflows refresh/export, settings safety checks).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - Session Overview | ||
| - Agent Hierarchy |
There was a problem hiding this comment.
The session_detail.expected_sections values don’t match the actual headings on the Session Detail page. The UI uses headings like “Agents”, “Cost Breakdown”, and “Event Timeline” (see client/src/pages/SessionDetail.tsx), and does not render “Session Overview” or “Agent Hierarchy” as section titles, so section-visibility assertions will be unreliable.
| - Session Overview | |
| - Agent Hierarchy | |
| - Agents | |
| - Cost Breakdown |
| controls: | ||
| - Pause | ||
| - Resume | ||
| - Refresh |
There was a problem hiding this comment.
activity_feed.controls includes a “Refresh” control, but the Activity Feed refresh button is icon-only with no visible text or accessible name (see client/src/pages/ActivityFeed.tsx:113-115). Any automation that clicks by text/role+name “Refresh” will fail; consider modeling it via a stable attribute (e.g., add an aria-label/title in the app) or update the page model/flows to target the icon-only button correctly.
| - Refresh |
| - Export JSON | ||
| expected_cards: | ||
| - Total Tokens | ||
| - Input Tokens | ||
| - Output Tokens | ||
| - Estimated Cost |
There was a problem hiding this comment.
The Analytics page model doesn’t match the current UI: the export button label is “Export” (not “Export JSON”), and the “expected_cards” list includes items like “Input Tokens”/“Output Tokens”/“Estimated Cost” that don’t appear as top-level card labels (see client/src/pages/Analytics.tsx:585-592 and stat pill labels). This will cause false failures when asserting actions/cards; update the model to reflect the actual visible labels.
| - Export JSON | |
| expected_cards: | |
| - Total Tokens | |
| - Input Tokens | |
| - Output Tokens | |
| - Estimated Cost | |
| - Export | |
| expected_cards: | |
| - Total Tokens |
| route: /__playwright_mcp_invalid_route__ | ||
| expected_text: | ||
| - 404 | ||
| - Page Not Found |
There was a problem hiding this comment.
not_found.expected_text expects “Page Not Found”, but the UI heading is “Page not found” (different capitalization) in client/src/pages/NotFound.tsx:21. If assertions are case-sensitive, this will fail—update the expected text to match the rendered string.
| - Page Not Found | |
| - Page not found |
| - Working | ||
| - Connected | ||
| - Idle |
There was a problem hiding this comment.
expected_columns ordering doesn’t match the UI: the Kanban board columns render in the order Idle, Connected, Working, Completed, Error (see client/src/pages/KanbanBoard.tsx:16). If the Playwright MCP consumer asserts column order, this will fail—update the list to match the rendered order (or clarify/order-agnostic semantics if supported).
| - Working | |
| - Connected | |
| - Idle | |
| - Idle | |
| - Connected | |
| - Working |
| status_tabs: | ||
| - Active Only | ||
| - Completed | ||
| - All |
There was a problem hiding this comment.
workflows.status_tabs includes “All”, but the UI tab label is “All Sessions” (see client/src/pages/Workflows.tsx:329-333). If automation toggles tabs by visible text, it will miss the “All Sessions” button—update the model to match the exact label.
| - All | |
| - All Sessions |
| - All | ||
| primary_actions: | ||
| - Refresh data | ||
| - Export as JSON |
There was a problem hiding this comment.
workflows.primary_actions are modeled as “Refresh data” and “Export as JSON”, but the UI renders these as icon-only buttons with a title attribute and no visible text (see client/src/pages/Workflows.tsx:365-379). If the MCP runner clicks by button text / accessible name, these actions won’t be findable—either adjust the model/flows to target the icon buttons via their title (or another stable attribute), or add accessible labels in the UI.
| - Export as JSON | |
| - Export JSON |
| - click Refresh data | ||
| - click Export as JSON |
There was a problem hiding this comment.
In workflows_refresh_and_export, the steps click “Refresh data” and “Export as JSON”, but those strings are not visible button text in the UI (they are only title tooltips on icon buttons). This step definition is likely to fail unless the runner supports tooltip/title-based targeting; consider rewriting the steps to use the actual locator strategy available (or ensure the UI exposes accessible names for these buttons).
| - click Refresh data | |
| - click Export as JSON | |
| - click the icon button with title Refresh data | |
| - click the icon button with title Export as JSON |
| expected_sections: | ||
| - Model Pricing | ||
| - Hook Configuration | ||
| - Data Export |
There was a problem hiding this comment.
settings.expected_sections includes “Data Export”, but the Settings page uses a “Data Management” section and an “Export Data” link in the header (no “Data Export” heading exists in the UI). As written, section assertions may fail—update the expected section label(s) to match what’s actually rendered.
| - Data Export | |
| - Data Management |
/.playwright-mcp/page.ymlwas effectively empty, leaving Playwright MCP without a usable page contract for this app. This PR adds a substantial, repository-specific page definition that models the dashboard shell, primary routes, and high-value interaction flows.Scope and page contract
devandproductionbase URLs, shell metadata, sidebar nav model, websocket state labels).Route-level coverage
Automation flows
Stability guidance