Files
thrillwiki_django_no_react/backend/tests/e2e/setup.sh
pacnpal d504d41de2 feat: complete monorepo structure with frontend and shared resources
- Add complete backend/ directory with full Django application
- Add frontend/ directory with Vite + TypeScript setup ready for Next.js
- Add comprehensive shared/ directory with:
  - Complete documentation and memory-bank archives
  - Media files and avatars (letters, park/ride images)
  - Deployment scripts and automation tools
  - Shared types and utilities
- Add architecture/ directory with migration guides
- Configure pnpm workspace for monorepo development
- Update .gitignore to exclude .django_tailwind_cli/ build artifacts
- Preserve all historical documentation in shared/docs/memory-bank/
- Set up proper structure for full-stack development with shared resources
2025-08-23 18:40:07 -04:00

55 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
set -e # Exit on error
# Function to check command exists
check_command() {
if ! command -v $1 &> /dev/null; then
echo "Error: $1 is required but not installed."
exit 1
fi
}
# Check required commands
check_command uv
check_command curl
check_command playwright
# Clean up any existing test data
echo "Cleaning up any existing test data..."
uv run manage.py cleanup_test_data || true
# Install Python dependencies
echo "Installing Python dependencies..."
uv pip install -r requirements.txt
# Install Playwright browsers
echo "Installing Playwright browsers..."
playwright install chromium firefox webkit
# Create test fixtures directory
echo "Setting up test fixtures..."
mkdir -p tests/fixtures
# Download test images
echo "Downloading test images..."
curl -L "https://picsum.photos/1920/1080" -o tests/fixtures/test_photo.jpg
curl -L "https://picsum.photos/500/500" -o tests/fixtures/test_avatar.jpg
# Verify images were downloaded
if [ ! -f tests/fixtures/test_photo.jpg ] || [ ! -f tests/fixtures/test_avatar.jpg ]; then
echo "Error: Failed to download test images"
exit 1
fi
# Create test users
echo "Creating test users..."
uv run manage.py create_test_users
# Make cleanup script executable
chmod +x tests/e2e/cleanup.sh
echo "Setup complete! You can now:"
echo "1. Run all tests: pytest tests/e2e/"
echo "2. Run specific tests: pytest tests/e2e/test_auth.py"
echo "3. Run with specific browser: pytest --browser firefox tests/e2e/"
echo "4. Clean up test data: ./tests/e2e/cleanup.sh"