Skip to content

Commit f42d2f3

Browse files
antonisclaude
andcommitted
test(e2e): Scroll TurboModule attribute block into view on Android
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 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`). 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>
1 parent e8007a7 commit f42d2f3

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

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

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,30 @@ appId: io.sentry.reactnative.sample
3232

3333
# The `turbo_module.*` attributes the TurboModuleContext integration attached
3434
# 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'
35+
# This block is the LAST content in a long ScrollView, so on the shorter Android
36+
# emulator screen it starts below the fold — scroll it into view before asserting
37+
# (`assertVisible` alone only sees the current viewport, which is why this never
38+
# passed on Android since #6549).
39+
#
40+
# Match the full line with a regex: Maestro anchors `assertVisible` text to the
41+
# whole node, so a bare `total_call_count:` prefix would NOT match `... : 6`.
42+
# We deliberately don't pin the exact on-screen count here — it can race the
43+
# async `getPlatform` record settling relative to the synchronous post-`end()`
44+
# read. The exact aggregate counts are asserted against the transaction envelope
45+
# in turboModuleSpanAttributes.test.ts, which is the authoritative source.
46+
- scrollUntilVisible:
47+
element:
48+
text: 'turbo_module.total_call_count: .*'
49+
direction: DOWN
50+
timeout: 10000
51+
# Sorted alphabetically, `total_error_count` renders a few lines below
52+
# `total_call_count`, so it may sit past the bottom edge after the scroll above —
53+
# scroll to it independently rather than assume both fit in one viewport.
54+
- scrollUntilVisible:
55+
element:
56+
text: 'turbo_module.total_error_count: 0'
57+
direction: DOWN
58+
timeout: 10000
3759

3860
# A native throw surfaced to JS must still be capturable (crash-context path)
3961
- tapOn: 'Throw from native platform'

0 commit comments

Comments
 (0)