Skip to content

fix(e2e): dismiss BootCheckGate picker with current heading text#2330

Closed
CodeGhost21 wants to merge 1 commit into
tinyhumansai:mainfrom
CodeGhost21:fix/e2e-dismiss-boot-check-gate-runtime-picker-text
Closed

fix(e2e): dismiss BootCheckGate picker with current heading text#2330
CodeGhost21 wants to merge 1 commit into
tinyhumansai:mainfrom
CodeGhost21:fix/e2e-dismiss-boot-check-gate-runtime-picker-text

Conversation

@CodeGhost21
Copy link
Copy Markdown
Contributor

@CodeGhost21 CodeGhost21 commented May 20, 2026

Summary

  • Update dismissBootCheckGate to match the current i18n heading text rendered by BootCheckGate ("Select a Runtime" / "Connect to Your Runtime"), not the stale "Choose core mode" / "Connect to your core" strings the regex was still pinned to.
  • Centralise the regex in a single constant and stop returning early on the first poll when the picker is not visible yet (BootCheckGate's first paint can land a beat after #root first gains children; the 5s deadline already bounds the wait).

Problem

The e2e / E2E (Linux / Appium Chromium) job on #2247 is failing because four deep-link-consume mega-flow scenarios time out at 30s waiting for the new OAuth auth-readiness gate to lift:

Mega flow — login + Gmail OAuth + Composio in one session login: consume deep link triggers /consume + /auth/me on the mock
Mega flow — login + Gmail OAuth + Composio in one session bypass login: key=auth deep link skips /consume but still fetches /auth/me
Mega flow — login + Gmail OAuth + Composio in one session Gmail OAuth: success deep link is consumed without crashing the session
Mega flow — login + Gmail OAuth + Composio in one session Composio: enable_trigger via RPC mutates the active-triggers list

The new waitForOAuthAuthReadiness gate (added in #2247) hard-depends on localStorage.openhuman_core_mode being set before it lets consume_login_token through. That key is only persisted when BootCheckGate's "Continue" button is clicked. In E2E, dismissBootCheckGate() is supposed to auto-click that on every spec startup, but its regex still matched the legacy heading text:

/Choose core mode|Connect to your core/

The current i18n values in app/src/lib/i18n/en.ts:1071-1072 are:

'bootCheck.chooseCoreMode': 'Select a Runtime',
'bootCheck.connectToCore':  'Connect to Your Runtime',

So the helper never detected the picker, never clicked Continue, never persisted the mode, and the readiness gate timed out.

Pre-#2247 the same mismatch existed but was harmless — the deep-link handler called consumeLoginToken immediately and didn't care that the picker was still hovering above the WebView. #2247 surfaces the latent bug.

Solution

  • Replace the inline regex with a single BOOT_CHECK_GATE_PICKER_HEADING_REGEX constant matching /Select a Runtime|Connect to Your Runtime/ (mirrors the desktop and web i18n strings).
  • Remove the early-return when onPicker is false on the first sample; instead, pause-and-retry until the deadline so we tolerate React's first-paint timing.
  • Pass the regex source through browser.execute so both the "is picker up" and "did modal unmount" checks stay in sync.
  • Refresh the docstrings to reference the current picker name and explain the dependency the gate in fix(oauth): sign-in failed on first launch (oauth flow) (#1689) #2247 introduced.

No production code changes — this is purely the E2E test harness.

Submission Checklist

  • Tests added or updated (happy path + at least one failure / edge case) per Testing StrategyN/A: test harness helper, not a feature; exercised end-to-end by the mega-flow spec the helper supports.
  • Diff coverage ≥ 80%N/A: changes are in app/test/e2e/helpers/, excluded from coverage gate.
  • Coverage matrix updated — N/A: no production behaviour change.
  • All affected feature IDs from the matrix are listed in the PR description under ## RelatedN/A.
  • No new external network dependencies introduced (mock backend used per Testing Strategy)
  • Manual smoke checklist updated if this touches release-cut surfaces — N/A: test-only change.
  • Linked issue closed via Closes #NNN in the ## Related section — N/A: unblocks the open #2247 PR; no separate issue.

Impact

Unblocks the failing e2e / E2E (Linux / Appium Chromium) job on #2247 and any future PR whose tests depend on the picker being dismissed (login-flow, runtime-picker-login, logout-relogin-onboarding, etc.). On non-fresh CEF profiles where the mode is already persisted, the helper still returns within the same 5s budget without clicking anything.

Related

Summary by CodeRabbit

  • Tests
    • Enhanced test helper reliability by improving modal detection logic to be more resilient to timing variations and reducing early exit conditions.
    • Updated test documentation to clarify bootstrap modal handling behavior.

Review Change Stack

`dismissBootCheckGate` was matching against legacy h2 text
("Choose core mode" / "Connect to your core") that no longer renders —
the i18n strings are now "Select a Runtime" / "Connect to Your Runtime"
(`app/src/lib/i18n/en.ts:1071-1072`). The helper therefore never detected
the picker, never clicked Continue, and never persisted
`openhuman_core_mode` to localStorage.

Pre-tinyhumansai#2247 that was harmless: the deep-link handler called
`consumeLoginToken` immediately, so the picker hovering above the WebView
didn't block the mock-backend assertions. After tinyhumansai#2247 the new OAuth
auth-readiness gate hard-depends on `openhuman_core_mode` being set, so
all three deep-link-consume mega-flow scenarios time out at 30s waiting
for the gate to lift.

Update the heading regex (centralised in a constant) to the current
strings and stop returning early on the first poll when the picker isn't
visible yet — BootCheckGate can land its first paint a beat after `#root`
gains children, and the 5s deadline already bounds the wait.

No production code touched; affects E2E test harness only.
@CodeGhost21 CodeGhost21 requested a review from a team May 20, 2026 10:42
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0393ca83-dd46-44b0-8aee-ffb492d90a73

📥 Commits

Reviewing files that changed from the base of the PR and between ebd6457 and 131fb26.

📒 Files selected for processing (1)
  • app/test/e2e/helpers/app-helpers.ts

📝 Walkthrough

Walkthrough

The PR improves the e2e test helper for dismissing the first-run BootCheckGate modal by introducing a shared regex constant for heading detection, updating documentation, and refactoring polling logic to continue sampling until timeout when the picker is absent.

Changes

BootCheckGate Dismissal Refactoring

Layer / File(s) Summary
BootCheckGate heading regex constant and documentation
app/test/e2e/helpers/app-helpers.ts
BOOT_CHECK_GATE_PICKER_HEADING_REGEX constant is introduced to match "Select a Runtime" or "Connect to Your Runtime" headings. Documentation for waitForApp and dismissBootCheckGate is updated to reflect accurate modal dismissal behavior.
Polling and unmount detection refactoring
app/test/e2e/helpers/app-helpers.ts
The picker visibility check now evaluates headings via the shared regex passed to browser.execute, and polling continues until timeout instead of exiting on first absence. Modal unmount verification also uses the regex-based heading detection.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • tinyhumansai/openhuman#1779: Both PRs modify app/test/e2e/helpers/app-helpers.ts to add/update dismissBootCheckGate and make waitForApp dismiss the first-run BootCheckGate picker modal (including polling/click/unmount behavior).
  • tinyhumansai/openhuman#1982: The main PR updates the shared e2e waitForApp/dismissBootCheckGate BootCheckGate runtime-picker dismissal logic to match the "Select a Runtime"/"Connect to Your Runtime" heading, which directly affects how the new runtime-picker-login.spec.ts drives and dismisses the BootCheckGate picker during the login/onboarding/logout flow.

Suggested labels

working

Poem

🐰 A picker modal now has shared sight,
With regex matching "Runtime" oh-so-right!
Polling persists through every test tick,
Until the BootCheckGate falls—quick, quick, quick!
Test helpers dressed in cleaner threads,
Dismissing modals with steadier treads. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: updating the BootCheckGate picker dismissal to use current heading text. It is concise, specific, and clearly reflects the primary objective of the PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added the working A PR that is being worked on by the team. label May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

working A PR that is being worked on by the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant