arbret/scripts/e2e.sh
counterweight 74ed6f0c11
Revert to local timezone display for user-facing times
- Changed formatTime back to use toLocaleTimeString (local time)
- Changed formatDateTime back to use toLocaleString (local time)
- App now displays all times in user's local timezone
- Backend still stores times in UTC, frontend converts for display
2025-12-21 18:20:22 +01:00

52 lines
946 B
Bash
Executable file

#!/bin/bash
set -e
cd "$(dirname "$0")/.."
# Load environment variables if .env exists
if [ -f .env ]; then
set -a
source .env
set +a
fi
# Kill any existing backend
pkill -f "uvicorn main:app" 2>/dev/null || true
sleep 1
# Seed the database with roles and test users
cd backend
echo "Seeding database..."
uv run python seed.py
cd ..
# Start backend (SECRET_KEY should be set via .envrc or environment)
cd backend
uv run uvicorn main:app --port 8000 --log-level warning &
PID=$!
cd ..
# Wait for backend
sleep 2
# Generate API types from OpenAPI schema
echo "Generating API types..."
cd frontend
npm run generate-api-types
cd ..
# Run tests (suppress Node.js color warnings)
# If TEST argument is provided, use it as a file pattern
cd frontend
if [ -n "$1" ]; then
NODE_NO_WARNINGS=1 npx playwright test "$1"
else
NODE_NO_WARNINGS=1 npm run test:e2e
fi
EXIT_CODE=$?
# Cleanup
kill $PID 2>/dev/null || true
exit $EXIT_CODE