Skip to main content

πŸ§ͺ 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)
COR Solutions MSP - Managed IT Services & Support Hitchin