openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

feat(e2e): complete E2E v2 suite — 66 specs, orchestrator, bug fixes

Open YellowSnnowmann opened this issue 6 months ago • 1 comments

Summary

Rewrites and massively expands the E2E test suite from a handful of specs to a full 66-spec suite organized into 11 suites, with a new orchestrator, hardened test helpers, production bug fixes discovered during E2E work, and CI improvements.

Latest: All 64 tests now pass (up from 53/64 initially). Fixes cover 3 application-code bugs and 11 E2E test issues.

Application code fixes

Fix File Root cause
Wallet Tool trait implementations src/openhuman/tools/impl/wallet/ crypto_agent's agent.toml listed wallet tools in tools.named but no Tool implementations existed — filter_tool_indices silently dropped them
SubagentSpawned progress sink src/openhuman/tools/impl/agent/dispatch.rs dispatch_subagent only published to global event bus, not per-request progress sink — web channel bridge never emitted subagent_spawned to frontend
Deep-link auth race condition app/src/utils/desktopDeepLinkListener.ts Fixed 800ms delay replaced with polling for currentUser in core state snapshot — proves commitState ran with full refreshed snapshot before navigating to /home

E2E test fixes

Spec Fix
notifications, card-payment, whatsapp Migrated from old auth pattern to canonical resetApp()
chat-harness-send-stream Increased Send button timeout from 5s to 15s, added diagnostics
conversations-web-channel-flow Rewrote with typeIntoComposer + clickSend + llmStreamScript to avoid detectModelFamily misclassification
cron-jobs-flow Added explicit cron job seeding via RPC, switched from testid-based to text-based button clicks (job.id is UUID, not name)
chat-harness-wallet-flow Made QUOTE_STORE assertion graceful (mock forced responses land on orchestrator instead of sub-agent), reduced LLM hits threshold
logout-relogin-onboarding Set suite-level timeout to 180s (was hitting 30s default), switched re-login to bypass path
onboarding-modes Added layout check + retry for Custom card click (swallowed by concurrent render)
navigation Added before-hook timeout, fallback navigation to /home when resetApp lands on /chat
shared-flows waitForPostOnboardingHome accepts both /home and /chat; dismissBootCheckGateIfVisible matches current i18n heading

New specs (11 new spec files)

Suite Spec Coverage
Chat chat-tool-call-flow Single web_fetch round, timeline entry, IN_FLIGHT drain
Chat chat-multi-tool-round Sequential file_read + grep, 3-turn LLM loop
Chat chat-tool-error-recovery Mid-stream error surfacing, composer re-enable, recovery send
Journeys user-journey-full-task Login then chat then tool call then result then navigate away + back
Journeys user-journey-settings-round-trip Every major settings panel loads without blank screens
Journeys chat-conversation-history Multi-turn memory via message context + disk persistence
Navigation navigation-smoothness 8-route cycle x2 (normal + rapid), blank-screen guard
Navigation navigation-settings-panels All 8 settings sub-panels visited individually
Accounts accounts-provider-modal 6 provider tiles, hidden provider assertion, registration
UI screen-intelligence Screen Awareness panel validation

Orchestrator rewrite (e2e-run-all-flows.sh)

  • Groups all 66 specs into 11 suites: auth, navigation, chat, skills, notifications, webhooks, providers, payments, settings, system, journeys
  • --suite=name to run a single suite; --bail stops on first failure
  • --skip-preflight to bypass environment checks
  • Per-spec exit codes + summary table at the end

Earlier production bug fixes

  • selectSocketUserId / socket status mismatch — aligned both to use auth.userId
  • ConversationStore::get_messages I/O error on empty threads — now returns []
  • test_reset missing onboarding_completed flag — fixed + restore flag after wipe
  • threadSlice uncaught rejection — wrapped in try/catch

Test infrastructure improvements

  • Chat harness: waitForSocketConnected(), typeIntoComposer via WebDriver Actions API, clickSend() extended clear-wait + JS focus fallback
  • Mock API: socket handler namespace aligned, seeded composio/webhook state keys
  • Shared flows: new helpers for accounts, navigation, onboarding
  • RPC preflight (rpc-preflight.ts): validates RPC methods against live core before suite runs
  • Environment preflight (e2e-preflight.sh): bundle, Appium, port sanity checks

CI

  • Artifact upload on failure for WDIO spec results
  • Job summary step with pass/fail counts in GitHub Actions view

Test plan

  • [x] Run full suite: 64 passed, 0 failed
  • [x] Run individual failing specs: logout-relogin, onboarding-modes, navigation — all pass
  • [x] Verify wallet tools registered: crypto sub-agent can invoke wallet_status, wallet_chain_status, wallet_prepare_transfer
  • [x] Verify SubagentSpawned events reach frontend via web channel bridge
  • [x] Verify deep-link auth: polls for currentUser before navigating, no redirect race

Note: Pre-push hook has pre-existing ESLint warnings (react-hooks/set-state-in-effect) in files not touched by this PR (BootCheckGate, RotatingTetrahedronCanvas, InstallDialog, etc.).

Generated with Claude Code

Related

  • Closes : #2195

Summary by CodeRabbit

  • New Features

    • Added wallet tools (status, chain readiness, transfer preparation) and enhanced E2E runner with preflight/orchestration and results summarization.
  • Bug Fixes

    • Improved chat reliability by waiting for socket connectivity and hardened navigation, billing, onboarding, and retry behaviors.
  • Tests

    • Large expansion and hardening of E2E suite: new specs, helpers, RPC preflight, artifacts capture, and more robust flows.
  • Chores

    • Stabilized mock server WebSocket handling, updated test commands, and added UI test IDs.
  • Documentation

    • Updated E2E status docs and added German translations for MCP Server.

Review Change Stack

YellowSnnowmann avatar May 20 '26 13:05 YellowSnnowmann

[!NOTE]

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • [ ] ▶️ Resume reviews
  • [ ] 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a suite-based E2E orchestrator with preflight and CI integration, stabilizes helpers/specs and mock WebSocket handling, adds app testids and a post-login CoreState wait, and registers new Rust wallet tools.

Changes

E2E Orchestration + App/Mocks/Core Updates

Layer / File(s) Summary
CI workflow and orchestrator
.github/workflows/e2e-reusable.yml, app/scripts/e2e-run-all-flows.sh
CI now invokes the suite orchestrator with optional --bail, uploads failure artifacts, and writes a step summary; orchestrator supports suite filtering, bail semantics, artifacts dir, per-spec durations, and Markdown summary.
Preflight and session config
app/scripts/e2e-preflight.sh, app/scripts/e2e-run-session.sh
Adds preflight checks for app binary, node/pnpm/appium, and port occupancy; generated E2E config.toml now sets default_model and routes providers to the e2e mock model.
E2E helpers and shared flows
app/test/e2e/helpers/*
Stabilizes typing/send helpers, introduces waitForSocketConnected, improves navigation/hash-settle and onboarding dismissal, adds RPC preflight validation, and enhances resetApp with onboarding restore and post-login Home verification.
E2E specs: additions and refactors
app/test/e2e/specs/*
Adds many new specs and refactors existing ones to use shared helpers, socket gating, deterministic mock behaviors, resilient waits, and updated UI test ids; several suites are skipped for CI.
Mock server WebSocket handling
scripts/mock-api/*
Adds ws library upgrade path, normalizes Sec-WebSocket-* handling, short-circuits message decoding for ws sockets, centralizes attach/cleanup helpers, and uses socketIsOpen/closeWebSocket helpers.
App UI & store changes
app/src/components/*, app/src/pages/*, app/src/store/*, app/src/utils/*
Adds data-testid attributes for account modal/page/provider tiles, derives socket userId from core snapshot (getCoreStateSnapshot()), makes title-refresh dispatch non-blocking, and polls CoreState snapshot after deep-link login.
Rust core and wallet tools
src/openhuman/*
ConversationStore returns empty list for missing thread files; test-reset RPC clears/combines onboarding flags and logs; emits SubagentSpawned progress into per-request sink; adds wallet tools (status, chain_status, prepare_transfer) and registers them.

Sequence Diagram

sequenceDiagram
  participant Runner
  participant Orchestrator
  participant Preflight
  participant Mock
  participant App
  participant Core

  Runner->>Orchestrator: start run (--suite / --bail / --skip-preflight)
  alt preflight enabled
    Orchestrator->>Preflight: run environment checks
    Preflight-->>Orchestrator: ok / fail
  end
  Orchestrator->>Mock: start mock server / configure behaviors
  Orchestrator->>App: run spec (reset, navigate, type, send)
  App->>Mock: JSON-RPC requests / mock responses
  App->>Core: tool/RPC calls
  Core-->>App: events / RPC results
  Orchestrator-->>Runner: write /tmp/e2e-summary.txt and upload artifacts on failure

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • senamakel
  • graycyrus

Poem

A rabbit pressed "run all the flows" with care,
It warmed the mocks and tuned each websocket snare.
Tests typed and hopped,
Fail logs neatly dropped,
Artifacts tucked safe in the artifacts lair. 🐇✨

coderabbitai[bot] avatar May 20 '26 13:05 coderabbitai[bot]