68 lines
2.2 KiB
Bash
68 lines
2.2 KiB
Bash
|
|
#!/bin/bash
|
||
|
|
# Backend Navigation Test Script
|
||
|
|
|
||
|
|
echo "=========================================="
|
||
|
|
echo " Testing Backend Admin Panel Navigation"
|
||
|
|
echo "=========================================="
|
||
|
|
|
||
|
|
# Colors for output
|
||
|
|
GREEN='\033[0;32m'
|
||
|
|
RED='\033[0;31m'
|
||
|
|
NC='\033[0m' # No Color
|
||
|
|
|
||
|
|
# Test if backend is running
|
||
|
|
echo -e "\n1. Checking if backend server is running..."
|
||
|
|
if curl -s http://localhost:5000/health > /dev/null; then
|
||
|
|
echo -e "${GREEN}✓ Backend server is running${NC}"
|
||
|
|
else
|
||
|
|
echo -e "${RED}✗ Backend server is not responding${NC}"
|
||
|
|
echo "Please start the backend server first:"
|
||
|
|
echo " cd /media/pts/Website/SkyArtShop/backend && npm start"
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
# Check if admin files are accessible
|
||
|
|
echo -e "\n2. Checking admin panel files..."
|
||
|
|
pages=("dashboard.html" "products.html" "portfolio.html" "blog.html" "pages.html" "menu.html" "settings.html" "users.html" "homepage.html")
|
||
|
|
|
||
|
|
for page in "${pages[@]}"; do
|
||
|
|
if curl -s -o /dev/null -w "%{http_code}" http://localhost:5000/admin/$page | grep -q "200\|304"; then
|
||
|
|
echo -e "${GREEN}✓ /admin/$page accessible${NC}"
|
||
|
|
else
|
||
|
|
echo -e "${RED}✗ /admin/$page not found${NC}"
|
||
|
|
fi
|
||
|
|
done
|
||
|
|
|
||
|
|
# Check API endpoints
|
||
|
|
echo -e "\n3. Checking API endpoints..."
|
||
|
|
endpoints=(
|
||
|
|
"/api/admin/session"
|
||
|
|
"/api/products"
|
||
|
|
"/api/portfolio/projects"
|
||
|
|
"/api/blog/posts"
|
||
|
|
"/api/pages"
|
||
|
|
"/api/menu"
|
||
|
|
"/api/homepage/settings"
|
||
|
|
)
|
||
|
|
|
||
|
|
for endpoint in "${endpoints[@]}"; do
|
||
|
|
status=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:5000$endpoint)
|
||
|
|
if [ "$status" == "200" ] || [ "$status" == "401" ]; then
|
||
|
|
echo -e "${GREEN}✓ $endpoint responding (HTTP $status)${NC}"
|
||
|
|
else
|
||
|
|
echo -e "${RED}✗ $endpoint not responding properly (HTTP $status)${NC}"
|
||
|
|
fi
|
||
|
|
done
|
||
|
|
|
||
|
|
echo -e "\n=========================================="
|
||
|
|
echo " Test Complete!"
|
||
|
|
echo "=========================================="
|
||
|
|
echo ""
|
||
|
|
echo "Next Steps:"
|
||
|
|
echo "1. Login to the admin panel at http://localhost:5000/admin/login.html"
|
||
|
|
echo "2. After login, navigate through different sections"
|
||
|
|
echo "3. Verify you stay logged in when clicking navigation links"
|
||
|
|
echo "4. Create/Edit content in each section"
|
||
|
|
echo "5. Verify changes appear on the frontend"
|
||
|
|
echo ""
|