8.7 KiB
Testing Guide
Quick Start
- Start the development server:
npm run dev
- Open your browser: Navigate to http://localhost:3000
Test Scenarios
Scenario 1: Admin Login & System Setup
Login:
- Email:
admin@muller.com - Password:
admin123 - User Type: Admin
What to test:
- ✅ View dashboard statistics
- ✅ Navigate to Teams page
- ✅ Navigate to Workers page
- ✅ Navigate to Managers page
- ✅ Navigate to Machines page
- ✅ Verify all 4 teams are listed
- ✅ Verify all 36 workers are listed
- ✅ Verify all 4 shift managers are listed
- ✅ Verify all 7 machines are listed
- ✅ Test logout functionality
Scenario 2: Shift Manager - Create Shift
Login:
- Email:
james.anderson@muller.com - Password:
muller123 - User Type: Shift Manager
What to test:
- ✅ View shift manager dashboard
- ✅ Navigate to "Create Shift" page
- ✅ Select shift type (AM or PM)
- ✅ Select today's date
- ✅ Select "Red Team"
- ✅ Assign 7 operators to the 7 machines:
- T1: David Wilson (RED-OP1)
- T2: Robert Brown (RED-OP2)
- T3: William Davis (RED-OP3)
- T4: Richard Miller (RED-OP4)
- T5: Joseph Moore (RED-OP5)
- T6: Thomas Taylor (RED-OP6)
- T7: Charles Jackson (RED-OP7)
- ✅ Click "Create Shift"
- ✅ Verify shift appears in "Shifts" page
- ✅ Verify shift status is "Active"
- ✅ Test logout
Scenario 3: Operator - View Active Shift
Login:
- Email:
david.wilson.red@muller.com - Password:
muller123 - User Type: Operator
What to test:
- ✅ View operator dashboard
- ✅ Verify active shift is displayed
- ✅ Verify shift details (date, team, machine, shift time)
- ✅ Click "Open Report" button
- ✅ Verify report page loads with basic info section
Scenario 4: Operator - Fill Out Report
Prerequisites: Complete Scenario 2 & 3 first
Login: Same as Scenario 3
What to test:
A. Safety Checklist
- ✅ Check all 6 safety items
- ✅ Click "Save"
- ✅ Verify data persists after page refresh
B. Production Pre-Checks
- ✅ Enter Wall Thickness values (Top, Label Panel, Base, Neck)
- ✅ Enter Section Weights values
- ✅ Enter Station 1 Weights values
- ✅ Click "Save"
- ✅ Verify data persists
C. Production Parameters
- ✅ Click "Add Hourly Temperature Parameters"
- ✅ Enter Melt Temp (e.g., 220)
- ✅ Enter Reg % (default 35.5)
- ✅ Enter Head PSI (e.g., 150)
- ✅ Click "Add"
- ✅ Verify entry appears in table
- ✅ Add 2-3 more entries
- ✅ Verify all entries are displayed
D. Bottle Weight Tracking
- ✅ Click "Add Weight Tracking"
- ✅ Enter weights for 4 bottles (e.g., 33.8, 34.1, 34.0, 33.9)
- ✅ Click "Add"
- ✅ Verify chart updates with new data point
- ✅ Verify average is calculated automatically
- ✅ Add 2-3 more entries
- ✅ Verify chart shows trend lines (average, upper/lower limits, target)
E. Hourly Quality Checks
- ✅ Click "Add Quality Check"
- ✅ Check relevant inspection items
- ✅ Enter Base Weight and Neck Weight
- ✅ Click "Add"
- ✅ Verify entry appears in table
F. Production Tracking
- ✅ Click "Add Production Tracking"
- ✅ Enter Hour (e.g., "8:00 AM")
- ✅ Enter Total Production This Shift
- ✅ Enter Production This Hour
- ✅ Add optional comment
- ✅ Click "Add"
- ✅ Verify entry appears in table
G. Seam Leak Test
- ✅ Click "Add Seam Leak Test"
- ✅ Enter time
- ✅ Click "Add Mould" button
- ✅ Enter Mould Number (e.g., 5)
- ✅ Select Pass/Fail
- ✅ Add 2-3 more moulds
- ✅ Click "Save Test"
- ✅ Verify test appears with all moulds
H. Film Details
- ✅ Click "Add New Film"
- ✅ Enter Width
- ✅ Enter Roll Number
- ✅ Enter Product Code
- ✅ Enter Pallet Number
- ✅ Click "Add"
- ✅ Verify film entry appears in table
I. Production Data
- ✅ Verify Average Weight is auto-calculated
- ✅ Enter Total Bags Made
- ✅ Enter Quality Metrics (Height fails, Top Load fails, etc.)
- ✅ Enter Output Metrics (Wheel Output, Total Good Bottles, etc.)
- ✅ Click "Save"
- ✅ Verify data persists
Scenario 5: Multiple Teams & Shifts
Test concurrent operations:
-
✅ Login as Green Team manager (sarah.mitchell@muller.com / muller123)
-
✅ Create a shift for Green Team
-
✅ Assign Green Team operators
-
✅ Logout
-
✅ Login as Green Team operator (daniel.white.green@muller.com / muller123)
-
✅ Verify active shift appears
-
✅ Open report and add some data
-
✅ Logout
-
✅ Login as Red Team operator (david.wilson.red@muller.com / muller123)
-
✅ Verify only Red Team shift appears (not Green Team)
-
✅ Verify report data is separate from Green Team
Scenario 6: Shift Closure & Archive
Prerequisites: Complete Scenario 2
Login as Shift Manager:
- Email:
james.anderson@muller.com - Password:
muller123
What to test:
- ✅ Navigate to "Shifts" page
- ✅ Find the active shift
- ✅ (Note: Shift closure functionality needs to be implemented)
- ✅ After closure, verify shift status changes to "Closed"
Login as Operator:
- Email:
david.wilson.red@muller.com - Password:
muller123
What to test:
- ✅ Verify closed shift no longer appears in "Active Shifts"
- ✅ Navigate to "Shifts Archive"
- ✅ Verify closed shift appears in archive
- ✅ Verify report is read-only (cannot edit)
Test Data Summary
Admin
- 1 account with full system access
Shift Managers (4)
- Red Team: james.anderson@muller.com
- Green Team: sarah.mitchell@muller.com
- Blue Team: michael.thompson@muller.com
- Yellow Team: emma.roberts@muller.com
- All passwords: muller123
Operators (28 total - 7 per team)
- Red Team: david.wilson.red@muller.com (and 6 more)
- Green Team: daniel.white.green@muller.com (and 6 more)
- Blue Team: andrew.rodriguez.blue@muller.com (and 6 more)
- Yellow Team: ronald.king.yellow@muller.com (and 6 more)
- All passwords: muller123
Machines (7)
- T1, T2, T3, T4, T5, T6, T7
Expected Behaviors
Authentication
- ✅ Invalid credentials show error message
- ✅ Successful login redirects to role-specific dashboard
- ✅ Logout returns to login page
- ✅ Protected routes redirect to login if not authenticated
Data Persistence
- ✅ All form data saves to database
- ✅ Data persists after page refresh
- ✅ Data persists after logout/login
Role-Based Access
- ✅ Admin can access admin pages only
- ✅ Shift Manager can access shift manager pages only
- ✅ Operator can access operator pages only
- ✅ Users cannot access other roles' pages
Shift Assignment
- ✅ Operators only see shifts they're assigned to
- ✅ Operators only see reports for their assigned machine
- ✅ Multiple operators can work simultaneously on different machines
Data Isolation
- ✅ Each operator's report is separate
- ✅ Each shift's data is separate
- ✅ Teams' data is isolated from each other
Known Issues / Future Enhancements
- Shift Closure: Need to implement shift closure functionality for shift managers
- Password Reset: No password reset functionality yet
- Email Notifications: Not implemented
- PDF Export: Report PDF export not implemented
- Real-time Updates: No WebSocket for real-time collaboration
- Mobile App: Web-only, no native mobile app
- Advanced Analytics: No analytics dashboard yet
Performance Testing
Load Testing Scenarios
- ✅ Create 10+ shifts
- ✅ Add 50+ report entries
- ✅ Test with multiple concurrent users
- ✅ Test chart rendering with large datasets
- ✅ Test database query performance
Browser Compatibility
- ✅ Chrome
- ✅ Firefox
- ✅ Safari
- ✅ Edge
- ✅ Mobile browsers (iOS Safari, Chrome Mobile)
Troubleshooting
Cannot Login
- Verify database is running
- Check DATABASE_URL in .env
- Verify seed data was created successfully
- Check browser console for errors
Data Not Saving
- Check browser console for API errors
- Verify Prisma client is generated
- Check database connection
- Verify API routes are working
Charts Not Displaying
- Verify recharts is installed
- Check browser console for errors
- Verify data format is correct
- Test with sample data
Shift Not Appearing for Operator
- Verify shift was created for today's date
- Verify operator is assigned to the shift
- Verify shift status is "active"
- Check database records
Success Criteria
✅ All user roles can login successfully ✅ Admin can view and manage all system entities ✅ Shift managers can create and manage shifts ✅ Operators can view assigned shifts ✅ Operators can fill out complete reports ✅ All data persists correctly ✅ Charts display correctly ✅ Role-based access control works ✅ Mobile responsive design works ✅ No critical errors in console