Files
ComfyUI_frontend/scripts/update-playwright-agents.sh
bymyself 054e4cff39 feat: add Playwright test agents system — interactive recorder CLI, AI agents, and codegen transform
Three integrated systems for AI-assisted browser test creation:

1. comfy-test CLI (tools/test-recorder/)
   - Interactive 7-step recording flow for QA testers and non-developers
   - Environment checks with platform-specific install guidance
   - Codegen-to-convention transform engine
   - PR creation via gh CLI or manual GitHub web UI instructions
   - Commands: record, transform, check, list

2. Playwright AI agents (.claude/agents/)
   - Planner, generator, and healer agents patched with ComfyUI context
   - Regeneration scripts for Playwright updates (scripts/update-playwright-agents.sh)
   - MCP server config (.mcp.json) for agent browser interaction
   - Seed test and specs directory for agent-generated tests

3. Codegen transform skill (.claude/skills/codegen-transform/)
   - Transform rules: @playwright/test → comfyPageFixture, page → comfyPage,
     remove goto, canvas locators, waitForTimeout → nextFrame
   - Structural transforms: wrap in describe with tags, add afterEach cleanup
   - Fixture API reference and before/after examples
2026-03-28 17:44:17 -07:00

29 lines
790 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Navigate to repo root (script location relative)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
echo "🎭 Updating Playwright agent definitions..."
echo ""
# Step 1: Regenerate base agent files
echo "Step 1: Running init-agents..."
cd "$REPO_ROOT"
pnpm exec playwright init-agents --loop=claude
echo ""
echo "Step 2: Applying ComfyUI patches..."
node "$SCRIPT_DIR/patch-playwright-agents.js"
echo ""
echo "✅ Agent files updated and patched."
echo ""
echo "Files modified:"
echo " .claude/agents/playwright-test-planner.md"
echo " .claude/agents/playwright-test-generator.md"
echo " .claude/agents/playwright-test-healer.md"
echo ""
echo "Review changes with: git diff .claude/agents/"