- 数据层:messages 表增加 part_type 字段,新建 file_versions 表支持版本追踪 - 后端:saveWorkspace 版本追踪、saveAgentOutput 源头分离、generateBriefMessage 成员简报 - 后端:applyDocumentEdit 增量编辑、buildWorkflowStep phase-aware 工作流引擎 - API:文件版本查询/回退接口 - 前端:part_type 驱动渲染,产物面板版本历史 - 新增写手团队(主编/搜索员/策划编辑/合规审查员)配置 - store 模块、scheduler 模块、web-search skill Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8.2 KiB
End-to-End Test Guide
Testing the Complete Integration
This guide walks through testing the entire Web Search Skill integration with LobsterAI.
Prerequisites
- LobsterAI built and ready to run
- Google Chrome installed
- Internet connection available
Test 1: Service Auto-Start
Objective: Verify that the Bridge Server starts automatically with LobsterAI.
Steps:
-
Start LobsterAI in development mode:
npm run electron:dev -
Check the console output for:
[SkillServices] Starting skill services... [SkillServices] Starting Web Search Bridge Server... [SkillServices] Web Search Bridge Server started (PID: XXXXX) -
Verify the server is running:
curl http://127.0.0.1:8923/api/healthExpected response:
{ "success": true, "data": { "status": "healthy", "uptime": 123.45, "connections": 0 } }
Expected Result: ✅ Bridge Server starts automatically within 3 seconds of LobsterAI launch.
Test 2: CLI Search from Terminal
Objective: Test the search functionality directly from command line.
Steps:
-
Open a terminal while LobsterAI is running
-
Execute a search:
bash SKILLs/web-search/scripts/search.sh "React 19 features" 5 -
Verify output contains:
- Search query
- Result count
- Duration in ms
- Markdown-formatted results with titles, URLs, and snippets
Expected Result: ✅ Search completes in < 3 seconds, returns 5 results.
Test 3: Cowork Session Integration
Objective: Test Claude's ability to use the skill in a Cowork session.
Steps:
-
Start LobsterAI
-
Create a new Cowork session
-
Send the following message:
Search for the latest information about Next.js 14 new features. -
Observe:
- Claude should recognize the need for real-time information
- Claude should execute:
bash SKILLs/web-search/scripts/search.sh "Next.js 14 new features" 5 - Search results should appear in the tool execution output
- Claude should synthesize information from the results
- Claude should provide a summary with source citations
Expected Result: ✅ Claude uses web-search skill automatically, provides current information with sources.
Test 4: Multiple Consecutive Searches
Objective: Verify connection caching and performance optimization.
Steps:
-
In a Cowork session, ask:
1. Search for "TypeScript 5.0 features" 2. Search for "React Server Components guide" 3. Search for "Vite 5.0 changes" -
Observe:
- First search: ~2-3 seconds (includes browser launch)
- Second search: ~1 second (reuses connection)
- Third search: ~1 second (reuses connection)
Expected Result: ✅ Subsequent searches are faster due to connection caching.
Test 5: Service Cleanup on Exit
Objective: Verify graceful shutdown of services when LobsterAI quits.
Steps:
-
With LobsterAI running and searches completed, quit the application
-
Check console output for:
[SkillServices] Stopping skill services... [SkillServices] Stopping Web Search Bridge Server... [SkillServices] Web Search Bridge Server stopped -
Verify server is stopped:
curl http://127.0.0.1:8923/api/healthExpected: Connection refused
-
Check no orphaned processes:
ps aux | grep "web-search"
Expected Result: ✅ All services stop cleanly, no orphaned processes.
Test 6: Error Handling - Server Not Running
Objective: Test behavior when Bridge Server is manually stopped.
Steps:
-
Start LobsterAI
-
Manually stop the Bridge Server:
bash SKILLs/web-search/scripts/stop-server.sh -
In Cowork session, ask Claude to search
-
Observe error message:
✗ Bridge Server is not running Please start the server first: bash SKILLs/web-search/scripts/start-server.sh -
Manually restart:
bash SKILLs/web-search/scripts/start-server.sh -
Retry search
Expected Result: ✅ Clear error message, easy recovery path.
Test 7: Browser Visibility
Objective: Verify all browser operations are visible and transparent.
Steps:
- Start LobsterAI (ensure headless is false in config)
- Execute a search via CLI or Cowork
- Observe:
- Chrome window appears
- Navigates to Bing search page
- Search query visible in URL bar
- Results page loads visibly
Expected Result: ✅ All browser operations visible to user, transparent behavior.
Test 8: Cross-Platform Compatibility
Objective: Verify skill works across different platforms.
Platform-Specific Steps:
macOS
# Verify Chrome path detection
bash SKILLs/web-search/scripts/search.sh "test" 1
# Should find Chrome at: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Linux
# Verify Chrome/Chromium detection
bash SKILLs/web-search/scripts/search.sh "test" 1
# Should find at: /usr/bin/google-chrome or /usr/bin/chromium
Windows
# Verify Chrome detection
bash SKILLs/web-search/scripts/search.sh "test" 1
# Should find at: C:\Program Files\Google\Chrome\Application\chrome.exe
Expected Result: ✅ Chrome detection works on all platforms.
Test 9: Concurrent Searches
Objective: Test multiple searches happening in parallel.
Steps:
-
Open two terminal windows
-
Execute searches simultaneously:
- Terminal 1:
bash scripts/search.sh "React" 3 - Terminal 2:
bash scripts/search.sh "Vue" 3
- Terminal 1:
-
Both should complete successfully
Expected Result: ✅ Multiple searches can run concurrently.
Test 10: Result Quality
Objective: Verify search results are relevant and well-formatted.
Steps:
-
Search for a specific topic:
bash SKILLs/web-search/scripts/search.sh "Playwright documentation" 5 -
Verify results include:
- Official Playwright documentation (playwright.dev)
- Recent tutorials and guides
- Relevant Stack Overflow or GitHub discussions
-
Check Markdown formatting:
- Headers for each result
- Clickable URLs
- Clean snippets
Expected Result: ✅ High-quality, relevant results with proper formatting.
Performance Benchmarks
| Operation | Target | Acceptable |
|---|---|---|
| Server startup | < 2s | < 3s |
| Browser launch | < 3s | < 5s |
| First search | < 3s | < 5s |
| Subsequent search | < 1s | < 2s |
| Server shutdown | < 2s | < 3s |
Common Issues and Solutions
Issue 1: Server Won't Start
Symptoms: No PID file created, health check fails
Debug:
cat SKILLs/web-search/.server.log
npm run build --prefix SKILLs/web-search
Issue 2: Chrome Not Found
Symptoms: "Chrome not found" error
Solution:
- macOS: Install from https://www.google.com/chrome/
- Linux:
sudo apt install chromium-browser - Windows: Install Chrome
Issue 3: Port Already in Use
Symptoms: "Address already in use" error
Solution:
lsof -i :8923
kill -9 <PID>
bash SKILLs/web-search/scripts/start-server.sh
Issue 4: Stale Connection
Symptoms: "Connection not found" error
Solution:
rm SKILLs/web-search/.connection
Success Criteria
All tests pass when:
- ✅ Server auto-starts with LobsterAI
- ✅ Searches complete in < 3 seconds
- ✅ Claude uses skill automatically when appropriate
- ✅ Connection caching improves performance
- ✅ Services cleanup gracefully on exit
- ✅ Error messages are clear and actionable
- ✅ Browser operations are visible
- ✅ Works on macOS, Linux, Windows
- ✅ Concurrent searches supported
- ✅ Results are relevant and well-formatted
Final Checklist
Before considering the integration complete:
- All 10 tests pass
- Performance benchmarks met
- No console errors or warnings
- Documentation is complete
- Code is compiled without errors
- Skills config includes web-search
- SKILL.md is comprehensive
- README.md is accurate
- Examples work as documented
- Service manager integrates cleanly
Next Steps
After all tests pass:
- Create commit with all changes
- Test in production build
- Document any platform-specific quirks
- Gather user feedback
- Consider Phase 2 enhancements (Google search, caching, etc.)