This guide helps you create and use a test user for Firebase authentication and testing.
- Email:
test-user@your-domain.com - Password:
TestPassword123! - Display Name:
Firebase Test User - Role:
test_user - Permissions: Project access for testing
# Create test user via Firebase CLI
firebase auth:create-user \
--email "test-user@your-domain.com" \
--password "TestPassword123!" \
--display-name "Firebase Test User"-
Go to Firebase Console:
https://console.firebase.google.com/project/PROJECT_ID/authentication/users -
Sign in with test user:
- Email:
test-user@your-domain.com - Password:
TestPassword123!
- Email:
-
Verify user has proper permissions
-
Go to Firestore:
https://console.firebase.google.com/project/PROJECT_ID/firestore -
Add test collection:
- Collection ID:
test_data - Add sample documents
- Collection ID:
Document ID: item_1
Fields:
- name: "Test Item 1"
- category: "Testing"
- description: "Sample test item"
- status: "active"
Document ID: item_2
Fields:
- name: "Test Item 2"
- category: "Testing"
- description: "Another sample item"
- status: "active"
# Run the test script
./remote/test-functions-consolidated.sh# Check if functions are deployed
firebase functions:list
# Test function accessibility
curl -s -w "Status: %{http_code}\n" "https://REGION-PROJECT_ID.cloudfunctions.net/FUNCTION_NAME"# Get access token (if you have gcloud auth)
TOKEN=$(gcloud auth print-access-token)
# Test function with authentication
curl -H "Authorization: Bearer $TOKEN" \
-X POST \
-H "Content-Type: application/json" \
-d '{"param1": "value1", "param2": "value2"}' \
"https://REGION-PROJECT_ID.cloudfunctions.net/FUNCTION_NAME"- Function Logs: Check execution logs
- Firestore: Monitor processed data
- Authentication: Verify user permissions
- Read Firestore - Access test data
- Write Firestore - Add/update documents
- Execute Functions - Call deployed functions
- Access Services - Use Firebase services
- Add data to Firestore
- Trigger functions
- Monitor execution
- Test workflows
# Create user manually in Firebase Console
# Go to: Authentication > Users > Add User
# Email: test-user@your-domain.com
# Password: TestPassword123!# Check user exists
firebase auth:list --project PROJECT_ID
# Reset password if needed
firebase auth:update-user test-user@your-domain.com --password "TestPassword123!" --project PROJECT_ID- Functions are secured (this is correct)
- Use proper authentication token
- Check user permissions in Firebase Console
- Test user created in Firebase Auth
- Test data added to Firestore
- Functions return 403 (secured)
- Functions work with proper auth
- System processes data successfully
- Function logs show execution
- Firestore contains processed data
- Authentication works properly
- Workflow completes successfully
# Check functions
firebase functions:list
# Check authentication
firebase auth:list --project PROJECT_ID
# Test function access
curl -s -w "Status: %{http_code}\n" "https://REGION-PROJECT_ID.cloudfunctions.net/FUNCTION_NAME"# Create test user
firebase auth:create-user --email "test-user@your-domain.com" --password "TestPassword123!"
# Run tests
./remote/test-functions-consolidated.sh
# Run health check
./remote/health-check.sh- Service Account - Use service account instead of test user
- Proper IAM - Grant minimal required permissions
- Security Rules - Implement Firestore security rules
- Monitoring - Set up proper logging and alerts
- Backup - Regular data backups
- Use service accounts for automated operations
- Grant minimal required permissions
- Implement proper authentication
- Monitor access logs
- Use Firebase Security Rules
With the test user, you can:
- ✅ Authenticate with Firebase
- ✅ Add data to Firestore
- ✅ Call functions securely
- ✅ Monitor results in real-time
- ✅ Scale up for production use
Your Firebase project is ready for comprehensive testing with the test user!