Long-Run Background E2E
The example app has two background E2E pages:
background-e2eis a short smoke page for API contracts.background-long-runis a device-level page for long-running checks.
The long-run page reads native storage and status. It does not pass from React state alone, so app restarts do not hide missing native delivery.
Android
Run the Android emulator flow:
This flow:
- starts background tracking with
stopOnTerminate: falseandstartOnBoot: true, - registers a geofence,
- sends the app home,
- injects outside, inside, and outside locations,
- reopens the page,
- verifies stored background location events recorded after the run marker,
- verifies Headless JS delivery by checking delivered native event flags,
- verifies geofence enter and exit events.
To include reboot restore on an emulator:
The reboot pass is emulator-only. The wrapper refuses RUN_REBOOT=1 on a
physical Android device before issuing adb reboot, then arms a post-reboot
proof window, injects outside/inside/outside locations after boot, and requires
post-reboot location plus geofence events. Physical Android devices need real
movement or another trusted location injection setup.
iOS
Run the iOS simulator flow:
This flow:
- starts iOS background/significant-change tracking,
- sends the app home,
- injects location changes,
- reopens the page,
- verifies native storage drain from events recorded after the run marker.
iOS does not have Android Headless JS or an Android-style boot receiver. The E2E page reports those as platform limits instead of pretending they are supported.
Manual Coordinates
The geofence is centered at:
The deterministic transition path is:
On iOS Simulator, use the Maestro flow for the Home/background step. For a manual run, press Home in Simulator and inject the same path with:
On Android Emulator:
Expected Gaps
Long-run background behavior is platform and device-policy dependent. If the screen reports a failed result, keep it failed and inspect the device state, permissions, battery policy, and native logs. Do not change the E2E page to pass without a stored native event.
