Skip to content

iOS screenshot UITest harness: seed fake SMS/call data - #12

Merged
xuandung38 merged 7 commits into
mainfrom
fix/ios-screenshot-uitest-seed-data
Oct 9, 2026
Merged

xuandung38 merged 7 commits into
mainfrom
fix/ios-screenshot-uitest-seed-data

Conversation

@xuandung38

Copy link
Copy Markdown
Contributor

Summary

  • Checkpoint commit for task_05ef3c28a93f (App Store Connect screenshots, iOS/iPad). Not final — captured screenshots themselves are not in this PR, only the XCUITest harness and the production seams it needs.
  • Adds a new iOS UI-testing bundle (iOS/HandLiveScreenshotUITests/ScreenshotUITests.swift) driving the Simulator through onboarding + the paired tab bar.
  • Three production-code UI-test seams, each gated behind a launch argument never set outside XCUITest:
    • SystemPermissions.swift (-HLUITestSkipNotificationRequest): works around an Apple iOS 27 Simulator bug where requestAuthorization never completes (forums thread 849449).
    • IOSAppModel+Messages.swift (-HLUITestSeedDemoMessages): feeds a fake sms/sync page through the real SmsStore.applySyncPage so Messages list/conversation render with content. Two root-caused bugs fixed along the way: insertHistory alone never populates sms_thread (list stayed empty), and a persisted fake cursor made the real paired phone's next sync treat it as invalid and auto-wipe everything — fixed with resetForResync first + hasMore: true (never saves a cursor).
    • IOSAppModel+Calls.swift (-HLUITestSeedIncomingCall): feeds a fake ringing call_event/state through the real CallController.apply so the in-app banner shows; delayed 2s so it lands after the real phone's reconnect-time idle sync (which otherwise clobbers it immediately).

Progress on task_05ef3c28a93f

10 of 11 iPhone screens captured (EN only) at exact App Store Connect pixel size (1320×2868), via real pairing with the owner's S25 Ultra: 01-welcome, 02-pairing-qr, 02-pairing-pin, 03-clipboard (x2), 04-sms-conversation, 05-calls, 06-incoming-call-banner, 07-settings, 08-phone-details, 10-messages-list, 11-new-message.

Still open (deferred, owner reprioritized to macOS/Android):

  • 09-ipad-messages (needs a separate iPad Simulator + pairing or fake-pairing seam)
  • Dark mode variant
  • Vietnamese (VI) locale for all screens

Test plan

  • xcodebuild test-without-building run against a real paired Simulator; all 10 captured checkpoints visually verified (zoomed corners/edges where relevant)
  • CI: new scheme compiles clean, no screenshot assertions

xcodegen wrote LastUpgradeCheck = 1430, so Xcode 27 kept asking to update to its recommended settings. options.xcodeVersion is now 27.0 and the project carries the settings Xcode 27 recommends at the project level: asset symbol extensions, gnu++20 and gnu17, dead code stripping, user script sandboxing and string catalogs preferred. The HLTests-* schemes say LastUpgradeVersion 2700 as well. No target has a run-script phase or C sources, so what is built does not change.

Signed-off-by: Hồ Xuân Dũng <me@hxd.vn>
NSWindow.delegate is weak, so the WelcomeWindowDelegate died as soon as it was assigned and windowWillClose never ran: the welcome window stayed recorded as open and the app never went back to .accessory after Pair Phone was closed. WindowPresenter now owns the delegate until the window closes.

Signed-off-by: Hồ Xuân Dũng <me@hxd.vn>
…em catalog

Xcode names generated asset symbols without the Color suffix, so AccentColor and the accent token both became .accent and HLDesignSystem's generated symbols carried a warning. Only the app catalog needs AccentColor (the global accent color of both app targets reads it from there); the generator no longer writes it into the package catalog, and the test checks the app's AccentColor against the package's accent-fill instead.

Signed-off-by: Hồ Xuân Dũng <me@hxd.vn>
…t support

moduleAlignedSide is pure arithmetic and is now nonisolated, so the test can call it synchronously without the main-actor warning; the fake phones discard the capability data that accept() returns on purpose.

Signed-off-by: Hồ Xuân Dũng <me@hxd.vn>
Adds an XCUITest harness (HandLiveiOSUITests target, iOS/HandLiveScreenshotUITests/)
that drives the Simulator through onboarding and the paired-device tab bar to
capture App Store Connect screenshots at exact pixel dimensions.

Production-code UI-test seams (never active outside an XCUITest launch argument):
- SystemPermissions.swift: -HLUITestSkipNotificationRequest skips
  requestAuthorization, which never completes on this iOS 27 Simulator
  (Apple bug, forums thread 849449).
- IOSAppModel+Messages.swift: -HLUITestSeedDemoMessages feeds a fake sms/sync
  page through the real SmsStore.applySyncPage so the Messages list and a
  conversation render with realistic content; insertHistory alone only writes
  sms_message and leaves sms_thread empty, and a persisted fake cursor made
  the real phone's next sync see it as invalid and wipe everything via
  auto-resync, so resetForResync runs first and the fake page never saves a
  cursor (hasMore: true).
- IOSAppModel+Calls.swift: -HLUITestSeedIncomingCall feeds a fake ringing
  call_event/state through the real CallController.apply so the in-app
  banner shows; delayed 2s so it lands after the real phone's reconnect-time
  idle sync, which would otherwise overwrite it immediately.

Signed-off-by: Hồ Xuân Dũng <me@hxd.vn>
HardcodedTextScanTests scans every Swift file under iOS/ (not just
Packages/*/Sources), so the screenshot UITest's device-row lookup —
a literal containing "của" — tripped the Vietnamese-diacritics pattern
meant to catch real UI text. Matches the model number only (no
diacritics) instead of the full device name.

Signed-off-by: Hồ Xuân Dũng <me@hxd.vn>
Identifier Name Violation on single-letter variables (m, i): swiftlint
--strict turns these into build failures, not just warnings. Renamed
to threadStart and attempt.

Signed-off-by: Hồ Xuân Dũng <me@hxd.vn>
@xuandung38
xuandung38 merged commit 71e6da5 into main Oct 9, 2026
5 checks passed
@xuandung38
xuandung38 deleted the fix/ios-screenshot-uitest-seed-data branch October 9, 2026 05:52
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