Fix post-registration navigation and add comprehensive registration UI tests
- Fix RegisterView to call AuthenticationManager.login() after email verification so user is properly transitioned to home screen instead of returning to login - Fix ResidencesListView to load data when authentication state becomes true, ensuring residences load after registration/login - Add accessibility identifier to verification code field for UI testing - Add NSAppTransportSecurity exceptions for localhost/127.0.0.1 for local dev - Add comprehensive XCUITest suite for registration flow including: - Form validation tests (empty fields, invalid email, mismatched passwords) - Full registration and verification flow test - Logout from verification screen test - Helper scripts for test user cleanup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
36
iosApp/MyCribUITests/Scripts/cleanup_test_users.sh
Executable file
36
iosApp/MyCribUITests/Scripts/cleanup_test_users.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# Script to clean up test users from Django database
|
||||
# Usage: ./cleanup_test_users.sh [email]
|
||||
# If no email provided, cleans up all users with email starting with 'test_'
|
||||
|
||||
EMAIL="$1"
|
||||
|
||||
cd /Users/treyt/Desktop/code/MyCrib/myCribAPI
|
||||
|
||||
if [ -n "$EMAIL" ]; then
|
||||
FILTER="email='$EMAIL'"
|
||||
else
|
||||
FILTER="email__startswith='test_'"
|
||||
fi
|
||||
|
||||
# Try docker exec first (if running in Docker)
|
||||
if docker ps --format '{{.Names}}' | grep -q 'mycrib-web\|myCrib-web'; then
|
||||
CONTAINER_NAME=$(docker ps --format '{{.Names}}' | grep -E 'mycrib-web|myCrib-web' | head -1)
|
||||
docker exec "$CONTAINER_NAME" python manage.py shell -c "
|
||||
from django.contrib.auth import get_user_model
|
||||
User = get_user_model()
|
||||
deleted = User.objects.filter($FILTER).delete()
|
||||
print(f'Deleted: {deleted}')
|
||||
" 2>/dev/null
|
||||
else
|
||||
# Fallback to local Python
|
||||
export DJANGO_SETTINGS_MODULE=myCrib.settings
|
||||
python manage.py shell -c "
|
||||
from django.contrib.auth import get_user_model
|
||||
User = get_user_model()
|
||||
deleted = User.objects.filter($FILTER).delete()
|
||||
print(f'Deleted: {deleted}')
|
||||
" 2>/dev/null
|
||||
fi
|
||||
|
||||
echo "Test users cleanup complete"
|
||||
Reference in New Issue
Block a user