From 619f74d964da46ffbf5953dc0e5cf36ab62354f9 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Wed, 19 Aug 2026 13:11:16 +0200 Subject: [PATCH 1/3] test(e2e): Fix TurboModule flow viewport on Android emulator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../turboModuleSpanAttributes.test.yml | 41 ++++++++++++++++--- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/samples/react-native/e2e/tests/turboModuleSpanAttributes/turboModuleSpanAttributes.test.yml b/samples/react-native/e2e/tests/turboModuleSpanAttributes/turboModuleSpanAttributes.test.yml index e8bd2c0131..d683c189e0 100644 --- a/samples/react-native/e2e/tests/turboModuleSpanAttributes/turboModuleSpanAttributes.test.yml +++ b/samples/react-native/e2e/tests/turboModuleSpanAttributes/turboModuleSpanAttributes.test.yml @@ -30,13 +30,42 @@ appId: io.sentry.reactnative.sample - assertVisible: 'Sync: add x5 = 15' - assertVisible: 'Async: getPlatform = .*' -# The `turbo_module.*` attributes the TurboModuleContext integration attached -# to the root span are rendered on screen so QA can eyeball them on device. -- assertVisible: 'turbo_module.total_call_count: 6' -- assertVisible: 'turbo_module.total_error_count: 0' - -# A native throw surfaced to JS must still be capturable (crash-context path) +# Do the native-throw interaction BEFORE scrolling to the attributes: the throw +# button lives in the button group at the top of the screen, so it must be +# exercised while the viewport is still at the top. Scrolling down to the +# attribute block first (below) would push it off-screen on the shorter Android +# emulator and the tap would miss it. +# +# A native throw surfaced to JS must still be capturable (crash-context path). - tapOn: 'Throw from native platform' - extendedWaitUntil: visible: 'Throw: captured platform throw as .*' timeout: 30000 + +# The `turbo_module.*` attributes the TurboModuleContext integration attached +# to the root span are rendered on screen so QA can eyeball them on device. +# This block is the LAST content in a long ScrollView, so on the shorter Android +# emulator screen it starts below the fold — scroll it into view before asserting +# (`assertVisible` alone only sees the current viewport, which is why this never +# passed on Android since #6549). Kept last so nothing after it needs the top of +# the screen back. +# +# 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`. +# We deliberately don't pin the exact on-screen count here — it can race the +# async `getPlatform` record settling relative to the synchronous post-`end()` +# read. The exact aggregate counts are asserted against the transaction envelope +# in turboModuleSpanAttributes.test.ts, which is the authoritative source. +- scrollUntilVisible: + element: + text: 'turbo_module.total_call_count: .*' + direction: DOWN + timeout: 10000 +# Sorted alphabetically, `total_error_count` renders a few lines below +# `total_call_count`, so it may sit past the bottom edge after the scroll above — +# scroll to it independently rather than assume both fit in one viewport. +- scrollUntilVisible: + element: + text: 'turbo_module.total_error_count: 0' + direction: DOWN + timeout: 10000 From dbcc73a8670dcd9470b8e6d1caf3453cca633c71 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Wed, 19 Aug 2026 15:12:23 +0200 Subject: [PATCH 2/3] Remove uneeded comment --- .../turboModuleSpanAttributes.test.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/samples/react-native/e2e/tests/turboModuleSpanAttributes/turboModuleSpanAttributes.test.yml b/samples/react-native/e2e/tests/turboModuleSpanAttributes/turboModuleSpanAttributes.test.yml index d683c189e0..4329281e45 100644 --- a/samples/react-native/e2e/tests/turboModuleSpanAttributes/turboModuleSpanAttributes.test.yml +++ b/samples/react-native/e2e/tests/turboModuleSpanAttributes/turboModuleSpanAttributes.test.yml @@ -30,13 +30,6 @@ appId: io.sentry.reactnative.sample - assertVisible: 'Sync: add x5 = 15' - assertVisible: 'Async: getPlatform = .*' -# Do the native-throw interaction BEFORE scrolling to the attributes: the throw -# button lives in the button group at the top of the screen, so it must be -# exercised while the viewport is still at the top. Scrolling down to the -# attribute block first (below) would push it off-screen on the shorter Android -# emulator and the tap would miss it. -# -# A native throw surfaced to JS must still be capturable (crash-context path). - tapOn: 'Throw from native platform' - extendedWaitUntil: visible: 'Throw: captured platform throw as .*' From 94153d484a2d3b60bc8a77ea9d3932e1e2fb1841 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Wed, 19 Aug 2026 15:15:46 +0200 Subject: [PATCH 3/3] Simplify test comment --- .../turboModuleSpanAttributes.test.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/samples/react-native/e2e/tests/turboModuleSpanAttributes/turboModuleSpanAttributes.test.yml b/samples/react-native/e2e/tests/turboModuleSpanAttributes/turboModuleSpanAttributes.test.yml index 4329281e45..84b513223c 100644 --- a/samples/react-native/e2e/tests/turboModuleSpanAttributes/turboModuleSpanAttributes.test.yml +++ b/samples/react-native/e2e/tests/turboModuleSpanAttributes/turboModuleSpanAttributes.test.yml @@ -36,27 +36,14 @@ appId: io.sentry.reactnative.sample timeout: 30000 # The `turbo_module.*` attributes the TurboModuleContext integration attached -# to the root span are rendered on screen so QA can eyeball them on device. -# This block is the LAST content in a long ScrollView, so on the shorter Android -# emulator screen it starts below the fold — scroll it into view before asserting -# (`assertVisible` alone only sees the current viewport, which is why this never -# passed on Android since #6549). Kept last so nothing after it needs the top of -# the screen back. -# -# 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`. -# We deliberately don't pin the exact on-screen count here — it can race the -# async `getPlatform` record settling relative to the synchronous post-`end()` -# read. The exact aggregate counts are asserted against the transaction envelope +# to the root span are rendered on screen. Scroll it into view before asserting. +# The exact aggregate counts are asserted against the transaction envelope # in turboModuleSpanAttributes.test.ts, which is the authoritative source. - scrollUntilVisible: element: text: 'turbo_module.total_call_count: .*' direction: DOWN timeout: 10000 -# Sorted alphabetically, `total_error_count` renders a few lines below -# `total_call_count`, so it may sit past the bottom edge after the scroll above — -# scroll to it independently rather than assume both fit in one viewport. - scrollUntilVisible: element: text: 'turbo_module.total_error_count: 0'