Skip to content

feat: Automated test suite for hathor-wallet-mobile#110

Open
tuliomir wants to merge 7 commits into
masterfrom
feat/mobile-wallet-test-suite
Open

feat: Automated test suite for hathor-wallet-mobile#110
tuliomir wants to merge 7 commits into
masterfrom
feat/mobile-wallet-test-suite

Conversation

@tuliomir
Copy link
Copy Markdown
Contributor

Introduces a multi-layered automated test suite (unit, integration, component, E2E) for the Hathor Mobile Wallet. E2E framework is Maestro, chosen over Detox for LavaMoat/SES compatibility.

See rendered.

tuliomir and others added 6 commits April 29, 2026 10:54
Multi-layered testing pyramid (unit, integration, component, E2E) with
Maestro as the E2E framework. Chosen over Detox for LavaMoat/SES
compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move all Detox discussion to Rationale and Alternatives section
  with detailed pros/cons and conditions for reconsidering
- Remove Detox references from other sections
- Add issue links for Fabric bugs (Switch, TouchableOpacity, Pressable)
- Add BackupWords wrong-word error validation to flow description
- Add AI agent testing guidelines (CLAUDE.md) to Future Possibilities
- Clarify that production code workarounds are framework-agnostic

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rewrite the production-code-changes section of RFC 0004 to document the
canonical Maestro/React Native fix (accessible={false} on layout Views)
instead of the earlier layout-based workaround. The previous "flex
container layout fix" and the TouchableOpacity-to-Pressable migration
were both symptoms of the same iOS accessibility-tree issue and have
been removed from the production code.

Restructure Future Possibility #7 (AI agent testing guidelines) into a
two-tier shape ready to be lifted directly into the wallet repo's
CLAUDE.md (brief authoritative rules) and a companion skill/knowledge
file (depth on test patterns, the iOS a11y rule, Fabric workarounds
catalogue, Maestro conventions).

Add Unresolved Question #5 noting that a Maestro re-run of
walletCreation.yaml against the canonical-pattern code is the remaining
verification step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Maestro re-verification on iPhone 17 / iOS 26.4 / Xcode 26.4.1 proved
the previous "canonical pattern replaces all workarounds" framing was
wrong. The accessible={false} fix is necessary but not sufficient.
Three independent issues all need their own fix:

1. Accessibility tree aggregation (accessible={false} on layout Views)
2. TouchableOpacity onPress not firing under Fabric+XCUITest (Pressable
   migration with JS-level disabled guard)
3. Flex containers intercepting synthetic taps even with accessible={false}
   (buttons rendered as siblings, not children, of flex:1 spacers)

Plus the previously documented ToggleSwitch (UISwitch onValueChange
bug) and testID props.

Removing any one of #1, #2, or #3 breaks E2E silently — Maestro reports
the tap as COMPLETED but the synthetic touch never reaches JS. The
hierarchy dump confirms XCUITest finds the element correctly; the
gesture is intercepted upstream of the JS layer.

Restructured production-code-changes section to enumerate all three
clearly, with diagnostic notes. Updated Future Possibility #7's
CLAUDE.md content with all three rules + a diagnostic workflow agents
can use when "Maestro tap COMPLETED but app didn't respond."
Marked Unresolved Question #5 resolved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Promotes 0004-automated-test-suite.md into a folder following the
0003-token-swap pattern. The deep iOS Fabric/XCUITest implementation
detail and the wallet-creation E2E walkthrough move into a companion
phase-4-e2e-deep-dive.md annex; the main RFC keeps a Phase 4 summary
with anchors into the annex.

Syncs the RFC against the proposed Layers 1-3 implementation in
HathorNetwork/hathor-wallet-mobile#863:

- name the Layer 3 helper set (renderWithProviders, createTestStore,
  createMockNavigation, getInitialState)
- add a Test layout table (layer to directory) and name jestMockSetup.js
  as the central mock registry
- name the RTK-slices safety net rationale (behavior, state-shape,
  action-type contract triple) for reducer tests
- list the additional dev deps shipped by the PR (jest-circus,
  @jest/globals, @types/jest)
- acknowledge clearLoadingLocksForTesting as the single Layer 1-3
  production-code line
- correct the path of the canonical companion docs in Future
  Possibilities #7

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tuliomir tuliomir force-pushed the feat/mobile-wallet-test-suite branch from b90b94a to 448bfbf Compare April 29, 2026 13:55
Main RFC now treats phase 4 as an annex pointer rather than restating
the full implementation. The five-item production-code list, the
verification env, the criticality warning, and the wallet-creation
walkthrough collapse into single-sentence summaries with anchor links
into phase-4-e2e-deep-dive.md. Drawback 1 is reduced to a one-line
classification of the five fixes (a11y win, three testing workarounds,
one invisible) plus an annex link.

Adds a new "Accessibility impact for end users" subsection answering
whether the Phase 4 changes also benefit visually impaired users:

- accessible=false on layout Views is a genuine VoiceOver win (the
  same iOS aggregation that breaks XCUITest collapses screen-reader
  focus into a single chunk; this fix restores per-element focus).
- Pressable migration and flex-container layout are testing-only.
- The custom ToggleSwitch carries accessibilityRole="switch", so
  VoiceOver announces it the same way the native control would.
- testID props are invisible to end users.

Same conclusion is also stated inline in the annex, at the end of
the accessibility-tree fix, so a reader entering through the annex
gets the same answer without bouncing back to the main RFC.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tuliomir tuliomir moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Apr 29, 2026
tuliomir added a commit that referenced this pull request May 21, 2026
Adapts mobile RFC #110 to the Electron
desktop wallet. Four-layer pyramid (unit, integration,
component, E2E Playwright + Electron). Reference smoke
PRs for Layers 1-3 then Layer 4 land first; feature-area
PRs follow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Testing related

Projects

Status: In Progress (Done)

Development

Successfully merging this pull request may close these issues.

1 participant