com um clique
web-test-cleanup
// Clean up test sessions - kill browsers, stop dev servers, free ports, and optionally remove test data. Use this BEFORE starting new tests or AFTER completing tests.
// Clean up test sessions - kill browsers, stop dev servers, free ports, and optionally remove test data. Use this BEFORE starting new tests or AFTER completing tests.
Generate persistent test cases from project analysis, or add individual test cases interactively. Supports full project analysis or adding single test cases via prompt description with browser exploration.
Execute tests from persistent test cases. Reads ./tests/ directory, runs cleanup, wallet setup (if Web3), executes tests, and generates report.
Analyze ANY web project - detect if Web3 DApp, research dependencies via WebSearch, understand business functions from code AND UI screenshots, generate test requirements.
Connect wallet to Web3 DApp - navigate to DApp, click Connect Wallet, approve in MetaMask popup, verify connection. Can be used as a test case or as a precondition for other tests.
Generate test report with clear visual indicators - ✅ for pass, ❌ for fail. Summarize results, document failures, provide recommendations.
Set up MetaMask wallet extension for Web3 DApp testing - download extension, import wallet from private key. Run at test start if tests/config.yaml has web3.enabled=true.
| name | web-test-cleanup |
| description | Clean up test sessions - kill browsers, stop dev servers, free ports, and optionally remove test data. Use this BEFORE starting new tests or AFTER completing tests. |
| license | MIT |
| compatibility | Node.js 18+ |
| metadata | {"author":"AI Agent","version":"1.0.0"} |
| allowed-tools | Bash Read |
Clean up test sessions by closing browsers, stopping dev servers, freeing ports, and optionally removing test data.
--keep-data to get a clean slate--keep-data to preserve test artifacts for reviewSKILL_DIR="<path-to-this-skill>"
# Full cleanup (removes test-output folder)
$SKILL_DIR/scripts/cleanup.sh
# Keep test data (screenshots, wallet config, etc.)
$SKILL_DIR/scripts/cleanup.sh --keep-data
test-output/.dev-server.json to find and stop the dev server process started by web-test.dev-server.json).browser-cdp.json - Browser CDP connection info.browser-state.json - Browser state.dev-server.json - Dev server process info--keep-data)<project-root>/test-output/
├── screenshots/ # Test screenshots
├── chrome-profile/ # Browser state, wallet data
├── extensions/ # Downloaded wallet extensions
├── console-logs.txt # Browser console output
└── test-report-YYYYMMDD-HHMMSS.md # Generated test report (timestamped)
Before starting a new test session, run full cleanup:
SKILL_DIR="<path-to-this-skill>"
# Kill all processes and remove test data
$SKILL_DIR/scripts/cleanup.sh
This ensures:
After completing tests, run cleanup with --keep-data:
SKILL_DIR="<path-to-this-skill>"
# Kill processes but keep test artifacts
$SKILL_DIR/scripts/cleanup.sh --keep-data
This:
If the cleanup script is not available, you can run these commands manually:
# Stop dev server using saved PID (only kills our process)
DEV_PID=$(node -e "console.log(require('./test-output/.dev-server.json').pid)" 2>/dev/null)
kill -9 $DEV_PID 2>/dev/null
# Kill browser processes (only test browsers)
pkill -f "Google Chrome.*test-output"
pkill -f "chromium.*test-output"
pkill -f "remote-debugging-port=9222"
# Remove state files
rm -f ./test-output/.dev-server.json
rm -f ./test-output/.browser-cdp.json
rm -f ./test-output/.browser-state.json
# Remove test data
rm -rf ./test-output/
0 - Cleanup completed successfully1 - Cleanup failed (check error message)--keep-data when you need to review test resultsscripts/ directory