Testing Guide - Login & Dashboard
🚀 Quick Start
1. Start the Server
python -m uvicorn main:app --reload
2. Open Your Browser
Go to: http://127.0.0.1:8000
✅ Manual Testing Steps
Test 1: Home Page Redirect
- Visit
http://127.0.0.1:8000/
- Expected: Automatically redirected to
/login
- Result: ✅ Should see login page
Test 2: Login Page
- Visit
http://127.0.0.1:8000/login
- Expected: See “Month End Automator” login page
- Check:
- Left panel: Logo and description
- Right panel: Login form with Username/Password fields
- Green “Sign In” button
- Result: ✅ Login page should load
Test 3: Failed Login
- On login page, enter:
- Username:
admin
- Password:
wrongpassword
- Click “Sign In”
- Expected: Error message: “Invalid username or password”
- Result: ✅ Error message displayed
Test 4: Successful Login
- On login page, enter:
- Username:
amina
- Password:
amina0000
- Click “Sign In”
- Expected: Redirected to
/dashboard
- Result: ✅ Dashboard should load
Test 5: Dashboard Access
- After login, you should see the dashboard
- Check:
- Header: “Month End Automator” logo and “Welcome, admin!”
- Statistics cards: Total Transactions, Total Amount, Reports Generated, Files Processed
- Upload section: File upload area
- Recent Reports: List of recent Excel reports
- Result: ✅ Dashboard displays correctly
Test 6: File Upload from Dashboard
- On dashboard, click “Choose File”
- Select
test_transactions.csv
- Click “Upload & Process”
- Expected:
- File processed
- Success message shown
- Excel report generated
- File appears in Recent Reports
- Result: ✅ File uploaded and processed
Test 7: Dashboard Protection (No Auth)
- Open a new incognito/private window
- Try to visit
http://127.0.0.1:8000/dashboard
- Expected: Redirected to
/login or shown error
- Result: ✅ Dashboard protected
Test 8: Logout
- On dashboard, click “Logout” button
- Expected: Redirected to
/login
- Result: ✅ Logged out successfully
Test 9: API Endpoints (No Auth)
- Visit
http://127.0.0.1:8000/health
- Expected: JSON response:
{"status": "healthy", ...}
- Result: ✅ API accessible without auth
Test 10: Login Verification
- Logout
- Verify login works with:
- Username:
amina / Password: amina0000
- Expected: Login successful
- Result: ✅ Login works correctly
🔑 Test Credentials
📝 Test Checklist
🐛 Troubleshooting
Server Not Starting
- Check if port 8000 is already in use
- Try:
python -m uvicorn main:app --reload --port 8001
Routes Not Found (404)
- Make sure server is running with
--reload
- Check
templates/login.html and templates/dashboard.html exist
- Verify
main.py has all route definitions
Login Not Working
- Check browser console for errors
- Verify session cookies are enabled
- Check server logs for errors
Dashboard Not Loading
- Make sure you’re logged in
- Check browser console for errors
- Verify session is maintained
✅ Expected Results
After completing all tests, you should see:
- ✅ Login page with beautiful UI
- ✅ Dashboard with statistics and file upload
- ✅ Secure authentication
- ✅ File processing works from dashboard
- ✅ Recent reports tracking