#!/bin/bash
# π ARM64 Browser Automation Demo Runner
# Showcases autonomous SaaS testing capabilities on Raspberry Pi
echo "π ARM64 Browser Automation Demo Starting..."
echo "=============================================="
echo "π This demo will show:"
echo " β
End-to-end SaaS testing without human debugging"
echo " β
API validation through real browser interactions"
echo " β
Visual regression detection with screenshots"
echo " β
Cross-platform responsive testing"
echo " β
Autonomous error detection and recovery"
echo ""
echo "π‘ Perfect for SaaS startups who need:"
echo " π― Continuous testing on $480 budget"
echo " π€ AI agents that test without human intervention"
echo " π± Cross-device compatibility validation"
echo " π Visual regression prevention"
echo ""
echo "β±οΈ Demo takes ~2-3 minutes to complete..."
echo "πΈ Screenshots will be saved to /tmp/"
echo ""
# Check dependencies
echo "π Checking dependencies..."
if ! command -v node &> /dev/null; then
echo "β Node.js not found. Please install: sudo apt install nodejs"
exit 1
fi
if ! command -v python3 &> /dev/null; then
echo "β Python3 not found. Please install: sudo apt install python3"
exit 1
fi
if ! command -v chromium-browser &> /dev/null && ! command -v chromium &> /dev/null && ! command -v google-chrome &> /dev/null; then
echo "β Chromium/Chrome not found. Please install Chromium or Chrome for your platform."
exit 1
fi
if [ ! -f "index.js" ]; then
echo "β MCP server not found. Please run from the correct directory."
exit 1
fi
if [ ! -f "simple_browser.py" ]; then
echo "β Browser tools not found. Please run from the correct directory."
exit 1
fi
echo "β
All dependencies found!"
echo ""
# Test MCP server
echo "π§ͺ Testing MCP server..."
timeout 5s bash -c 'echo "{\"jsonrpc\":\"2.0\",\"method\":\"tools/list\",\"id\":1}" | node index.js' > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "β
MCP server working!"
else
echo "β οΈ MCP server test inconclusive (timeout expected)"
fi
echo ""
# Clean up old screenshots
echo "π§Ή Cleaning up old demo files..."
rm -f /tmp/github_signup_page.png
rm -f /tmp/api_interface.png
rm -f /tmp/visual_baseline.png
rm -f /tmp/responsive_*.png
echo "β
Cleanup complete!"
echo ""
# Run the demo
echo "π Starting main demo..."
echo "=" * 50
python3 demo.py
# Show results
echo ""
echo "πΈ Generated Screenshots:"
ls -la /tmp/*.png 2>/dev/null | grep -E "(github_|api_|visual_|responsive_)" || echo "No demo screenshots found"
echo ""
echo "π― Next Steps:"
echo " 1. Integrate into your CI/CD pipeline"
echo " 2. Add your own SaaS app URLs to test"
echo " 3. Set up 24/7 monitoring with cron jobs"
echo " 4. Scale to test multiple environments"
echo ""
echo "π° ROI Calculator:"
echo " Manual QA Engineer: $80,000/year"
echo " This ARM64 Setup: $480 + $40/month"
echo " Break-even: 2 months"
echo " Year 1 Savings: $78,000+"
echo ""
echo "π Demo Complete! ARM64 Browser Automation = SaaS Testing Gold π"