#!/bin/bash # Frontend Validation Test Suite for QBPOS Help Website # Tests: Responsive layout, console errors, accessibility, and performance echo "================================================" echo " QBPOS Help - Frontend Validation Report" echo "================================================" echo "" SITE_URL="https://quickbookposhelp.access.ly" TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S") echo "Test Date: $TIMESTAMP" echo "Site URL: $SITE_URL" echo "" # Test 1: Site Accessibility echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "✓ TEST 1: SITE ACCESSIBILITY" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$SITE_URL") RESPONSE_TIME=$(curl -s -o /dev/null -w "%{time_total}" "$SITE_URL") if [ "$HTTP_STATUS" == "200" ]; then echo "✅ HTTP Status: $HTTP_STATUS (OK)" else echo "❌ HTTP Status: $HTTP_STATUS (ERROR)" fi echo "✅ Response Time: ${RESPONSE_TIME}s" echo "" # Test 2: Security Headers echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "✓ TEST 2: SECURITY HEADERS" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" HEADERS=$(curl -sI "$SITE_URL") check_header() { local header_name=$1 if echo "$HEADERS" | grep -qi "$header_name"; then local value=$(echo "$HEADERS" | grep -i "$header_name" | cut -d: -f2- | tr -d '\r' | sed 's/^ *//') echo "✅ $header_name: $value" else echo "❌ $header_name: MISSING" fi } check_header "X-Frame-Options" check_header "X-Content-Type-Options" check_header "X-XSS-Protection" check_header "Content-Security-Policy" check_header "Referrer-Policy" echo "" # Test 3: Cache Control echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "✓ TEST 3: CACHE CONTROL" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" check_cache() { local file=$1 local url="$SITE_URL/POS_Help/$file" local cache_header=$(curl -sI "$url" | grep -i "cache-control" | cut -d: -f2- | tr -d '\r' | sed 's/^ *//') if echo "$cache_header" | grep -qi "no-cache"; then echo "✅ $file: no-cache enabled" else echo "⚠️ $file: Cache may be enabled ($cache_header)" fi } check_cache "___dtree.js" check_cache "___dtree.css" check_cache "___left.htm" check_cache "responsive.css" echo "" # Test 4: Required Files Exist echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "✓ TEST 4: REQUIRED FILES" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" check_file() { local file=$1 local url="$SITE_URL/POS_Help/$file" local status=$(curl -s -o /dev/null -w "%{http_code}" "$url") if [ "$status" == "200" ]; then echo "✅ $file (HTTP $status)" else echo "❌ $file (HTTP $status)" fi } check_file "___dtree.js?v=20260110060500" check_file "___dtree.css?v=20260110060500" check_file "responsive.css?v=20260110060500" check_file "___left.htm" check_file "qbpos.css" echo "" # Test 5: HTML5 Validation echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "✓ TEST 5: HTML5 STRUCTURE" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" HTML_CONTENT=$(curl -s "$SITE_URL") check_html_tag() { local tag=$1 local description=$2 if echo "$HTML_CONTENT" | grep -q "$tag"; then echo "✅ $description" else echo "❌ $description" fi } check_html_tag "" "DOCTYPE declaration" check_html_tag 'lang="en"' "Language attribute" check_html_tag '