Skip to content

Fully implement .playwright-mcp/page.yml with route model, readiness checks, and automation flows#71

Open
Copilot wants to merge 3 commits intofeat/create-playwright-mcp-configfrom
copilot/implement-page-yml-in-playwright-mcp
Open

Fully implement .playwright-mcp/page.yml with route model, readiness checks, and automation flows#71
Copilot wants to merge 3 commits intofeat/create-playwright-mcp-configfrom
copilot/implement-page-yml-in-playwright-mcp

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 14, 2026

/.playwright-mcp/page.yml was 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

    • Added a complete v1 config for the Claude Code Agent Monitor app (dev and production base URLs, shell metadata, sidebar nav model, websocket state labels).
    • Defined global readiness checks to establish deterministic page startup conditions.
  • Route-level coverage

    • Added explicit definitions for all major UI routes: Dashboard, Agent Board, Sessions, Session Detail, Activity Feed, Analytics, Workflows, Settings, and Not Found.
    • Captured route-specific expectations (titles, key sections, controls, empty states, filters, and critical actions).
  • Automation flows

    • Added reusable flows for:
      • full sidebar smoke navigation,
      • sessions search + drill-in,
      • activity pause/resume behavior,
      • workflows refresh/export interactions,
      • settings safety/destructive-action confirmation visibility.
  • Stability guidance

    • Added locator/wait strategy guidance (role/name-first selectors, content-based assertions, network-idle + settle timings) to reduce brittle browser automation.
pages:
  sessions:
    route: /sessions
    title_text: Sessions
    search_placeholder: Search sessions...
    filters: [All, Active, Completed, Error, Abandoned]
    row_navigation: /sessions/:id

flows:
  sessions_search_and_open:
    steps:
      - open /sessions
      - fill Search sessions... with session
      - toggle filters Active then All
      - if a table row exists, click first row and assert route matches /sessions/:id

@hoangsonww hoangsonww marked this pull request as ready for review April 14, 2026 00:52
Copilot AI review requested due to automatic review settings April 14, 2026 00:52
@hoangsonww hoangsonww added bug Something isn't working documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Apr 14, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +84 to +85
- Session Overview
- Agent Hierarchy
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- Session Overview
- Agent Hierarchy
- Agents
- Cost Breakdown

Copilot uses AI. Check for mistakes.
controls:
- Pause
- Resume
- Refresh
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- Refresh

Copilot uses AI. Check for mistakes.
Comment on lines +108 to +113
- Export JSON
expected_cards:
- Total Tokens
- Input Tokens
- Output Tokens
- Estimated Cost
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- Export JSON
expected_cards:
- Total Tokens
- Input Tokens
- Output Tokens
- Estimated Cost
- Export
expected_cards:
- Total Tokens

Copilot uses AI. Check for mistakes.
route: /__playwright_mcp_invalid_route__
expected_text:
- 404
- Page Not Found
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- Page Not Found
- Page not found

Copilot uses AI. Check for mistakes.
Comment on lines +61 to +63
- Working
- Connected
- Idle
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
- Working
- Connected
- Idle
- Idle
- Connected
- Working

Copilot uses AI. Check for mistakes.
status_tabs:
- Active Only
- Completed
- All
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- All
- All Sessions

Copilot uses AI. Check for mistakes.
- All
primary_actions:
- Refresh data
- Export as JSON
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- Export as JSON
- Export JSON

Copilot uses AI. Check for mistakes.
Comment on lines +198 to +199
- click Refresh data
- click Export as JSON
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
- click Refresh data
- click Export as JSON
- click the icon button with title Refresh data
- click the icon button with title Export as JSON

Copilot uses AI. Check for mistakes.
expected_sections:
- Model Pricing
- Hook Configuration
- Data Export
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- Data Export
- Data Management

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Projects

Development

Successfully merging this pull request may close these issues.

3 participants