Organization Setup Testing Guide
Purpose: Complete guide for testing the Organization Setup feature repeatedly
Created: 2025-08-08
Status: Complete
Overview
This guide provides comprehensive instructions for testing the Organization Setup feature, including reset procedures, test user management, and various testing scenarios.
Quick Start
Fastest Test Reset (30 seconds)
# Reset current user's onboarding status
./scripts/reset-onboarding.sh --soft
# Open browser to test
open http://localhost:3005
# Login with your existing credentials
Using Pre-Created Test Users
Three test users are available (password: test123 for all):
| Username | Purpose | Test Scenario |
|---|---|---|
test-skip |
Test skip functionality | Click "Skip for now" β Verify workspace creation |
test-upload |
Test document upload | Upload docs β Verify conversion & Claude launch |
test-complete |
Test full completion | Complete all steps β Verify knowledge base |
Test Scripts
1. Reset Script (scripts/reset-onboarding.sh)
Reset onboarding status without creating new users:
# Soft Reset - Keep user, reset onboarding only
./scripts/reset-onboarding.sh --soft
# β
Keeps user account
# β
Resets onboarding_completed to 0
# β
Clears workspace directory
# Hard Reset - Delete all user data
./scripts/reset-onboarding.sh --hard
# β οΈ Deletes all users
# β οΈ Clears all documents
# β οΈ Requires new registration
# Workspace Reset - Clear workspace only
./scripts/reset-onboarding.sh --workspace
# β
Keeps user and profile
# β
Only clears workspace files
# β
Triggers setup on next login
2. Test User Manager (scripts/test-users.js)
Manage multiple test users for different scenarios:
# Create test users quickly
node scripts/test-users.js quick
# Creates: test-skip, test-upload, test-complete
# Create individual test user
node scripts/test-users.js create testuser1 mypassword
# Reset specific user's onboarding
node scripts/test-users.js reset testuser1
# List all test users and their status
node scripts/test-users.js list
Docker Testing
If running in Docker container:
# Reset onboarding in container
docker exec sasha-test ./scripts/reset-onboarding.sh --soft
# Create test users in container
docker exec sasha-test node scripts/test-users.js quick
# Check container logs
docker logs -f sasha-test
Test Documents
Sample documents are provided in /test-docs/:
test-docs/
βββ acme-company-overview.md # Company information
βββ employee-handbook.md # HR policies & benefits
βββ product-pitch-deck.md # Investor presentation
Creating Additional Test Documents
# Create more test documents
cd test-docs
# Create a financial report
echo "# Q4 2024 Financial Report
Revenue: $120M
Growth: 85% YoY
Profit Margin: 82%" > financial-report.md
# Create a technical specification
echo "# Technical Architecture
- Microservices on Kubernetes
- PostgreSQL + Redis
- React + Node.js" > tech-spec.md
Testing Scenarios
Scenario 1: Skip Functionality
User: test-skip
Steps:
- Login with
test-skip/test123 - Organization Setup screen appears
- Click "Skip for now β" button
- Verify redirected to main workspace
- Check workspace created:
ls ~/.claude/projects/default-workspace - Go to Settings β Organization tab
- Click "Launch Organization Setup"
- Verify setup screen reappears
Expected Results:
- Workspace created even when skipped
- Can re-access from Settings
- Database shows
onboarding_completed = 1
Scenario 2: Document Upload & Processing
User: test-upload
Steps:
- Login with
test-upload/test123 - Drag & drop files from
/test-docs/ - Watch file upload confirmation
- Click "Process Documents & Launch Sasha"
- Monitor processing animation
- Verify Claude auto-launches with research prompt
- Check converted files in workspace
Verification Commands:
# Check converted documents
ls -la ~/.claude/projects/default-workspace/docs/local/
# View document index
cat ~/.claude/projects/default-workspace/docs/local/index.md
# Check CLAUDE.md was created
cat ~/.claude/projects/default-workspace/CLAUDE.md
Scenario 3: Complete Flow with Company Details
User: test-complete
Steps:
- Login with
test-complete/test123 - Upload multiple documents
- Wait for processing
- On review screen, enter:
- Company Name: "Acme Corporation"
- Website: "https://acmecorp.example.com"
- Industry: "Technology"
- Click "Complete Setup & Enter Workspace"
- Verify Claude launches with detailed prompt
- Check knowledge base creation
Scenario 4: Re-Access from Settings
Prerequisites: User has already completed/skipped setup
Steps:
- Login to existing account
- Navigate to Settings (gear icon)
- Click "Organization" tab
- Review organization information
- Click "Launch Organization Setup"
- Verify setup screen appears
- Can upload new documents or skip again
Browser Testing Tools
Developer Console Commands
// Force show Organization Setup
sessionStorage.setItem('showOrganizationSetup', 'true');
location.reload();
// Check onboarding status
console.log(sessionStorage.getItem('organizationResearchPrompt'));
// Clear all session data
sessionStorage.clear();
localStorage.removeItem('auth-token');
location.reload();
// Simulate document upload completion
sessionStorage.setItem('organizationResearchPrompt',
'Research Acme Corporation using uploaded documents...');
Network Monitoring
- Open Chrome DevTools β Network tab
- Filter by "Fetch/XHR"
- Monitor these endpoints:
POST /api/profile/organization/skipPOST /api/profile/organization/completeGET /api/profile/onboarding/status/:jobId
Database Verification
Check User Status
# View all users and onboarding status
sqlite3 server/database/auth.db "
SELECT
u.id,
u.username,
cp.onboarding_completed,
cp.company_name,
cp.onboarding_method
FROM users u
LEFT JOIN company_profiles cp ON u.id = cp.user_id
ORDER BY u.id DESC;"
# Check uploaded documents
sqlite3 server/database/auth.db "
SELECT
original_name,
document_category,
file_size,
upload_date
FROM onboarding_documents
ORDER BY upload_date DESC;"
Reset Specific User
-- Reset onboarding for specific user
UPDATE company_profiles
SET onboarding_completed = 0,
onboarding_method = NULL
WHERE user_id = (SELECT id FROM users WHERE username = 'testuser');
-- Clear user's documents
DELETE FROM onboarding_documents
WHERE user_id = (SELECT id FROM users WHERE username = 'testuser');
Workspace Verification
Check Workspace Structure
# View workspace tree
tree ~/.claude/projects/default-workspace/
# Expected structure:
# default-workspace/
# βββ CLAUDE.md
# βββ docs/
# βββ guides/
# β βββ organization-research-guide.md
# βββ local/
# β βββ README.md
# β βββ index.md
# β βββ [converted documents]
# βββ organization/
# βββ [AI-generated docs]
Verify Document Conversion
# List converted documents
find ~/.claude/projects/default-workspace/docs/local -name "*.md" -type f
# Check document content
head -20 ~/.claude/projects/default-workspace/docs/local/*/*.md
# Verify categories
ls ~/.claude/projects/default-workspace/docs/local/
# Should show: pitch_deck, employee_handbook, general, etc.
Automated Testing
Continuous Test Script
Create test-cycle.sh:
#!/bin/bash
# Automated test cycle
echo "π Starting automated test cycle..."
# Test 1: Skip flow
echo "Test 1: Skip functionality"
./scripts/reset-onboarding.sh --soft
echo "Login as test-skip and click Skip"
read -p "Press enter when complete..."
# Test 2: Upload flow
echo "Test 2: Document upload"
node scripts/test-users.js reset test-upload
echo "Login as test-upload and upload docs"
read -p "Press enter when complete..."
# Test 3: Complete flow
echo "Test 3: Full completion"
node scripts/test-users.js reset test-complete
echo "Login as test-complete and complete all steps"
read -p "Press enter when complete..."
echo "β
Test cycle complete!"
Watch for Changes
# Monitor workspace creation in real-time
watch -n 1 'ls -la ~/.claude/projects/default-workspace/docs/local/ 2>/dev/null || echo "No workspace yet"'
# Monitor database changes
watch -n 2 'sqlite3 server/database/auth.db "SELECT username, onboarding_completed FROM users u LEFT JOIN company_profiles cp ON u.id = cp.user_id"'
Troubleshooting
Common Issues
| Issue | Solution |
|---|---|
| Onboarding doesn't show | Run ./scripts/reset-onboarding.sh --soft |
| Documents won't upload | Check uploads/onboarding/ permissions: chmod 755 uploads/onboarding |
| Claude doesn't auto-launch | Clear sessionStorage in browser console |
| Processing stuck | Check server logs: docker logs sasha-test |
| Workspace not created | Verify disk space and permissions in ~/.claude/projects/ |
| Settings shows wrong state | Hard refresh browser: Cmd+Shift+R (Mac) |
Debug Commands
# Check server logs
docker logs -f sasha-test --tail 100
# Monitor file uploads
ls -la uploads/onboarding/
# Check WebSocket connection
curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" http://localhost:3005/ws
# Verify API endpoints
curl -X POST http://localhost:3005/api/profile/organization/skip \
-H "Authorization: Bearer YOUR_TOKEN"
Testing Checklist
Pre-Setup
- Server running (
docker psornpm run dev) - Test users created (
node scripts/test-users.js list) - Test documents available (
ls test-docs/) - Database accessible (
sqlite3 server/database/auth.db .tables)
Organization Setup Screen
- Displays for new users
- Skip button visible and functional
- Drag & drop zone accepts files
- Multiple file upload works
- File type validation works
- Privacy messaging displays
- Document categories show correctly
Processing
- Upload progress shows
- Processing animation displays
- Status updates work
- Error handling for failed uploads
- Successful completion message
Post-Setup
- Workspace created at correct path
- Documents converted to Markdown
- CLAUDE.md generated with context
- Document index created
- Claude auto-launches with prompt
- Database updated correctly
Settings Integration
- Organization tab appears in Settings
- Shows current organization info
- "Launch Organization Setup" button works
- Returns to main app after completion
Edge Cases
- Empty file upload handling
- Very large file handling (>50MB)
- Unsupported file type rejection
- Network interruption recovery
- Concurrent user setup
Performance Testing
Load Testing
# Upload multiple files simultaneously
for i in {1..10}; do
cp test-docs/acme-company-overview.md test-docs/test-$i.md
done
# Monitor processing
time curl -X POST http://localhost:3005/api/profile/organization/complete \
-H "Authorization: Bearer TOKEN" \
-F "documents=@test-docs/test-1.md" \
-F "documents=@test-docs/test-2.md" \
-F "documents=@test-docs/test-3.md"
Memory Usage
# Monitor Node.js memory usage
docker stats sasha-test
# Check workspace size
du -sh ~/.claude/projects/default-workspace/
Best Practices
- Always reset between tests to ensure clean state
- Use different test users for different scenarios
- Monitor server logs during testing
- Verify database state after each test
- Check workspace structure for proper file organization
- Test with various file types and sizes
- Document any issues found during testing
Quick Reference
# Most common test commands
./scripts/reset-onboarding.sh --soft # Reset current user
node scripts/test-users.js quick # Create test users
node scripts/test-users.js list # List test users
docker logs -f sasha-test # Watch server logs
open http://localhost:3005 # Open app
# One-liner test reset
./scripts/reset-onboarding.sh --soft && open http://localhost:3005
This testing guide ensures you can efficiently and repeatedly test the Organization Setup feature with confidence.