- Complete manual testing guide (E2E_TESTING.md) - 30+ test scenarios across 10 categories - Critical user flows documented - Test data seed script - Bug report template - Cross-browser test matrix - Accessibility testing - Performance testing - Error handling tests Test categories: 1. Authentication (4 tests) 2. Inventory Management (5 tests) 3. Barcode Scanning (3 tests) 4. Tag Management (3 tests) 5. PWA Installation (3 tests) 6. Offline Functionality (3 tests) 7. Responsive Design (3 tests) 8. Performance (2 tests) 9. Accessibility (2 tests) 10. Error Handling (2 tests) Ready for pre-release testing. Closes #40
11 KiB
End-to-End Testing Guide
Overview
This guide covers manual end-to-end testing of the Pantry MVP. These tests ensure all critical user flows work correctly before release.
Test Environment
Requirements:
- Browser: Chrome/Edge, Firefox, or Safari
- Resolution: 1920x1080 (desktop) and 390x844 (mobile)
- Network: Both online and offline modes
- Data: Fresh database with seed data
Critical User Flows
1. Authentication Flow
Test 1.1: Sign Up
Priority: HIGH
- Navigate to app home page
- Click "Sign Up" or similar
- Enter email: test@example.com
- Enter password: SecurePass123!
- Confirm password
- Submit form
Expected Results:
- ✅ Validation errors if password too weak
- ✅ Account created successfully
- ✅ Redirected to home/dashboard
- ✅ Welcome message shown (optional)
Test 1.2: Sign In
Priority: HIGH
- Sign out if signed in
- Navigate to home page
- Click "Sign In"
- Enter correct credentials
- Submit form
Expected Results:
- ✅ Successfully signed in
- ✅ Redirected to dashboard
- ✅ User menu shows email/name
Test 1.3: Sign In (Wrong Credentials)
Priority: MEDIUM
- Try signing in with wrong password
- Try signing in with non-existent email
Expected Results:
- ✅ Error message shown
- ✅ Form not cleared (email retained)
- ✅ No redirect
- ✅ Try again allowed
Test 1.4: Sign Out
Priority: HIGH
- While signed in, click user menu
- Click "Sign Out"
Expected Results:
- ✅ Signed out successfully
- ✅ Redirected to sign-in page
- ✅ Cannot access protected pages
2. Inventory Management
Test 2.1: View Inventory List
Priority: HIGH
- Sign in
- Navigate to home/inventory page
Expected Results:
- ✅ List of pantry items displayed
- ✅ Items show: name, quantity, unit, location tags
- ✅ Empty state if no items
- ✅ Loading state while fetching
Test 2.2: Add Item Manually
Priority: HIGH
- Navigate to inventory
- Click "Add Item" button
- Enter item details:
- Name: "Olive Oil"
- Quantity: 1
- Unit: L (liter)
- Tags: pantry, cooking-oil
- Submit
Expected Results:
- ✅ Form validation works
- ✅ Item appears in list immediately
- ✅ Success message shown
- ✅ Form cleared for next entry
Test 2.3: Edit Item
Priority: HIGH
- Click on an existing item
- Click "Edit" button
- Change quantity from 1 to 0.5
- Save changes
Expected Results:
- ✅ Modal/form opens with current values
- ✅ Changes saved successfully
- ✅ List updated immediately
- ✅ No page reload needed
Test 2.4: Delete Item
Priority: HIGH
- Click on an item
- Click "Delete" button
- Confirm deletion
Expected Results:
- ✅ Confirmation dialog shown
- ✅ Item removed from list
- ✅ Success message shown
- ✅ Can undo (optional)
Test 2.5: Filter by Tag
Priority: MEDIUM
- View inventory list
- Click on a tag filter (e.g., "fridge")
Expected Results:
- ✅ Only items with that tag shown
- ✅ Filter state persists
- ✅ Clear filter button available
- ✅ Item count updated
3. Barcode Scanning
Test 3.1: Scan Known Product
Priority: HIGH
- Navigate to Scan page
- Allow camera permissions
- Scan a barcode (e.g., Coca-Cola)
Expected Results:
- ✅ Camera opens
- ✅ Barcode detected
- ✅ Product info fetched from Open Food Facts
- ✅ Pre-filled add form shown
- ✅ Can edit before adding
Test 3.2: Scan Unknown Product
Priority: MEDIUM
- Scan a barcode not in database
- Manual entry form shown
Expected Results:
- ✅ "Product not found" message
- ✅ Option to add manually
- ✅ Barcode pre-filled
- ✅ Can still save item
Test 3.3: Camera Permission Denied
Priority: MEDIUM
- Block camera permission
- Try to scan
Expected Results:
- ✅ Permission prompt shown
- ✅ Helpful error message
- ✅ Instructions to enable camera
- ✅ Option to add manually
4. Tag Management
Test 4.1: Create Tag
Priority: MEDIUM
- Go to Settings → Tags
- Click "Add Tag"
- Enter name: "freezer"
- Pick color: blue
- Save
Expected Results:
- ✅ Tag created successfully
- ✅ Appears in tag list
- ✅ Available in item forms
- ✅ Color applied correctly
Test 4.2: Edit Tag
Priority: LOW
- Click on existing tag
- Change name or color
- Save
Expected Results:
- ✅ Tag updated
- ✅ All items with tag reflect changes
- ✅ No broken references
Test 4.3: Delete Tag
Priority: LOW
- Click delete on a tag
- Confirm
Expected Results:
- ✅ Confirmation shown if tag in use
- ✅ Tag removed
- ✅ Items keep other tags
- ✅ No app crashes
5. PWA Installation
Test 5.1: Install Prompt (Desktop)
Priority: MEDIUM
- Visit app on Chrome (desktop)
- Wait 3 seconds
Expected Results:
- ✅ Install banner appears
- ✅ Shows app icon and name
- ✅ Install button works
- ✅ Can dismiss and won't show for 7 days
Test 5.2: Install from Settings
Priority: MEDIUM
- Go to Settings → App
- Click "Install App" button
Expected Results:
- ✅ Browser install dialog opens
- ✅ App installs to desktop/home screen
- ✅ Launches in standalone mode
- ✅ Icon and name correct
Test 5.3: iOS Safari Add to Home Screen
Priority: HIGH (iOS users)
- Open app in Safari (iOS)
- Tap Share button
- Tap "Add to Home Screen"
- Confirm
Expected Results:
- ✅ Icon added to home screen
- ✅ Opens in standalone mode
- ✅ Splash screen shown
- ✅ No Safari UI
6. Offline Functionality
Test 6.1: Work Offline
Priority: HIGH
- Load app while online
- Navigate to all pages
- Disconnect internet
- Try navigating again
Expected Results:
- ✅ Offline banner appears
- ✅ Previously visited pages load
- ✅ Cached data visible
- ✅ No white screens or errors
Test 6.2: Offline Indicator
Priority: MEDIUM
- Go offline
- Check for visual feedback
Expected Results:
- ✅ "You're offline" banner at top
- ✅ Banner is amber/warning color
- ✅ Icon indicates offline status
Test 6.3: Return Online
Priority: MEDIUM
- Go offline
- Wait a few seconds
- Go online
Expected Results:
- ✅ "Back online!" banner (green)
- ✅ Auto-hides after 3 seconds
- ✅ Data syncs (if pending changes)
7. Responsive Design
Test 7.1: Mobile View
Priority: HIGH
- Resize browser to 390px wide
- Navigate all pages
Expected Results:
- ✅ Navigation adapts (hamburger menu)
- ✅ Lists stack vertically
- ✅ Buttons are touch-friendly
- ✅ No horizontal scroll
- ✅ Text readable without zoom
Test 7.2: Tablet View
Priority: MEDIUM
- Resize to 768px wide
Expected Results:
- ✅ Layout adapts
- ✅ 2-column grids where appropriate
- ✅ Navigation hybrid or drawer
Test 7.3: Desktop View
Priority: MEDIUM
- View at 1920px wide
Expected Results:
- ✅ Full navigation visible
- ✅ Multi-column layouts
- ✅ Content not stretched too wide
- ✅ Whitespace used effectively
8. Performance
Test 8.1: Page Load Time
Priority: HIGH
- Clear cache
- Load home page
- Measure time to interactive
Expected Results:
- ✅ < 3 seconds on 4G
- ✅ < 1 second on repeat visit
- ✅ Loading indicators shown
Test 8.2: Lighthouse Score
Priority: MEDIUM
- Open DevTools → Lighthouse
- Run "Progressive Web App" audit
Expected Results:
- ✅ PWA score: 90+
- ✅ Performance: 80+
- ✅ Accessibility: 90+
- ✅ Best Practices: 90+
9. Accessibility
Test 9.1: Keyboard Navigation
Priority: HIGH
- Use only keyboard (Tab, Enter, Esc)
- Navigate entire app
Expected Results:
- ✅ All interactive elements reachable
- ✅ Focus indicators visible
- ✅ Modals can be closed with Esc
- ✅ Logical tab order
Test 9.2: Screen Reader
Priority: MEDIUM
- Enable VoiceOver (Mac) or NVDA (Windows)
- Navigate app
Expected Results:
- ✅ All text announced
- ✅ Images have alt text
- ✅ Form labels read correctly
- ✅ Buttons have meaningful labels
10. Error Handling
Test 10.1: Network Error
Priority: HIGH
- Start action (add item)
- Disable network mid-request
- Check behavior
Expected Results:
- ✅ Error message shown
- ✅ Action can be retried
- ✅ Data not lost
- ✅ No crash
Test 10.2: Server Error (500)
Priority: MEDIUM
- Trigger server error (if possible)
Expected Results:
- ✅ User-friendly error message
- ✅ No stack traces visible
- ✅ Option to try again
- ✅ Logs sent to monitoring (optional)
Test Data Setup
Seed Data Script
-- Run in Supabase SQL Editor
-- Insert test household
INSERT INTO households (id, name) VALUES
('test-household-1', 'Test Household');
-- Insert test tags
INSERT INTO tags (id, household_id, name, color) VALUES
('tag-1', 'test-household-1', 'fridge', '#3b82f6'),
('tag-2', 'test-household-1', 'pantry', '#10b981'),
('tag-3', 'test-household-1', 'freezer', '#6366f1');
-- Insert test units
INSERT INTO units (id, household_id, name, abbreviation, base_unit, conversion_factor) VALUES
('unit-1', 'test-household-1', 'liter', 'L', 'L', 1),
('unit-2', 'test-household-1', 'milliliter', 'mL', 'L', 0.001),
('unit-3', 'test-household-1', 'kilogram', 'kg', 'kg', 1);
-- Insert test items
INSERT INTO pantry_items (household_id, name, quantity, unit_id) VALUES
('test-household-1', 'Milk', 1, 'unit-1'),
('test-household-1', 'Rice', 2, 'unit-3'),
('test-household-1', 'Olive Oil', 0.5, 'unit-1');
Test Execution Checklist
Before Testing:
- Fresh database with seed data
- Clear browser cache
- Clear localStorage
- Unregister service workers
- Sign out all accounts
Test Environments:
- Chrome (Windows/Mac/Linux)
- Firefox (Windows/Mac/Linux)
- Safari (Mac/iOS)
- Mobile Chrome (Android)
- Mobile Safari (iOS)
Test Scenarios:
- Authentication (4 tests)
- Inventory Management (5 tests)
- Barcode Scanning (3 tests)
- Tag Management (3 tests)
- PWA Installation (3 tests)
- Offline Functionality (3 tests)
- Responsive Design (3 tests)
- Performance (2 tests)
- Accessibility (2 tests)
- Error Handling (2 tests)
Bug Report Template
**Title:** Short description
**Priority:** High / Medium / Low
**Environment:**
- Browser: Chrome 120.0
- OS: Windows 11
- Device: Desktop 1920x1080
**Steps to Reproduce:**
1. Navigate to...
2. Click on...
3. Enter...
**Expected Result:**
What should happen
**Actual Result:**
What actually happened
**Screenshots/Video:**
[Attach if applicable]
**Console Errors:**
[Copy any errors from DevTools console]
**Workaround:**
[If known]
Sign-off
Tested by: [Name]
Date: [Date]
Environment: [Browser, OS]
Total Tests: [X]
Passed: [X]
Failed: [X]
Blocked: [X]
Critical Issues Found: [List or "None"]
Recommendation: ✅ Ready for Release / ❌ Needs Fixes
Next Steps:
- Fix critical issues
- Retest failed scenarios
- Document known limitations
- Prepare release notes