Major infrastructure changes: - BaseUITestCase: per-suite app termination via class setUp() prevents stale state when parallel clones share simulators - relaunchBetweenTests override for suites that modify login/onboarding state - focusAndType: dedicated SecureTextField path handles iOS strong password autofill suggestions (Choose My Own Password / Not Now dialogs) - LoginScreenObject: tapSignUp/tapForgotPassword use scrollIntoView for offscreen buttons instead of simple swipeUp - Removed all coordinate taps from ForgotPasswordScreen, VerifyResetCodeScreen, ResetPasswordScreen (Rule 3 compliance) - Removed all usleep calls from screen objects (Rule 14 compliance) App fixes exposed by tests: - ContractorsListView: added onDismiss to sheet for list refresh after save - AllTasksView: added Task.RefreshButton accessibility identifier - AccessibilityIdentifiers: added Task.refreshButton - DocumentsWarrantiesView: onDismiss handler for document list refresh - Various form views: textContentType, submitLabel, onSubmit for keyboard flow Test fixes: - PasswordResetTests: handle auto-login after reset (app skips success screen) - AuthenticatedUITestCase: refreshTasks() helper for kanban toolbar button - All pre-login suites use relaunchBetweenTests for test independence - Deleted dead code: AuthenticatedTestCase, SeededTestData, SeedTests, CleanupTests, old Suite0/2/3, Suite1_RegistrationRebuildTests 10 remaining failures: 5 iOS strong password autofill (simulator env), 3 pull-to-refresh gesture on empty lists, 2 feature coverage edge cases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
46 lines
1.9 KiB
Bash
Executable File
46 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
# Clears ALL test data from the local API server.
|
|
# Preserves superadmin accounts only.
|
|
#
|
|
# Uses the admin panel auth (separate from regular user auth).
|
|
# Default credentials: admin@honeydue.com / password123
|
|
#
|
|
# Usage:
|
|
# ./cleanup_test_data.sh # uses default admin creds
|
|
# ./cleanup_test_data.sh email password # custom creds
|
|
|
|
set -euo pipefail
|
|
|
|
API_BASE="http://127.0.0.1:8000/api"
|
|
ADMIN_EMAIL="${1:-admin@honeydue.com}"
|
|
ADMIN_PASSWORD="${2:-password123}"
|
|
|
|
echo "==> Logging into admin panel as '$ADMIN_EMAIL'..."
|
|
LOGIN_RESPONSE=$(curl -sf -X POST "$API_BASE/admin/auth/login" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{\"email\": \"$ADMIN_EMAIL\", \"password\": \"$ADMIN_PASSWORD\"}" 2>/dev/null) || {
|
|
echo "ERROR: Could not login to admin panel. Is the backend running at $API_BASE?"
|
|
echo " Has the admin seed been run? (./dev.sh seed-admin)"
|
|
exit 1
|
|
}
|
|
|
|
TOKEN=$(echo "$LOGIN_RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin)['token'])")
|
|
|
|
echo "==> Clearing all test data..."
|
|
CLEAR_RESPONSE=$(curl -sf -X POST "$API_BASE/admin/settings/clear-all-data" \
|
|
-H "Authorization: Bearer $TOKEN" \
|
|
-H "Content-Type: application/json" 2>/dev/null) || {
|
|
echo "ERROR: Clear-all-data failed."
|
|
exit 1
|
|
}
|
|
|
|
USERS_DELETED=$(echo "$CLEAR_RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin).get('users_deleted', '?'))")
|
|
PRESERVED=$(echo "$CLEAR_RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin).get('preserved_users', '?'))")
|
|
|
|
echo "==> Done! Deleted $USERS_DELETED users, preserved $PRESERVED superadmins."
|
|
echo ""
|
|
echo "To re-seed test data, run AAA_SeedTests:"
|
|
echo " xcodebuild test -project honeyDue.xcodeproj -scheme HoneyDueUITests \\"
|
|
echo " -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 17 Pro' \\"
|
|
echo " -only-testing:HoneyDueUITests/AAA_SeedTests"
|