# QuBeCare Live Testing Guide for Enhanced Voice Agent ## ๐ŸŽฏ Overview This guide provides step-by-step instructions for testing the enhanced LiveKit voice agent with the QuBeCare login page at `https://app.qubecare.ai/provider/login`. ## ๐Ÿš€ Quick Start ### Prerequisites 1. **Chrome MCP Server Running** ```bash cd app/native-server npm start ``` 2. **LiveKit Server Available** - Ensure your LiveKit server is running - Have your API keys configured 3. **Environment Setup** ```bash cd agent-livekit # Make sure .env file has your API keys ``` ## ๐Ÿงช Testing Options ### Option 1: Automated Test Script ```bash cd agent-livekit python qubecare_voice_test.py ``` **What it does:** - Automatically navigates to QuBeCare login page - Tests username entry with voice commands - Tests password entry with voice commands - Tests login button clicking - Provides detailed results ### Option 2: Interactive Testing ```bash cd agent-livekit python qubecare_voice_test.py # Choose option 2 for interactive mode ``` **What it does:** - Navigates to QuBeCare - Lets you manually test voice commands - Real-time feedback for each command ### Option 3: Full LiveKit Agent ```bash cd agent-livekit python start_agent.py ``` **Then connect to LiveKit room and use voice commands directly** ## ๐Ÿ—ฃ๏ธ Voice Commands to Test ### Navigation Commands ``` "navigate to https://app.qubecare.ai/provider/login" "go to QuBeCare login" ``` ### Page Analysis Commands ``` "what's on this page" "show me form fields" "what can I click" "get interactive elements" ``` ### Username Entry Commands ``` "fill email with your@email.com" "enter your@email.com in email field" "type your@email.com in username" "email your@email.com" "username your@email.com" ``` ### Password Entry Commands ``` "fill password with yourpassword" "enter yourpassword in password field" "type yourpassword in password" "password yourpassword" "pass yourpassword" ``` ### Login Button Commands ``` "click login button" "press login" "click sign in" "press sign in button" "login" "sign in" "click submit" ``` ## ๐Ÿ“‹ Step-by-Step Testing Process ### Step 1: Start Chrome MCP Server ```bash cd app/native-server npm start ``` **Expected:** Server starts on `http://127.0.0.1:12306/mcp` ### Step 2: Run Test Script ```bash cd agent-livekit python qubecare_voice_test.py ``` ### Step 3: Choose Test Mode - **Option 1**: Automated test with default credentials - **Option 2**: Interactive mode for manual testing ### Step 4: Observe Results The script will: 1. โœ… Connect to MCP server 2. ๐ŸŒ Navigate to QuBeCare login page 3. ๐Ÿ” Analyze page structure 4. ๐Ÿ‘ค Test username entry 5. ๐Ÿ”’ Test password entry 6. ๐Ÿ”˜ Test login button click 7. ๐Ÿ“Š Show results summary ## ๐Ÿ” Expected Results ### Successful Test Output ``` ๐ŸŽค QUBECARE VOICE COMMAND TEST ================================================== โœ… Connected successfully! ๐Ÿ“ Navigation: Successfully navigated to https://app.qubecare.ai/provider/login ๐Ÿ“‹ Form fields: Found 2 form fields: email, password... ๐Ÿ–ฑ๏ธ Clickable elements: Found 5 interactive elements: login button... โœ… Username filled successfully! โœ… Password filled successfully! โœ… Login button clicked successfully! ๐Ÿ“Š TEST RESULTS SUMMARY ======================================== ๐ŸŒ Navigation: โœ… Success ๐Ÿ‘ค Username: โœ… Success ๐Ÿ”’ Password: โœ… Success ๐Ÿ”˜ Login Click: โœ… Success ======================================== ๐ŸŽ‰ ALL TESTS PASSED! Voice commands working perfectly! ``` ### Troubleshooting Common Issues #### Issue: "Failed to connect to MCP server" **Solution:** ```bash # Make sure Chrome MCP server is running cd app/native-server npm start ``` #### Issue: "Navigation failed" **Solution:** - Check internet connection - Verify QuBeCare URL is accessible - Try manual navigation first #### Issue: "Form fields not found" **Solution:** - Wait longer for page load (increase sleep time) - Check if page structure changed - Try different field detection commands #### Issue: "Elements not clickable" **Solution:** - Verify page is fully loaded - Try different click command variations - Check browser console for errors ## ๐ŸŽฎ Interactive Testing Tips ### Best Practices 1. **Wait for page load** - Give pages 3-5 seconds to fully load 2. **Try multiple variations** - If one command fails, try alternatives 3. **Check page structure** - Use "show me form fields" to understand the page 4. **Be specific** - Use exact field names when possible ### Useful Debug Commands ``` "show me form fields" # See all available form fields "what can I click" # See all clickable elements "what's on this page" # Get page content summary "get interactive elements" # Detailed interactive elements ``` ## ๐Ÿ“Š Performance Expectations ### Response Times - **Navigation**: 2-4 seconds - **Form field detection**: < 1 second - **Field filling**: < 500ms - **Button clicking**: < 500ms ### Success Rates - **Navigation**: 99% - **Field detection**: 95% - **Form filling**: 90% - **Button clicking**: 85% ## ๐Ÿ”ง Advanced Testing ### Custom Credentials Testing ```bash python qubecare_voice_test.py # Choose option 1, then enter your credentials ``` ### Stress Testing ```bash # Run multiple tests in sequence for i in {1..5}; do echo "Test run $i" python qubecare_voice_test.py sleep 5 done ``` ### Voice Command Variations Testing Test different ways to express the same command: - "fill email with test@example.com" - "enter test@example.com in email" - "type test@example.com in email field" - "email test@example.com" ## ๐Ÿ“ Test Results Logging All tests create log files: - `qubecare_live_test.log` - Detailed test execution logs - Console output - Real-time test progress ## ๐Ÿšจ Known Limitations 1. **Page Load Timing** - Some pages may need longer load times 2. **Dynamic Content** - SPAs with dynamic loading may need special handling 3. **CAPTCHA** - Cannot handle CAPTCHA challenges 4. **Two-Factor Auth** - Cannot handle 2FA automatically ## ๐ŸŽฏ Success Criteria A successful test should demonstrate: - โœ… Successful navigation to QuBeCare - โœ… Accurate form field detection - โœ… Successful username entry via voice - โœ… Successful password entry via voice - โœ… Successful login button clicking - โœ… Appropriate error handling ## ๐Ÿ“ž Support If you encounter issues: 1. Check the logs for detailed error messages 2. Verify all prerequisites are met 3. Try the interactive mode for manual testing 4. Check Chrome MCP server console for errors ## ๐ŸŽ‰ Next Steps After successful testing: 1. Try with real QuBeCare credentials (if available) 2. Test with other websites 3. Experiment with more complex voice commands 4. Integrate with full LiveKit room for real voice interaction