diff --git a/README.md b/README.md index 258b682..6d3a845 100644 --- a/README.md +++ b/README.md @@ -439,6 +439,64 @@ cargo test -p bottest 3. Run [Weekly Maintenance Tasks](#-weekly-maintenance-tasks) to keep codebase healthy 4. Read project-specific READMEs in [Project-Specific Guidelines](#-project-specific-guidelines) +## ๐ŸŽญ Playwright Browser Testing - YOLO Mode + +### YOLO Mode Instructions for LLMs + +**When user requests to start YOLO mode with Playwright:** + +1. **Start the browser** - Use `mcp__playwright__browser_navigate` to open http://localhost:3000 +2. **Take snapshot** - Use `mcp__playwright__browser_snapshot` to see current page state +3. **Test user flows** - Use click, type, fill_form, etc. to interact with UI +4. **Verify results** - Check for expected content, errors in console, network requests +5. **Report findings** - Always include screenshot evidence with `browser_take_screenshot` + +**Available Playwright MCP Tools:** +- `browser_navigate` - Navigate to URL +- `browser_snapshot` - Get accessibility tree (better than screenshots for analysis) +- `browser_take_screenshot` - Capture visual state +- `browser_click` - Click elements (provide ref from snapshot) +- `browser_type` - Type text into inputs +- `browser_fill_form` - Fill multiple form fields at once +- `browser_console_messages` - Check for JavaScript errors +- `browser_network_requests` - Inspect API calls +- `browser_close` - Close browser when done + +**YOLO Testing Workflow:** +``` +1. Navigate โ†’ http://localhost:3000 +2. Snapshot โ†’ Analyze page structure +3. Click โ†’ Target element using ref from snapshot +4. Wait โ†’ For navigation/updates (browser_wait_for) +5. Verify โ†’ Console messages, network status +6. Screenshot โ†’ Document test results +``` + +**Testing Checklist:** +- โœ… UI loads without errors +- โœ… Navigation works between sections +- โœ… Forms submit correctly +- โœ… WebSocket connections establish +- โœ… Console shows no JavaScript errors +- โœ… Network requests return 200/201/204 + +**Critical Test Flows:** +- **Login/Authentication** โ†’ Navigate, enter credentials, verify session +- **Bot Creation** โ†’ Click "New Bot", fill form, verify creation +- **Chat Interface** โ†’ Send message, verify WebSocket response +- **File Upload** โ†’ Upload .bas file, verify compilation +- **Drive Sync** โ†’ Trigger sync, verify files appear + +**Error Handling in YOLO Mode:** +- If navigation fails: Check if servers running (`ps aux | grep botserver`) +- If element not found: Take snapshot to debug current page state +- If console errors: Extract and report to user for fixing +- If network failures: Check API endpoints and CORS configuration + +### Integration Testing + +For automated test suites, prefer `cargo test -p bottest` for backend logic and Playwright YOLO mode for full-stack UI testing. + ## ๐Ÿงช Testing Strategy ### Unit Tests diff --git a/botbook b/botbook index 3e418df..6d48dbb 160000 --- a/botbook +++ b/botbook @@ -1 +1 @@ -Subproject commit 3e418df1a854fb2c98258b0c454082cd751a8123 +Subproject commit 6d48dbba1b21f7fdefd4dfa30d0e33e2879980bb diff --git a/botserver b/botserver index 5ea171d..17cb4ef 160000 --- a/botserver +++ b/botserver @@ -1 +1 @@ -Subproject commit 5ea171d12617751283c50c955635135a10a52ad7 +Subproject commit 17cb4ef1479c50c0ed9708fc5862a176b1c9a61f diff --git a/botui b/botui index af78f31..161012c 160000 --- a/botui +++ b/botui @@ -1 +1 @@ -Subproject commit af78f3156594c3bdbb9d76c31b26bcaf30abf77c +Subproject commit 161012c6a699625e86f08e190f198cd428b9f83d diff --git a/console-errors.txt b/console-errors.txt new file mode 100644 index 0000000..447d5c0 --- /dev/null +++ b/console-errors.txt @@ -0,0 +1,19 @@ +Total messages: 587 (Errors: 16, Warnings: 4) +Returning 16 messages for level "error" + +[ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://localhost:3000/public/themes/vapordream.css:0 +[ERROR] โœ— Failed: ๐Ÿ’ญ Vapor Dream @ http://localhost:3000/cristo/suite/js/theme-manager.js:85 +[ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://localhost:3000/public/themes/saturdaycartoons.css:0 +[ERROR] โœ— Failed: ๐Ÿ“บ Cartoons @ http://localhost:3000/cristo/suite/js/theme-manager.js:85 +[ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://localhost:3000/public/themes/cyberpunk.css:0 +[ERROR] โœ— Failed: ๐ŸŒƒ Cyberpunk @ http://localhost:3000/cristo/suite/js/theme-manager.js:85 +[ERROR] WebSocket connection to 'ws://localhost:3000/ws/chat?session_id=f48dd5f0-662b-49bb-a9a6-4039f6e143e7&user_id=9f6c12e7-15b7-4443-bb4a-15b8e17ba076&bot_name=cristo' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED @ :819 +[ERROR] WebSocket error: Event @ :879 +[ERROR] WebSocket connection to 'ws://localhost:3000/ws/chat?session_id=f48dd5f0-662b-49bb-a9a6-4039f6e143e7&user_id=9f6c12e7-15b7-4443-bb4a-15b8e17ba076&bot_name=cristo' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED @ :819 +[ERROR] WebSocket error: Event @ :879 +[ERROR] WebSocket connection to 'ws://localhost:3000/ws/chat?session_id=f48dd5f0-662b-49bb-a9a6-4039f6e143e7&user_id=9f6c12e7-15b7-4443-bb4a-15b8e17ba076&bot_name=cristo' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED @ :819 +[ERROR] WebSocket error: Event @ :879 +[ERROR] WebSocket connection to 'ws://localhost:3000/ws/chat?session_id=f48dd5f0-662b-49bb-a9a6-4039f6e143e7&user_id=9f6c12e7-15b7-4443-bb4a-15b8e17ba076&bot_name=cristo' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED @ :819 +[ERROR] WebSocket error: Event @ :879 +[ERROR] WebSocket connection to 'ws://localhost:3000/ws/chat?session_id=f48dd5f0-662b-49bb-a9a6-4039f6e143e7&user_id=9f6c12e7-15b7-4443-bb4a-15b8e17ba076&bot_name=cristo' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED @ :819 +[ERROR] WebSocket error: Event @ :879 \ No newline at end of file diff --git a/restart.sh b/restart.sh deleted file mode 100755 index 09aa925..0000000 --- a/restart.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -set -e - -echo "๐Ÿ›‘ Stopping existing processes..." -pkill -f botserver || true -pkill -f botui || true -pkill -f rustc || true - -echo "๐Ÿงน Cleaning logs..." -rm -f botserver.log botui.log - -echo "๐Ÿ”จ Building botserver..." -cargo build -p botserver - -echo "๐Ÿ”จ Building botui..." -cargo build -p botui - -echo "๐Ÿš€ Starting botserver..." -RUST_LOG=info ./target/debug/botserver --noconsole > botserver.log 2>&1 & -BOTSERVER_PID=$! - -echo "๐Ÿš€ Starting botui..." -BOTSERVER_URL="https://localhost:8088" ./target/debug/botui > botui.log 2>&1 & -BOTUI_PID=$! - -echo "โœ… Started botserver (PID: $BOTSERVER_PID) and botui (PID: $BOTUI_PID)" -echo "๐Ÿ“Š Monitor with: tail -f botserver.log botui.log" -echo "๐ŸŒ Access at: http://localhost:3000"