#!/bin/bash # ===================================================================== # main-page-test.sh - Test the main page functionality # ===================================================================== # This script checks if the main page loads correctly # ===================================================================== # Check if base URL is provided if [ -z "$1" ]; then BASE_URL="http://localhost:8080" else BASE_URL="$1" fi echo "=== Testing Main Page ===" echo "Using base URL: $BASE_URL" # Check if the main page loads properly echo "Checking if the main page loads properly..." RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "$BASE_URL/index.html") if [ "$RESPONSE" -eq 200 ]; then echo "✅ Main page loads successfully (HTTP $RESPONSE)" else echo "❌ Main page failed to load (HTTP $RESPONSE)" exit 1 fi # Check for page title echo "Checking page title..." TITLE=$(curl -s "$BASE_URL/index.html" | grep -o "