Skip to content

feat: Add MCP browser testing patterns reference #39

Closed

Description

@admarble

Problem

Browser testing with Chrome DevTools MCP works well but requires knowing the tool patterns. New users or sessions without prior context have to rediscover:

  • How to fill forms and submit
  • How to test modals
  • How to interact with grids
  • When to use snapshot vs screenshot
  • How to wait for async content

Proposed Solution

Create test/references/browser-testing-patterns.md:

# Browser Testing Patterns

Common patterns for Chrome DevTools MCP browser automation.

## Form Testing
  1. take_snapshot - identify form fields
  2. fill_form([{uid: "email-input", value: "[email protected]"}, ...])
  3. click({uid: "submit-button"})
  4. wait_for({text: "Success"}) or take_snapshot to verify

## Modal Testing
  1. click({uid: "open-modal-button"})
  2. take_snapshot - verify modal content
  3. fill if needed
  4. click({uid: "confirm-button"})
  5. take_snapshot - verify modal closed

## Grid/Table Testing (AG Grid, etc.)
  1. take_snapshot - find cell uid
  2. click({uid: "cell-uid", dblClick: true}) - enter edit mode
  3. fill({uid: "cell-input", value: "new value"})
  4. press_key({key: "Enter"}) - confirm edit
  5. take_snapshot - verify change

## Multi-Select Testing
  1. click({uid: "row-1-checkbox"})
  2. click({uid: "row-3-checkbox"})
  3. click({uid: "bulk-action-button"})
  4. take_snapshot - verify action applied

## Async Content
  1. click action that triggers async load
  2. wait_for({text: "Loading..."}) - optional
  3. wait_for({text: "Expected content"})
  4. take_snapshot to verify

## Screenshots vs Snapshots
- **take_snapshot**: Text-based, faster, good for finding elements
- **take_screenshot**: Visual, good for layout verification, evidence

## Error Handling
- Dialog appears? Use handle_dialog({action: "accept"})
- Element not found? take_snapshot to see current state
- Timeout? Increase timeout or check if content actually loads

Acceptance Criteria

  • Create test/references/browser-testing-patterns.md
  • Include patterns for: forms, modals, grids, multi-select, async
  • Add troubleshooting section
  • Link from /test skill

Related

Related to #15 (MCP documentation) but focused on usage patterns rather than installation/dependencies.

Priority

Medium - improves browser testing efficiency

Activity

  1. admarble commented on Jan 9, 2026

    @admarble
    ContributorAuthor

    Planning Review - Issue #39

    Acceptance Criteria with Verification

    AC Description Verification
    AC-1 Create test/references/browser-testing-patterns.md File exists, valid markdown
    AC-2 Include patterns: forms, modals, grids, multi-select, async Each section has code examples
    AC-3 Add troubleshooting section Common issues documented with solutions
    AC-4 Link from /test skill Reference added to SKILL.md

    Implementation Plan

    Phase 1: Setup

    1. Create test/references/ directory
    2. Create browser-testing-patterns.md with header

    Phase 2: Core Patterns
    3. Form Testing pattern (snapshot → fill → click → verify)
    4. Modal Testing pattern (open → verify → interact → close)
    5. Grid/Table Testing pattern (AG Grid cell editing)
    6. Multi-Select Testing pattern (checkboxes, bulk actions)
    7. Async Content pattern (wait_for usage)

    Phase 3: Reference Docs
    8. Screenshots vs Snapshots comparison
    9. Troubleshooting section (element not found, timeouts, dialogs)

    Phase 4: Integration
    10. Update .claude/skills/test/SKILL.md with reference link

    Assumptions

    • test/references/ is the correct location (per issue spec)
    • Chrome DevTools MCP function signatures match documented patterns

    Recommended Workflow

    Phases: exec → qa
    Reasoning: Documentation-only task with clear AC. No code logic to test.


    Plan generated by /spec

  2. added
    documentation
    on Jan 9, 2026
  3. admarble commented on Jan 9, 2026

    @admarble
    ContributorAuthor

    Planning Review - Issue #39 (Enhanced)

    Acceptance Criteria with Verification

    AC Description Verification Test Scenario
    AC-1 Create browser-testing-patterns.md File exists, valid markdown ls .claude/skills/test/references/browser-testing-patterns.md
    AC-2 Include patterns: forms, modals, grids, multi-select, async Each section has code examples with MCP functions Review each section for step-by-step examples
    AC-3 Add troubleshooting section Common issues documented with solutions Verify coverage: element not found, timeouts, dialogs
    AC-4 Link from /test skill Reference added to SKILL.md Grep for reference link in SKILL.md

    Implementation Plan

    Phase 1: Directory Setup

    1. Create .claude/skills/test/references/ directory

    Phase 2: Core Document Creation
    2. Create browser-testing-patterns.md with header
    3. Form Testing pattern (snapshot → fill → submit → verify)
    4. Modal Testing pattern (open → verify → interact → close)
    5. Grid/Table Testing pattern (AG Grid cell editing)
    6. Multi-Select Testing pattern (checkboxes, bulk actions)
    7. Async Content pattern (wait_for usage)

    Phase 3: Reference Documentation
    8. Screenshots vs Snapshots comparison
    9. Troubleshooting section

    Phase 4: Integration
    10. Update .claude/skills/test/SKILL.md with reference link

    Clarification

    File location: Issue specifies test/references/ but existing skill references use .claude/skills/<skill>/references/.

    Recommendation: Use .claude/skills/test/references/browser-testing-patterns.md to match the established pattern (qa, spec, security-review skills all use this structure).

    Assumptions to Validate

    • Correct location: .claude/skills/test/references/ (per existing pattern)
    • Chrome DevTools MCP function signatures match documented patterns

    Recommended Workflow

    Phases: exec → qa
    Reasoning: Documentation-only task with clear AC. No code logic to test.

    Conflict Risk

    In-flight work analyzed: Issue #38 modifies different files (exec skill, framework-gotchas). No conflict with #39.


    Plan generated by /spec - Ready for implementation

  4. added a commit that references this issue on Jan 9, 2026
  5. admarble commented on Jan 9, 2026

    @admarble
    ContributorAuthor

    Implementation Progress Update

    AC Coverage

    AC Description Status
    AC-1 Create browser-testing-patterns.md ✅ Satisfied
    AC-2 Include patterns: forms, modals, grids, multi-select, async ✅ Satisfied
    AC-3 Add troubleshooting section ✅ Satisfied
    AC-4 Link from /test skill ✅ Satisfied

    Files Changed

    • .claude/skills/test/references/browser-testing-patterns.md (new - 422 lines)
    • .claude/skills/test/SKILL.md (added reference link)

    Document Structure

    The browser testing patterns reference includes:

    • Quick Reference - Table of common MCP functions
    • Form Testing - Standard pattern with variations for multi-step, dropdowns, checkboxes
    • Modal Testing - Including nested modals and escape key handling
    • Grid/Table Testing - AG Grid patterns with row selection, sorting, pagination
    • Multi-Select Testing - Bulk selection and actions
    • Async Content - Loading states, debounce, infinite scroll
    • Screenshots vs Snapshots - Comparison table and usage guidance
    • Troubleshooting - Element not found, timeouts, dialogs, form issues, state updates
    • MCP Functions Reference - Quick lookup table

    Checks Run

    • npm test - ✅ 156 tests passed
    • npm run build - ✅ Passed

    PR Status

    Created: #44


    Implementation by /exec - Ready for /qa

  6. admarble commented on Jan 10, 2026

    @admarble
    ContributorAuthor

    Spec Review - Issue #39 (Final)

    Acceptance Criteria with Verification

    AC Description Verification Method Status
    AC-1 Create browser-testing-patterns.md ls .claude/skills/test/references/browser-testing-patterns.md ✅ Complete
    AC-2 Include patterns: forms, modals, grids, multi-select, async Review each section for code examples ✅ Complete
    AC-3 Add troubleshooting section Grep for troubleshooting headings ✅ Complete
    AC-4 Link from /test skill Grep SKILL.md for reference link ✅ Complete

    Implementation Summary

    Files Created/Modified:

    • .claude/skills/test/references/browser-testing-patterns.md (423 lines)
    • .claude/skills/test/SKILL.md (reference link added)

    Document Structure:

    1. Quick Reference table
    2. Form Testing (with variations for multi-step, dropdowns, checkboxes)
    3. Modal Testing (including nested modals, escape key)
    4. Grid/Table Testing (AG Grid patterns, row selection, sorting, pagination)
    5. Multi-Select Testing (bulk selection and actions)
    6. Async Content (loading states, debounce, infinite scroll)
    7. Screenshots vs Snapshots (comparison table)
    8. Troubleshooting (5 common issues with solutions)
    9. MCP Functions Reference table

    PR Status

    PR #44: #44

    • All CI checks passing ✅
    • Ready for review and merge

    Recommended Next Steps

    1. Run /qa 39 for code review against AC
    2. Approve and merge PR feat(#39): Add MCP browser testing patterns reference #44
    3. Close this issue

    Conflict Analysis

    No conflicts with other in-flight work (issues #3, #6, #11, #38, #41, #42).


    Spec verified by /spec

  7. added a commit that references this issue on Jan 10, 2026
  8. added 2 commits that reference this issue on Jul 15, 2026
  9. added 3 commits that reference this issue on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions