diff --git a/accessibility-test-results.txt b/accessibility-test-results.txt new file mode 100644 index 0000000..f9f05f8 --- /dev/null +++ b/accessibility-test-results.txt @@ -0,0 +1,16 @@ +WCAG 2.1 AA Accessibility Test Results +===================================== +Date: wo 26 nov 2025 22:17:36 CET +Target: http://localhost:8080 + +Total tests: 25 +Passed: 12 +Failed: 13 +Success rate: 48% + +Recommendations for WCAG 2.1 AA compliance: +1. Add ARIA labels for better screen reader support +2. Implement keyboard navigation for all interactive elements +3. Add skip links for better navigation +4. Ensure all form inputs have proper labels +5. Test with actual screen readers (JAWS, NVDA, VoiceOver) diff --git a/accessibility-test.sh b/accessibility-test.sh new file mode 100755 index 0000000..ab5c8ce --- /dev/null +++ b/accessibility-test.sh @@ -0,0 +1,175 @@ +#!/bin/bash + +# WCAG 2.1 AA Accessibility Test Suite for CodePress CMS +# Tests for web accessibility compliance + +BASE_URL="http://localhost:8080" +TOTAL_TESTS=0 +PASSED_TESTS=0 +FAILED_TESTS=0 +WARNINGS=0 + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +echo -e "${BLUE}========================================${NC}" +echo -e "${BLUE}WCAG 2.1 AA ACCESSIBILITY TESTS${NC}" +echo -e "${BLUE}Target: $BASE_URL${NC}" +echo -e "${BLUE}========================================${NC}" + +# Function to run a test +run_test() { + local test_name="$1" + local test_command="$2" + local expected="$3" + + echo -n "Testing: $test_name... " + + result=$(eval "$test_command" 2>/dev/null) + + if [ "$result" = "$expected" ]; then + echo -e "${GREEN}[PASS]${NC} ✅" + ((PASSED_TESTS++)) + else + echo -e "${RED}[FAIL]${NC} ❌" + echo " Expected: $expected" + echo " Got: $result" + ((FAILED_TESTS++)) + fi + ((TOTAL_TESTS++)) +} + +echo "" +echo -e "${BLUE}1. PERCEIVABLE (Information must be presentable in ways users can perceive)${NC}" +echo "" + +# Test 1.1 - Text alternatives +run_test "Alt text for images" "curl -s '$BASE_URL/' | grep -c 'alt=' | head -1" "1" +run_test "Semantic HTML structure" "curl -s '$BASE_URL/' | grep -c '\|

\|

'" "3" +run_test "List markup usage" "curl -s '$BASE_URL/' | grep -c ''" "2" + +# Test 1.4 - Distinguishable content +run_test "Color contrast (basic check)" "curl -s '$BASE_URL/' | grep -c 'color:\|background:'" "2" +run_test "Text resize capability" "curl -s '$BASE_URL/' | grep -c 'viewport'" "1" + +echo "" +echo -e "${BLUE}2. OPERABLE (Interface components must be operable)${NC}" +echo "" + +# Test 2.1 - Keyboard accessible +run_test "Keyboard navigation support" "curl -s '$BASE_URL/' | grep -c 'tabindex=\|accesskey=' | head -1" "0" +run_test "Focus indicators" "curl -s '$BASE_URL/' | grep -c ':focus\|outline'" "1" + +# Test 2.2 - Enough time +run_test "No auto-updating content" "curl -s '$BASE_URL/' | grep -c ''" "1" + +echo "" +echo -e "${BLUE}3. UNDERSTANDABLE (Information and UI operation must be understandable)${NC}" +echo "" + +# Test 3.1 - Readable +run_test "Language attribute" "curl -s '$BASE_URL/' | grep -c 'lang=' | head -1" "1" +run_test "Text direction" "curl -s '$BASE_URL/' | grep -c 'dir=' | head -1" "0" + +# Test 3.2 - Predictable +run_test "Consistent navigation" "curl -s '$BASE_URL/' | grep -c 'nav\|navigation'" "2" + +# Test 3.3 - Input assistance +run_test "Form labels" "curl -s '$BASE_URL/' | grep -c '