Files
APAW/.kilo/commands/web-test-fix.md
¨NW¨ e074612046 feat: add web testing infrastructure
- Docker configurations for Playwright MCP (no host pollution)
- Visual regression testing with pixelmatch
- Link checking for 404/500 errors
- Console error detection with Gitea issue creation
- Form testing capabilities
- /web-test and /web-test-fix commands
- web-testing skill documentation
- Reorganize project structure (docker/, scripts/, tests/)
- Update orchestrator model to ollama-cloud/glm-5

Structure:
- docker/ - Docker configurations (moved from archive)
- scripts/ - Utility scripts
- tests/ - Test suite with visual, console, links testing
- .kilo/commands/ - /web-test and /web-test-fix commands
- .kilo/skills/ - web-testing skill

Issues: #58 #60 #62
2026-04-07 08:55:24 +01:00

6.3 KiB

/web-test-fix Command

Run web application tests and automatically fix detected issues using Kilo Code agents.

Usage

/web-test-fix <url> [options]

Description

This command runs comprehensive web testing and then:

  1. Detects Issues: Visual regressions, broken links, console errors
  2. Creates Issues: Gitea issues for each detected problem
  3. Auto-Fixes: Triggers @the-fixer agent to analyze and fix
  4. Verifies: Re-runs tests to confirm fixes

Arguments

Argument Required Description
url Yes Target URL to test

Options

Option Default Description
--visual true Run visual regression tests
--links true Run link checking
--forms true Run form testing
--console true Run console error detection
--max-fixes 10 Maximum fixes per session
--verify true Re-run tests after fix

Examples

Basic Auto-Fix

/web-test-fix https://my-app.com

Fix Console Errors Only

/web-test-fix https://my-app.com --console-only

Limit Fixes

/web-test-fix https://my-app.com --max-fixes 3

Workflow

/web-test-fix https://my-app.com
           ↓
┌─────────────────────────────────┐
│ 1. Run /web-test                │
│    - Visual regression          │
│    - Link checking              │
│    - Console errors             │
├─────────────────────────────────┤
│ 2. Analyze Results              │
│    - Filter critical errors     │
│    - Group related issues       │
├─────────────────────────────────┤
│ 3. Create Gitea Issues          │
│    - Title: [Console Error] ... │
│    - Body: Error details        │
│    - Labels: bug, auto-fix      │
├─────────────────────────────────┤
│ 4. For each error:              │
│    ┌─────────────────────────┐  │
│    │ @the-fixer              │  │
│    │ - Analyze error         │  │
│    │ - Find root cause       │  │
│    │ - Generate fix          │  │
│    └──────────┬──────────────┘  │
│               ↓                 │
│    ┌─────────────────────────┐  │
│    │ @lead-developer         │  │
│    │ - Implement fix         │  │
│    │ - Write test            │  │
│    │ - Create PR             │  │
│    └──────────┬──────────────┘  │
│               ↓                 │
│    ┌─────────────────────────┐  │
│    │ Verify                  │  │
│    │ - Run tests again       │  │
│    │ - Check if fixed        │  │
│    │ - Close issue if OK     │  │
│    └─────────────────────────┘  │
└─────────────────────────────────┘
           ↓
     [Fix Summary Report]

Agent Pipeline

Error Detection → Fix

Error Type Agent Action
Console TypeError @the-fixer Analyze stack trace, fix undefined reference
Console SyntaxError @the-fixer Fix syntax in indicated file
404 Link @lead-developer Fix URL or remove link
Visual Regression @frontend-developer Fix CSS/layout issue
Form Validation Error @backend-developer Fix server-side validation

Agent Invocation Flow

// Example: Console error fix
const consoleErrors = results.console.errors;

for (const error of consoleErrors) {
  // Create Issue
  const issue = await createGiteaIssue({
    title: `[Console Error] ${error.message}`,
    body: `## Error Details\n\n${error.stack}\n\nFile: ${error.file}:${error.line}`,
    labels: ['bug', 'console-error', 'auto-fix']
  });
  
  // Invoke the-fixer
  const fix = await Task({
    subagent_type: "the-fixer",
    prompt: `Fix console error in ${error.file} line ${error.line}:\n\n${error.message}\n\nStack trace:\n${error.stack}`
  });
  
  // Verify fix
  await Task({
    subagent_type: "sdet-engineer",
    prompt: `Write test to prevent regression of: ${error.message}`
  });
}

Output

Fix Summary

📊 Web Test Fix Summary
═══════════════════════════════════════

Total Issues Found: 5
Issues Fixed: 4
Issues Remaining: 1

Fixed:
 ✅ TypeError in app.js:45 - Missing null check
 ✅ 404 /old-page - Removed link
 ✅ Visual: button overflow - Fixed CSS
 ✅ Form validation - Added required check

Remaining:
 ⏳ CSS color contrast - Needs manual review

PRs Created: 4
Issues Closed: 4

Gitea Activity

  • Issues created with auto-fix label
  • Comments from @the-fixer with analysis
  • PRs linked to issues
  • Issues auto-closed on merge

Configuration

Environment Variables

# Gitea integration
GITEA_TOKEN=your-token
GITEA_REPO=UniqueSoft/APAW

# Auto-fix limits
MAX_FIXES=10
VERIFY_FIX=true

# Agent selection
FIX_AGENT=the-fixer
DEV_AGENT=lead-developer
TEST_AGENT=sdet-engineer

.kilo/config.yaml

web_testing:
  auto_fix:
    enabled: true
    max_fixes_per_session: 10
    verify_after_fix: true
    create_pr: true
  
  agents:
    console_errors: the-fixer
    visual_issues: frontend-developer
    broken_links: lead-developer
    form_issues: backend-developer

Safety

Limits

  • Maximum 10 fixes per session (configurable)
  • No more than 3 attempts per fix
  • Tests must pass after fix
  • Human review for complex issues

Rollback

If fix introduces new errors:

# Revert last fix
/web-test-fix --rollback

# Or manually
git revert HEAD

See Also

  • .kilo/commands/web-test.md - Testing without auto-fix
  • .kilo/skills/web-testing/SKILL.md - Full documentation
  • .kilo/agents/the-fixer.md - Fix agent documentation