Skip to content

Commit c9a59ea

Browse files
chore: reduce ios simulator animations
1 parent d35bec0 commit c9a59ea

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

maestro/helpers/prepare_ios.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,34 @@ elif best:
6464
xcrun simctl bootstatus "$DEVICE_ID" -b || echo "Simulator booted"
6565
}
6666

67+
# Cut UIKit animation time, mirroring `disable-animations: true` on the Android emulator
68+
# (NativePipeline.yml) — iOS previously had no equivalent, so every navigation push/modal
69+
# played at full length on a 3-vCPU runner while Android's ran instantly.
70+
#
71+
# Scope: this shortens SYSTEM transitions (nav pushes, modal presents, alerts). React
72+
# Native's `Animated` does NOT read this flag automatically, so widget-internal animations
73+
# (carousel, animation-native) are unaffected — this is not a substitute for the per-flow
74+
# waits those need.
75+
#
76+
# Requires a BOOTED device (`simctl spawn`), so call after start_simulator. The value is
77+
# written to the device's persistent domain and survives shutdown/boot, so a
78+
# restart_simulator in helpers.sh keeps it.
79+
reduce_motion() {
80+
echo "Reducing motion on iOS Simulator..."
81+
if [ -z "$SIMULATOR_DEVICE_ID" ]; then
82+
echo "Error: SIMULATOR_DEVICE_ID not set"
83+
return 1
84+
fi
85+
# Best-effort: a future runtime that drops/renames these keys should not fail the shard,
86+
# since tests still pass with animations on (just slower).
87+
xcrun simctl spawn "$SIMULATOR_DEVICE_ID" defaults write com.apple.Accessibility ReduceMotionEnabled -bool true \
88+
|| echo "::warning::Could not set ReduceMotionEnabled; animations stay at full length"
89+
# Replaces the sliding push/pop transition with a cross-fade — the slide is what Maestro
90+
# most often races against when asserting right after a navigation tap.
91+
xcrun simctl spawn "$SIMULATOR_DEVICE_ID" defaults write com.apple.Accessibility ReduceMotionReduceSlideTransitionsEnabled -bool true \
92+
|| echo "::warning::Could not set ReduceMotionReduceSlideTransitionsEnabled"
93+
}
94+
6795
set_status_bar() {
6896
echo "Setting status bar on iOS Simulator..."
6997
if [ -z "$SIMULATOR_DEVICE_ID" ]; then
@@ -92,6 +120,7 @@ verify_installed_app() {
92120
}
93121

94122
start_simulator
123+
reduce_motion
95124
set_status_bar
96125
install_ios_app
97126
verify_installed_app

packages/pluggableWidgets/intro-screen-native/e2e/specs/maestro/IntroScreen.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ appId: "${APP_ID}"
66
text: "I"
77
- tapOn:
88
text: "Intro screen"
9+
# Opening the page mounts the widget and waits on the runtime, unlike the in-flow waits
10+
# below which only cover an on-device slide transition. 5s was flaky on the CI simulator
11+
# (3 vCPU, shared with the Mendix runtime JVM); 15s matches the repo's usual budget.
912
- extendedWaitUntil:
1013
visible: "Active slide: 2"
11-
timeout: 5000
14+
timeout: 15000
1215
- assertVisible:
1316
text: "Changes: 0"
1417
- swipe:
@@ -42,9 +45,11 @@ appId: "${APP_ID}"
4245
- tapOn: "Go back"
4346
- tapOn:
4447
text: "Intro screen"
48+
# Re-entry remounts the widget, which must reposition to the attribute's slide — same
49+
# page-entry cost as the first open, so the same 15s budget rather than 5s.
4550
- extendedWaitUntil:
4651
visible: "Active slide: 2"
47-
timeout: 5000
52+
timeout: 15000
4853
- tapOn:
4954
text: "NEXT"
5055
- extendedWaitUntil:

0 commit comments

Comments
 (0)