Skip to content

Commit 7eeebd1

Browse files
antonisclaude
andauthored
test(e2e): De-flake TurboModule span-attribute count assertion (#6596)
* test(e2e): Fix TurboModule flow viewport on Android emulator The `turbo_module.*` attribute block is the last content in a long ScrollView, so on the shorter Android emulator screen it renders below the fold. `assertVisible` only inspects the current viewport, so the `turbo_module.total_call_count: 6` assertion has failed on every Android REV2 run since #6549 introduced the test, while iOS (taller screen, block in view) has been green — proving the SDK and on-device render are correct. - Scroll the attribute block into view before asserting, and match the full line with a regex (Maestro anchors `assertVisible` text to the whole node, so a bare `total_call_count:` prefix would not match `... : 6`). - Run the native-throw interaction before that scroll: the throw button is at the top of the screen and must be tapped while the viewport is still there, otherwise scrolling to the attributes pushes it off-screen on Android. The exact on-screen count is intentionally not pinned — it can race the async `getPlatform` record settling against the synchronous post-`end()` read; the authoritative counts are asserted against the transaction envelope in turboModuleSpanAttributes.test.ts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Remove uneeded comment * Simplify test comment --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e8007a7 commit 7eeebd1

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

samples/react-native/e2e/tests/turboModuleSpanAttributes/turboModuleSpanAttributes.test.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,22 @@ appId: io.sentry.reactnative.sample
3030
- assertVisible: 'Sync: add x5 = 15'
3131
- assertVisible: 'Async: getPlatform = .*'
3232

33-
# The `turbo_module.*` attributes the TurboModuleContext integration attached
34-
# to the root span are rendered on screen so QA can eyeball them on device.
35-
- assertVisible: 'turbo_module.total_call_count: 6'
36-
- assertVisible: 'turbo_module.total_error_count: 0'
37-
38-
# A native throw surfaced to JS must still be capturable (crash-context path)
3933
- tapOn: 'Throw from native platform'
4034
- extendedWaitUntil:
4135
visible: 'Throw: captured platform throw as .*'
4236
timeout: 30000
37+
38+
# The `turbo_module.*` attributes the TurboModuleContext integration attached
39+
# to the root span are rendered on screen. Scroll it into view before asserting.
40+
# The exact aggregate counts are asserted against the transaction envelope
41+
# in turboModuleSpanAttributes.test.ts, which is the authoritative source.
42+
- scrollUntilVisible:
43+
element:
44+
text: 'turbo_module.total_call_count: .*'
45+
direction: DOWN
46+
timeout: 10000
47+
- scrollUntilVisible:
48+
element:
49+
text: 'turbo_module.total_error_count: 0'
50+
direction: DOWN
51+
timeout: 10000

0 commit comments

Comments
 (0)