ChatFlow Platform - Comprehensive Testing Guide β
Last Updated: March 22, 2026
Version: 1.0.0
Status: β
All Services Running
π Table of Contents β
- Quick Start
- Test Users & Credentials
- Service Endpoints
- API Testing
- UI Testing
- Integration Testing
- End-to-End User Flows
- Troubleshooting
π Quick Start β
Prerequisites β
- Docker and Docker Compose running
- All services started:
docker-compose up -d - PowerShell or bash terminal
Verify Services Are Running β
docker ps --filter name=chatflow --format "table {{.Names}}\t{{.Status}}"Access Points β
| Service | URL | Purpose |
|---|---|---|
| Admin Portal | http://localhost:4210 | Administrative dashboard |
| User Portal | http://localhost:4220 | End-user chat interface |
| API Gateway | http://localhost:5000 | Reverse proxy to all APIs |
| Auth API | http://localhost:5001 | Authentication service |
| Chat API | http://localhost:5002 | Conversation management |
| AI Service | http://localhost:8000 | AI chat integration |
| AI Docs | http://localhost:8000/docs | FastAPI Swagger UI |
| MailHog | http://localhost:8025 | Dev email catcher |
π₯ Test Users & Credentials β
Admin User β
{
"email": "admin@chatflow.com",
"password": "Admin123!@#",
"firstName": "System",
"lastName": "Administrator",
"role": "Admin"
}Agent User β
{
"email": "agent@chatflow.com",
"password": "Agent123!@#",
"firstName": "Support",
"lastName": "Agent",
"role": "User"
}Test Customer β
{
"email": "customer@example.com",
"password": "Customer123!@#",
"firstName": "Test",
"lastName": "Customer",
"role": "User"
}Infrastructure Services β
| Service | Note |
|---|---|
| PostgreSQL | shared-postgres β credentials in .env |
| Redis | shared-redis β credentials in .env |
π Service Endpoints β
Authentication Service (Port 5001) β
OpenAPI Spec: http://localhost:5001/openapi/v1.json
Available Endpoints: β
POST /api/v1/Auth/register - Register new user
POST /api/v1/Auth/login - User login
POST /api/v1/Auth/refresh - Refresh JWT token
POST /api/v1/Auth/logout - User logout
POST /api/v1/Auth/verify-email - Verify email address
POST /api/v1/Auth/forgot-password - Request password reset
POST /api/v1/Auth/reset-password - Reset password with token
GET /api/v1/Auth/me - Get current user profile
GET /health - Health checkConversation Service (Port 5002) β
Available Endpoints: β
POST /api/conversations - Create new conversation
GET /api/conversations/{id} - Get conversation by ID
GET /api/conversations - List conversations (paginated)
POST /api/conversations/{id}/close - Close conversation
POST /api/messages - Send message in conversation
GET /api/messages/{id} - Get message by ID
GET /api/widgets - List chat widgets
POST /api/widgets - Create chat widget
GET /health - Health checkAPI Gateway (Port 5000) β
Routes: YARP reverse proxy to Auth (5001) and Chat (5002) services
/auth/* β http://auth-service:5001/*
/chat/* β http://chat-service:5002/*
/ai/* β http://ai-service:8000/*AI Service (Port 8000) β
Interactive Docs: http://localhost:8000/docs
Available Endpoints: β
POST /chat/completions - Get AI chat completion
POST /chat/stream - Stream AI responses
GET /models - List available AI models
GET /health - Health check
GET / - Service infoπ§ͺ API Testing β
Step 1: Register Test Users β
Using PowerShell: β
# Register Admin
$admin = @{
email = "admin@chatflow.com"
password = "Admin123!@#"
firstName = "System"
lastName = "Administrator"
} | ConvertTo-Json
$response = Invoke-RestMethod `
-Uri http://localhost:5001/api/v1/Auth/register `
-Method Post `
-Body $admin `
-ContentType "application/json"
Write-Host "Admin registered: $($response.email)"Using cURL: β
curl -X POST http://localhost:5001/api/v1/Auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "admin@chatflow.com",
"password": "Admin123!@#",
"firstName": "System",
"lastName": "Administrator"
}'Step 2: Login and Get JWT Token β
PowerShell: β
$loginData = @{
email = "admin@chatflow.com"
password = "Admin123!@#"
} | ConvertTo-Json
$loginResponse = Invoke-RestMethod `
-Uri http://localhost:5001/api/v1/Auth/login `
-Method Post `
-Body $loginData `
-ContentType "application/json"
$token = $loginResponse.accessToken
Write-Host "JWT Token: $token"
# Store token for subsequent requests
$headers = @{
"Authorization" = "Bearer $token"
"Content-Type" = "application/json"
}cURL: β
curl -X POST http://localhost:5001/api/v1/Auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "admin@chatflow.com",
"password": "Admin123!@#"
}' \
-c cookies.txt
# Use the token from response in subsequent requestsStep 3: Test Authenticated Endpoints β
Get User Profile: β
$profile = Invoke-RestMethod `
-Uri http://localhost:5001/api/v1/Auth/me `
-Method Get `
-Headers $headers
Write-Host "User: $($profile.firstName) $($profile.lastName)"
Write-Host "Role: $($profile.role)"Step 4: Test Chat Service β
Create Conversation: β
$conversation = @{
widgetId = "00000000-0000-0000-0000-000000000001"
visitorId = "visitor-001"
metadata = @{
source = "web"
page = "/home"
}
} | ConvertTo-Json
$conv = Invoke-RestMethod `
-Uri http://localhost:5002/api/conversations `
-Method Post `
-Body $conversation `
-Headers $headers `
-ContentType "application/json"
Write-Host "Conversation created: $($conv.id)"Step 5: Test AI Service β
Get AI Completion: β
$aiRequest = @{
model = "gpt-3.5-turbo"
messages = @(
@{
role = "user"
content = "Hello, how can you help me today?"
}
)
} | ConvertTo-Json -Depth 10
$aiResponse = Invoke-RestMethod `
-Uri http://localhost:8000/chat/completions `
-Method Post `
-Body $aiRequest `
-ContentType "application/json"
Write-Host "AI Response: $($aiResponse.choices[0].message.content)"π¨ UI Testing β
Admin Portal Testing Steps β
1. Access Admin Portal β
- Navigate to http://localhost:4210
- Should see ChatFlow Admin Portal login screen
2. Login β
- Enter credentials:
admin@chatflow.com/Admin123!@# - Click "Sign In"
- Should redirect to dashboard
3. Dashboard Verification β
Check that the following are visible:
- [ ] Navigation menu (sidebar or top bar)
- [ ] User profile/avatar
- [ ] Dashboard widgets/statistics
- [ ] Recent conversations list
4. Test Navigation β
Navigate through all sections:
- [ ] Dashboard
- [ ] Conversations
- [ ] Widgets
- [ ] Users/Team
- [ ] Settings
- [ ] Analytics (if available)
5. Widget Management β
- [ ] View existing widgets
- [ ] Create new widget
- [ ] Edit widget settings
- [ ] Test widget embed code
6. Conversation Management β
- [ ] View conversation list
- [ ] Open conversation details
- [ ] View message history
- [ ] Close/resolve conversation
- [ ] Add internal notes
User Portal Testing Steps β
1. Access User Portal β
- Navigate to http://localhost:4220
- Should see ChatFlow User Portal
2. Customer Experience β
- [ ] Chat widget visible on page
- [ ] Click to open chat
- [ ] Send test message
- [ ] Receive response
- [ ] Upload file (if supported)
- [ ] Rate conversation
3. Real-time Testing β
- Open Admin Portal in one browser tab
- Open User Portal in another tab
- Send message from User Portal
- Verify message appears in Admin Portal in real-time
π Integration Testing β
End-to-End Flow Testing β
Scenario 1: New Customer Conversation β
Objective: Test complete flow from customer initiation to agent response
Customer Side (User Portal - Port 4220)
- Open User Portal
- Click chat widget
- Enter name and email
- Send message: "I need help with my account"
- Expected: Message sent, waiting indicator shown
Agent Side (Admin Portal - Port 4210)
- Login as agent
- Navigate to "Active Conversations"
- Expected: See new conversation appear
- Click on conversation
- Expected: See customer message
- Type response: "Hello! I'd be happy to help. What specifically do you need assistance with?"
- Send message
- Expected: Message sent successfully
Customer Side (Verification)
- Expected: Agent response appears in chat
- Send reply: "I can't access my dashboard"
- Expected: Message sent
Agent Side (Verification)
- Expected: Customer reply appears
- Send help instructions
- Close conversation
- Expected: Conversation marked as resolved
Scenario 2: AI-Assisted Response β
Objective: Test AI service integration
Setup:
- Login as agent
- Open any conversation
AI Integration:
- Click "AI Assist" or similar button
- Expected: AI suggests response
- Review suggestion
- Edit if needed
- Send to customer
- Expected: Response sent successfully
Verification:
- Check that AI usage is logged
- Verify token consumption (if tracked)
Scenario 3: Multi-Channel Support β
Objective: Test different communication channels
Widget Channel:
- Create conversation via widget
- Verify it appears in admin portal
Direct Message:
- Use API to create conversation
- Verify it appears in admin portal
Verification:
- All channels show correct source
- Messages are properly threaded
π Performance Testing β
Load Testing Scenarios β
1. Concurrent Users Test β
# Create 10 concurrent user registrations
1..10 | ForEach-Object -Parallel {
$user = @{
email = "testuser$_@example.com"
password = "Test123!@#"
firstName = "Test"
lastName = "User$_"
} | ConvertTo-Json
Invoke-RestMethod `
-Uri http://localhost:5001/api/v1/Auth/register `
-Method Post `
-Body $user `
-ContentType "application/json"
} -ThrottleLimit 10
Write-Host "10 users registered concurrently"2. Message Throughput Test β
# Send 50 messages rapidly
$token = "YOUR_JWT_TOKEN"
$conversationId = "YOUR_CONVERSATION_ID"
1..50 | ForEach-Object {
$message = @{
conversationId = $conversationId
content = "Test message $_"
type = "text"
} | ConvertTo-Json
Invoke-RestMethod `
-Uri http://localhost:5002/api/messages `
-Method Post `
-Body $message `
-Headers @{ "Authorization" = "Bearer $token" } `
-ContentType "application/json"
}Expected Performance Metrics β
| Metric | Target | Acceptable |
|---|---|---|
| Login Response Time | < 200ms | < 500ms |
| Message Send Time | < 100ms | < 300ms |
| AI Response Time | < 2s | < 5s |
| WebSocket Latency | < 50ms | < 150ms |
| Concurrent Users | 100+ | 50+ |
π Health Checks β
Verify All Services Healthy β
$services = @{
"Auth" = "http://localhost:5001/health"
"Chat" = "http://localhost:5002/health"
"AI" = "http://localhost:8000/health"
}
foreach ($service in $services.GetEnumerator()) {
try {
$health = Invoke-RestMethod -Uri $service.Value -TimeoutSec 2
Write-Host "β $($service.Key): $health" -ForegroundColor Green
} catch {
Write-Host "β $($service.Key): FAILED" -ForegroundColor Red
}
}Database Verification β
# Test PostgreSQL connection
docker exec chatflow-postgres psql -U chatflow -d chatflow -c "SELECT version();"
# List all schemas
docker exec chatflow-postgres psql -U chatflow -d chatflow -c "\dn"
# Check table counts
docker exec chatflow-postgres psql -U chatflow -d chatflow -c "
SELECT schemaname, tablename
FROM pg_tables
WHERE schemaname IN ('auth', 'chat', 'billing', 'analytics', 'integrations');"Redis Verification β
docker exec chatflow-redis redis-cli PING
# Expected: PONG
docker exec chatflow-redis redis-cli INFO stats
# Shows connection and command statisticsπ Troubleshooting β
Common Issues β
Issue: 401 Unauthorized on API calls β
Solution:
- Verify JWT token is valid and not expired
- Check token is included in Authorization header
- Ensure token format:
Bearer YOUR_TOKEN
Issue: CORS errors in browser β
Solution:
- Check CORS configuration in service Program.cs
- Add frontend origin to allowed origins:
CORS:AllowedOrigins=http://localhost:4210,http://localhost:4220
Issue: WebSocket connection failed β
Solution:
- Verify SignalR hub is running: check
/chat-hubendpoint - Check browser console for connection errors
- Ensure proper authentication for WebSocket connection
Issue: Messages not appearing in real-time β
Solution:
- Check Redis Streams connection in service logs
- Verify SignalR connection established
- Check browser console for errors
Issue: AI service not responding β
Solution:
- Verify AI service environment variables set:
OPENAI_API_KEYANTHROPIC_API_KEY
- Check AI service logs:
docker logs chatflow-ai-service - Ensure AI provider API keys are valid
Service Logs β
# View logs for specific service
docker logs chatflow-auth-service --tail 50 --follow
# View all logs
docker-compose logs -f
# View logs for specific time range
docker logs chatflow-chat-service --since 10mπ Test Checklist β
Pre-Deployment Testing β
- [ ] All services start without errors
- [ ] Health endpoints return "Healthy"
- [ ] Database migrations applied successfully
- [ ] Redis connection established (shared-redis DB 1)
Authentication Testing β
- [ ] User registration works
- [ ] Login returns valid JWT token
- [ ] Token refresh works
- [ ] Logout invalidates token
- [ ] Password reset flow works
- [ ] Email verification works (if SMTP configured)
Chat Functionality Testing β
- [ ] Create conversation
- [ ] Send text message
- [ ] Send file/attachment
- [ ] Receive real-time notifications
- [ ] Close/resolve conversation
- [ ] Retrieve conversation history
Admin Portal Testing β
- [ ] Login as admin
- [ ] View dashboard statistics
- [ ] Manage conversations
- [ ] Manage widgets
- [ ] Manage users/team
- [ ] View analytics
User Portal Testing β
- [ ] Chat widget loads
- [ ] Send messages as visitor
- [ ] Receive agent responses
- [ ] Rate conversation
- [ ] View conversation history
Integration Testing β
- [ ] Auth + Chat integration
- [ ] Chat + AI integration
- [ ] Real-time sync between portals
- [ ] File upload to Cloudflare R2
- [ ] Redis Streams message processing
π― Success Criteria β
β Platform is Production-Ready When:
- All services start and pass health checks
- Users can register and login successfully
- Conversations can be created and managed
- Real-time messaging works bidirectionally
- AI responses are generated correctly
- Admin portal displays all data correctly
- User portal provides smooth customer experience
- No critical errors in logs
- Performance metrics meet targets
- All integration tests pass
π Support & Feedback β
Documentation: See /docs folder for detailed guides
Architecture: See ARCHITECTURE.md for system design
API Reference: Check OpenAPI specs at /openapi/v1.json endpoints
Test Results: Document your findings and report any issues
Happy Testing! π