π§ͺ SmartBot Enterprise v2.0 Test Environment
Safe testing page for new enterprise chatbot
This page is NOT indexed by search engines
π Test Checklist
1. Initial Load
- β Chatbot bubble appears in bottom right
- β Clicking bubble opens chat window
- β Greeting message displays correctly
- β UI looks professional and clean
2. Session Management
- β Session created automatically on first open
- β Check browser DevTools β Application β Local Storage
- β Should see
smartbot_session - β Contains sessionId, accessToken, refreshToken, expiresAt
3. Messaging
- β Type a message (e.g., βHello, I need IT supportβ)
- β Message appears in chat on right side (green)
- β AI response appears on left side (gray)
- β Response is relevant and helpful
- β Send 2-3 more messages to test conversation flow
4. AI Caching
- β Ask same question twice (e.g., βWhat services do you offer?β)
- β Second response should show ββ‘ Cached responseβ
- β Second response should be instant (no API delay)
5. Conversation Persistence
- β Send a few messages, then close chatbot
- β Refresh the page (F5)
- β Reopen chatbot - conversation should restore
- β All previous messages should still be there
6. Reset Conversation
- β Click reset button (β») in header
- β Conversation should clear
- β New session created (check localStorage)
- β Greeting message appears again
7. Error Handling
- β Open DevTools β Network tab
- β Toggle offline mode
- β Try sending a message
- β Should show error message gracefully
- β Toggle online and retry - should work
8. Security Indicators
- β Footer shows βπ Encrypted β’ Enterprise Securityβ
- β Check DevTools β Network β /api/chat/send
- β Request should have Authorization header with Bearer token
- β Response should NOT contain raw PII
ποΈ Database Verification
After testing, verify data in PostgreSQL:
-- Connect to database
psql $DATABASE_URL
-- Check sessions table
SELECT session_id, created_at, expires_at
FROM sessions
ORDER BY created_at DESC
LIMIT 5;
-- Check conversations table
SELECT conversation_id, session_id, message_count, created_at
FROM conversations
ORDER BY created_at DESC
LIMIT 5;
-- Check messages table
SELECT message_id, conversation_id, role,
LEFT(content, 50) as preview, created_at
FROM messages
ORDER BY created_at DESC
LIMIT 10;
-- Check AI cache performance
SELECT
COUNT(*) as total_cached,
SUM(hit_count) as total_hits,
AVG(tokens_saved) as avg_tokens_saved
FROM ai_response_cache;π§ API Endpoint Testing
Test API endpoints directly in DevTools Console:
// 1. Create session
const sessionRes = await fetch('/api/auth/session', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
});
const session = await sessionRes.json();
console.log('Session created:', session);
// 2. Send message
const chatRes = await fetch('/api/chat/send', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${session.accessToken}`
},
body: JSON.stringify({
message: 'What IT services do you offer?',
conversationId: session.session.conversationId
})
});
const chat = await chatRes.json();
console.log('Chat response:', chat);
// 3. Get conversation
const convRes = await fetch(`/api/conversations/${chat.conversationId}`, {
headers: {
'Authorization': `Bearer ${session.accessToken}`
}
});
const conv = await convRes.json();
console.log('Conversation:', conv);β Ready for Production?
The SmartBot is ready for production if:
- βAll 8 test sections pass without errors
- βSession management works correctly
- βAI responses are relevant and helpful
- βCaching works (β‘ appears on repeated questions)
- βConversation persists across page refreshes
- βDatabase tables populated correctly
- βNo console errors in DevTools
- βSecurity indicators visible (π Encrypted)