Files
ComfyUI_frontend/tools/test-recorder/src/checks/python.ts
bymyself 19c6eb5c93 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-04-14 10:59:16 -07:00

40 lines
1.2 KiB
TypeScript

import { execSync } from 'node:child_process'
import { detectPlatform } from './platform'
import { pass, fail, info } from '../ui/logger'
import type { CheckResult } from './types'
export async function checkPython(): Promise<CheckResult> {
for (const cmd of ['python3', 'python']) {
try {
const version = execSync(`${cmd} --version`, { encoding: 'utf-8' }).trim()
pass('Python', version)
return { name: 'Python', ok: true, version }
} catch {
continue
}
}
fail('Python 3', 'not installed')
const platform = detectPlatform()
const instructions =
platform === 'macos'
? [
'Python 3 is needed for the ComfyUI backend.',
'',
' brew install python3',
'',
'Or download from: https://www.python.org/downloads/'
]
: platform === 'windows'
? [
'Download Python from: https://www.python.org/downloads/',
'Check "Add Python to PATH" during install.'
]
: [
' sudo apt install python3 # Debian/Ubuntu',
' sudo dnf install python3 # Fedora'
]
info(instructions)
return { name: 'Python 3', ok: false, installInstructions: instructions }
}