Skip to content

test(ios): simulator lifecycle e2e flows against master's service - #29679

Merged
chrisnojima merged 10 commits into
nojima/HOTPOT-js-08-pushtapfrom
nojima/HOTPOT-js-09-e2e
Sep 23, 2026
Merged

chrisnojima merged 10 commits into
nojima/HOTPOT-js-08-pushtapfrom
nojima/HOTPOT-js-09-e2e

Conversation

@chrisnojima

@chrisnojima chrisnojima commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Stack 7/7 on #29650.

Why

The rest of this stack changes behaviour only a device shows: app-state transitions, the local http server, links and push taps, and live location. These flows drive a simulator against master's service and assert on the Metro, simulator and Go logs, not on the UI.

What this changes

  • Three Appium flows over a shared harness: app state and the http server, deep links and push taps, and live location. Run them with yarn test:e2e:ios:lifecycle.
  • yarn tsc type-checks the e2e suite as a third project, so a flow that stops compiling is caught.
  • Go-side assertions match the lines master's service logs:
    • MobileAppState.Update: useful update: <STATE>, (the trailing comma keeps BACKGROUND from matching BACKGROUNDACTIVE)
    • startHTTPSrv: start success: addr: and kbhttp.Srv: server starting on:
    • the LiveLocationTracker lines

Judgment calls

Where these flows differ from the ones written for the native-Go approach:

  • Cold launch waits for Go's INACTIVE or BACKGROUNDACTIVE, then FOREGROUND. It doesn't check the JS [AppState] native: line, because the listener mounts after the bundle loads and can miss that transition.
  • Background, then foreground expects resign-active's INACTIVE before BACKGROUND, and tolerates the BACKGROUNDACTIVE/BACKGROUND churn from BackgroundSync. It requires BACKGROUND, then a final FOREGROUND after the last BACKGROUND, and JS seeing background then ending active.
  • Notification Center expects INACTIVE and never BACKGROUND. INACTIVE stops the image server (test(kbhttp): failing tests for server lifetime across app states #29665), so the flow checks images only after the app is active again, and checks that JS holds the restarted server's address. Once test(kbhttp): failing tests for server lifetime across app states #29665 is fixed, it can check that images stay served while inactive.
  • "Does not navigate" push checks now also require a positive line in the same log window: a JS console marker, or app focus changed: active. A silent Metro stream can no longer pass them.
  • Live location follows the JS-relayed watcher:
    • KbLocationWatcher: starting/stopping location updates from NSLog
    • a background share reports INACTIVE, then BACKGROUNDACTIVE, and never FOREGROUND
    • the stop check runs before the relaunch check
  • Relaunch after a kill: the app relaunches in the background and Go restores the share, but no JS runs and no fix is posted within 30 s; activating the app then proves the JS log is live.
  • Not ported: the earlier flow's check that the background relaunch posts a fix itself. That needed Go to own the location watcher.

Tests

  • App state: cold launch; a background/foreground round trip with images and a new message; five quick cycles; Notification Center goes inactive and images load once it closes.
  • Links and pushes: a link while running and cold; another account's link opens without switching; foreground and untapped pushes don't navigate; a tap opens its conversation from the background and from a cold start.
  • Live location: foreground and background moves are posted; stopping stops the OS service and ends relaunches; a killed share relaunches in the background with no JS.

Tolerate legitimate BACKGROUNDACTIVE churn from location fixes and
background-sync/refresh tasks instead of asserting an empty or exact
app-state sequence, and make the push tests' 'no tap happened' checks
non-vacuous by requiring a positive marker in the same log window
first.
Backgrounding while sharing goes to BACKGROUNDACTIVE, not BACKGROUND. A
background relaunch has no JS, so no fix reaches Go there: assert that rather
than a post. Read KbLocationWatcher's NSLog lines, which carry no subsystem.
Inside KbModule the bare companion field name appLifecycleState resolved
to the spec's Java getter, so getAppLifecycleState recursed and threw
StackOverflowError on the JS thread at startup.
@chrisnojima
chrisnojima merged commit ad3045c into master Sep 23, 2026
1 check passed
@chrisnojima
chrisnojima deleted the nojima/HOTPOT-js-09-e2e branch September 23, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant