#!/bin/bash # Script to add deprecation notices to old test files # Created: January 2025 echo "Adding deprecation notices to old test files..." DEPRECATION_NOTICE="/** * ⛔ DEPRECATED - January 2025 * This test file has been deprecated and replaced by comprehensive E2E testing framework * * Reasons for deprecation: * - Tests old event creation/management forms that have been replaced * - Individual test files replaced by comprehensive test suites * - Page Object Model (POM) architecture provides better test organization * - Modern test framework with better error handling and reporting * * Replacement: test-master-trainer-e2e.js + test-comprehensive-validation.js * - Comprehensive E2E testing covering all event workflows * - Page Object Model for maintainable tests * - Better test organization and reporting * - Docker-based testing environment * * See: DEPRECATED-FILES.md for full migration details */" # List of test files to deprecate TEST_FILES=( "test-edit-event-debug.js" "test-edit-event-page.js" "test-manage-event-fixes.js" "test-final-manage-event.js" "test-create-and-edit-event.js" "test-create-and-edit-events.js" "test-create-event-after-fix.js" "debug-create-event-404.js" ) for file in "${TEST_FILES[@]}"; do if [ -f "$file" ]; then echo "Adding deprecation notice to $file" # Create a temporary file with deprecation notice echo "#!/usr/bin/env node" > "${file}.tmp" echo "" >> "${file}.tmp" echo "$DEPRECATION_NOTICE" >> "${file}.tmp" echo "" >> "${file}.tmp" # Add the rest of the original file (skip shebang if present) if head -1 "$file" | grep -q "^#!"; then tail -n +2 "$file" >> "${file}.tmp" else cat "$file" >> "${file}.tmp" fi # Replace the original file mv "${file}.tmp" "$file" echo "✅ Updated $file" else echo "⚠️ File not found: $file" fi done echo "" echo "Deprecation notices added to test files." echo "All deprecated files are now marked for removal in v3.3"