Runbook: PWA & Mobile Infrastructure Testing
This runbook provides a step-by-step guide for manually verifying the Progressive Web App (PWA) features and mobile infrastructure introduced in v15.0.
1. Installation & Environment
Prerequisites
- Build the app locally:
SKIP_EMBEDDINGS=1 npm run build - Start the server:
npm run start - Access via
localhost:3000or via an HTTPS tunnel (e.g., ngrok) if testing on a physical mobile device.
Browser Support
| Feature | Chrome (Desktop/Android) | Safari (iOS) | Firefox |
|---|---|---|---|
| Offline Cache | ✅ | ✅ | ✅ |
| Install Prompt | ✅ | ⚠️ (Manual) | ✅ |
| Push (OneSignal) | ✅ | ✅ (iOS 16.4+) | ✅ |
2. Initial Data Sync
- Open the app in a new incognito window.
- Open DevTools > Network tab.
- Refresh the page.
- Verify: The browser should fetch
/api/v1/services/export. - Open DevTools > Application > Cache Storage.
- Verify:
services-exportcache exists (NetworkFirst; used for offline-friendly re-sync). - Open DevTools > Application > IndexedDB.
- Verify:
careconnect-offline-v1database exists and theservicesstore contains ~196 items.
2.1 PWA Asset Validation (Quick)
- Open
http://localhost:3000/manifest.jsonin the browser. - Verify: JSON loads (not a 404) and references
/icons/*+/screenshots/*. - Open
http://localhost:3000/icons/icon-512.png. - Verify: Image loads (not a 404).
3. Offline Search & Navigation
- In DevTools > Network, set throttling to Offline.
- Navigate to the Home page.
- Verify: The "Offline Mode" banner appears at the top.
- Perform a search (e.g., "food").
- Verify: Search results are displayed (loaded from IndexedDB).
- Click on a service.
- Verify: The Service Detail page loads correctly.
4. Offline Feedback Queue
- While still Offline, go to any service page.
- Submit a "Helpful" vote or a "Report Issue" form.
- Verify: A message appears saying "Your feedback will be synced when you are back online."
- Open DevTools > Application > IndexedDB >
pendingFeedback. - Verify: Your submission is queued in the store.
- Set the Network back to Online.
- Verify: After a few seconds, the item is removed from IndexedDB (check Console logs for "Syncing pending feedback").
4.1 Offline Fallback Route
- While Online, open
http://localhost:3000/offline. - Verify: It renders (this is the Workbox navigation fallback target).
- Switch to Offline and refresh the page.
- Verify: It still renders, and the language matches your locale preference (
NEXT_LOCALE).
5. Push Notification Opt-In
- Reset notification permissions for the site.
- Navigate to the Settings page.
- Locate the Notifications section.
- Click Enable.
- Verify: Browser permission prompt appears.
- Verify: After allowing, the button changes to "Disable" and the status is "Active".
- Note: Actual push delivery requires
NEXT_PUBLIC_ONESIGNAL_APP_IDto be configured.
6. Deep Linking (Placeholder Verification)
- Verify that the following paths return the correct JSON content (or are served correctly):
/.well-known/apple-app-site-association/.well-known/assetlinks.json- Note: These are static files and don't require logic, just presence and correct structure.
7. Lighthouse PWA Audit (Release Verification)
PWA is disabled in
devmode; audit a production build.
- Build + start:
SKIP_EMBEDDINGS=1 npm run buildnpm run start- Run Lighthouse:
npx lighthouse http://localhost:3000/en --view- Verify: PWA installability, manifest validity, and no service worker registration errors.
7.1 PWA Health Endpoint (Release/Monitoring)
This repo exposes a privacy-preserving health endpoint that also verifies PWA asset presence.
- Open
http://localhost:3000/api/health - Verify:
statusis"ok"pwa.okistruepwa.assetsOkistrue- In production builds,
pwa.workboxOkistrue pwa.checks.manifest.existsistruepwa.checks.customServiceWorker.existsistrue
This endpoint is safe to monitor externally (it does not require user identifiers).
8. Multi-Language Offline Check (All Locales)
For each locale: /en, /fr, /zh-Hans, /ar, /pt, /es, /pa
- Load the locale route while online (e.g.
http://localhost:3000/ar). - Switch to Offline.
- Navigate to
http://localhost:3000/offline. - Verify: Correct language renders; Arabic uses RTL (
<html dir="rtl">). - Switch back Online.
- Verify: Offline sync runs (watch Console logs and the
careconnect-offline-v1IndexedDB metadata).
Troubleshooting
- Database not updating: Close all tabs of the app and reopen. IndexedDB migrations sometimes require a fresh start.
- Service Worker not active: Check DevTools > Application > Service Workers. Ensure it is "Activated and is running".
- Offline banner not showing: Ensure
useNetworkStatushook is correctly listening towindow.onoffline.