Skip to content

Commit ebaf461

Browse files
antonisclaude
andcommitted
fix(e2e): Wait for native replay buffer before capturing exception
The captureReplay e2e test taps "Capture Exception" immediately after the app reports ready. On slow CI simulators the native replay buffer may not have captured its first frame yet, causing captureReplay() to return false and the replay_id to be missing from the error event. Add a short Maestro flow with UI interactions (~3s of swipes) between app init and the exception capture to let the buffer populate. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 98b00f0 commit ebaf461

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

dev-packages/e2e-tests/maestro/captureReplay.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ jsEngine: graaljs
55
file: utils/launchTestAppClear.yml
66
env:
77
replaysOnErrorSampleRate: 1.0
8+
- runFlow:
9+
file: utils/waitForReplayBuffer.yml
10+
when:
11+
platform: iOS
812
- tapOn: "Capture Exception"
913
- runFlow: utils/assertEventIdVisible.yml
1014
- runFlow:
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
appId: ${APP_ID}
2+
jsEngine: graaljs
3+
---
4+
# The native replay integration captures screenshots at ~1 FPS.
5+
# After Sentry.init completes (signalled by "E2E Tests Ready"),
6+
# the replay buffer may still be empty. If captureReplay() is
7+
# called before any frames exist, it returns false and the
8+
# replay_id is never attached to the error event.
9+
#
10+
# Perform UI interactions to both create a natural delay (~3s)
11+
# and give the replay meaningful content to capture.
12+
- swipe:
13+
direction: DOWN
14+
duration: 800
15+
- swipe:
16+
direction: UP
17+
duration: 800
18+
- swipe:
19+
direction: DOWN
20+
duration: 800
21+
- swipe:
22+
direction: UP
23+
duration: 800

0 commit comments

Comments
 (0)