Add test setup, cleanup, and fixtures

This commit is contained in:
pacnpal
2024-12-24 14:32:16 -05:00
parent af7ea6b4ce
commit e60f73de9d
4 changed files with 246 additions and 0 deletions

25
tests/e2e/cleanup.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
set -e # Exit on error
echo "Cleaning up test data..."
# Run Django cleanup command
uv run manage.py cleanup_test_data
# Clean up test fixtures
echo "Cleaning up test fixtures..."
rm -f tests/fixtures/test_photo.jpg
rm -f tests/fixtures/test_avatar.jpg
# Clean up Playwright artifacts
echo "Cleaning up Playwright artifacts..."
rm -rf test-results/
rm -rf playwright-report/
# Clean up pytest cache
echo "Cleaning up pytest cache..."
rm -rf .pytest_cache/
rm -rf tests/e2e/__pycache__/
find . -type d -name "__pycache__" -exec rm -r {} + 2>/dev/null || true
echo "Cleanup complete!"