mirror of
https://github.com/Darkrock-Studios/hammer-editor.git
synced 2026-08-06 16:13:14 +00:00
* Add iOS UI smoke tests (XCUITest) Adds an iOS UI smoke-test suite that drives the real app on a simulator via XCUITest, the iOS analogue of the android/src/androidTest Compose UI tests. The whole iOS UI is Compose Multiplatform, and CMP (1.8+) maps Compose testTags to iOS accessibilityIdentifiers automatically, so the tests target the same testTags the Android suite uses. Workflows covered (all green on simulator): - LaunchSmoke: app boots through the SwiftUI entry point, Koin + data migration run, project selection renders. - ProjectWorkflow: create + open a project (exercises the create dialog text entry and navigation into the editor). - SceneEditorWorkflow: create a scene and confirm it opens in the editor. - NotesWorkflow: navigate to Notes and open the create-note screen. Setup: - ios/scripts/add_ui_test_target.rb idempotently creates the iosUITests UI-testing target + shared scheme via the xcodeproj gem (the folder previously had source files but no actual target). - ios/scripts/disable_sim_hardware_keyboard.sh forces the software keyboard so XCUITest text entry lands (Compose fields need it). - ios-ui-tests CI job runs the suite on a simulator and uploads the xcresult on failure. - composeUi ProjectCreateDialog: tag the name field so the create flow is targetable (also benefits Android). Known limitation: the app's custom rich-text editors (scene body, note body via MarkdownEditField) do not report keyboard focus to XCUITest, so their text entry can't be driven (only standard Compose text fields can). The scene and notes tests therefore stop at "editor opens" / "creation screen opens"; the full edit/create-with-body paths remain covered by the Android suite. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * iOS UI tests: type into note body via composetexteditor 2.3.0 composetexteditor 2.3.0 publishes text-editing accessibility semantics on its editor, so XCUITest can now drive text entry into it. Bump the dependency and promote the Notes UI test to the full Android-parity flow: create a note by typing into the body, then assert its card appears. The scene edit+save flow stays scoped to "scene opens" for now — text entry works, but the scene editor's initial-buffer gating + dirty-driven save make the save affordance unreliable to assert from an IME-driven edit; promoting it is a follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
25 lines
1.4 KiB
Bash
Executable file
25 lines
1.4 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Disable the simulator's "Connect Hardware Keyboard" so the *software* keyboard shows during UI
|
|
# tests. Compose-on-iOS text fields need the software keyboard up for XCUITest's typeText to land;
|
|
# with a hardware keyboard "connected" the soft keyboard stays hidden and typeText fails with
|
|
# "Neither element nor any descendant has keyboard focus".
|
|
#
|
|
# Safe to run repeatedly. Run before `xcodebuild test`, then (re)launch the simulator so the
|
|
# preference is picked up.
|
|
set -euo pipefail
|
|
|
|
PLIST="$HOME/Library/Preferences/com.apple.iphonesimulator.plist"
|
|
|
|
# Global default applied to freshly-created device windows.
|
|
defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false || true
|
|
|
|
# Per-device override (Simulator persists this keyed by UDID).
|
|
/usr/libexec/PlistBuddy -c "Add :DevicePreferences dict" "$PLIST" 2>/dev/null || true
|
|
for udid in $(xcrun simctl list devices --json \
|
|
| /usr/bin/python3 -c "import json,sys;[print(x['udid']) for v in json.load(sys.stdin)['devices'].values() for x in v]"); do
|
|
/usr/libexec/PlistBuddy -c "Add :DevicePreferences:$udid dict" "$PLIST" 2>/dev/null || true
|
|
/usr/libexec/PlistBuddy -c "Set :DevicePreferences:$udid:ConnectHardwareKeyboard false" "$PLIST" 2>/dev/null \
|
|
|| /usr/libexec/PlistBuddy -c "Add :DevicePreferences:$udid:ConnectHardwareKeyboard bool false" "$PLIST" 2>/dev/null || true
|
|
done
|
|
|
|
echo "Disabled hardware keyboard for all simulators."
|