#!/bin/bash # scripts/smoke.sh # Fast UI smoke test for the Tesla Roadtrip project. # # This is the recommended quick check during iteration. # It opens the real browser UI (like a user would) and verifies that: # - The "Local Heavy" badge is visible (we're using your personal authenticated Grok CLI) # - A chat message can be sent # - Grok responds with something useful # # Much more representative than hitting the API directly. # # Usage: # ./scripts/smoke.sh # # Completes in ~30-90 seconds. set -e echo "๐Ÿš€ Tesla Roadtrip - Fast UI Smoke Test" echo "======================================" echo "" # Make sure backend is running if ! curl -s http://localhost:3000/health > /dev/null 2>&1; then echo "โš ๏ธ Backend not running on port 3000." echo " Starting dev environment in background..." ./scripts/dev.sh & echo " Waiting for backend to be ready..." sleep 18 else echo "โœ… Backend is running" fi echo "" echo "๐Ÿงช Running fast UI smoke test (real browser, like a user)..." echo "" npx playwright test tests/grok-api-diagnostic.spec.ts --reporter=list echo "" echo "โœ… Smoke test complete." echo " Check the output above for whether the Local Heavy path is working."