chore(test): Android test-stack-toolbar-nested-menu-android coverage - #4448
Merged
LKuchno merged 8 commits intoAug 10, 2026
Merged
Conversation
…ns into @lkuchno/e2e-test-stack-toolbar-nested-menu-android
Contributor
There was a problem hiding this comment.
Pull request overview
Adds comprehensive Android-only Detox e2e coverage for the existing “stack toolbar nested menu” scenario in the example app, including nested submenu navigation, command-driven mutations, and props-driven rebuild semantics.
Changes:
- Added a new Android e2e spec that exercises nested overflow-menu/submenu behavior, click handling, imperative commands, and props-update rebuild resets.
- Extended shared e2e utilities with
waitUntil(...)polling and an opt-inorEmptymode forgetMatches/countMatches. - Updated the scenario screen and docs to support stable e2e targeting (
testIDs + exported option types) and to document device/form-factor constraints.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| FabricExample/e2e/single-feature-tests/stack-v5/test-stack-toolbar-nested-menu-android.e2e.ts | New Android Detox spec covering nested toolbar overflow menu/submenus, commands, and props rebuild behavior. |
| FabricExample/e2e/single-feature-tests/stack-v5/test-stack-simple-nav.e2e.ts | Refactors local polling helpers to reuse shared waitUntil (no intended behavior change). |
| FabricExample/e2e/native-class-names.ts | Adds Android class-name constants needed to match popup menu rows and submenu arrows. |
| FabricExample/e2e/e2e-utils.ts | Adds waitUntil and extends getMatches/countMatches with optional orEmpty behavior. |
| apps/src/tests/single-feature-tests/stack-v5/test-stack-toolbar-nested-menu-android/scenario.md | Updates scenario docs to reflect full e2e coverage and the phone form-factor prerequisite. |
| apps/src/tests/single-feature-tests/stack-v5/test-stack-toolbar-nested-menu-android/scenario-description.ts | Flips e2eCoverage from tbd to full. |
| apps/src/tests/single-feature-tests/stack-v5/test-stack-toolbar-nested-menu-android/index.tsx | Adds testIDs for e2e automation and exports option/id types reused by the new spec. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LKuchno
marked this pull request as ready for review
August 5, 2026 07:38
t0maboro
approved these changes
Aug 10, 2026
LKuchno
deleted the
@lkuchno/e2e-test-stack-toolbar-nested-menu-android
branch
August 10, 2026 14:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes: https://github.com/software-mansion/react-native-screens-labs/issues/1715
Adds full Detox e2e coverage for the
test-stack-toolbar-nested-menu-androidscenario — Android toolbar menus with nested submenus. The scenario screen
already existed with
e2eCoverage: 'tbd'; this PR implements the automationfor every step and flips the coverage to
full.The new spec exercises the four things the scenario describes:
menuTitle, with a fallback totitle) at every nesting level, including a doubly nested submenu,levels down (
title,hidden,menuTitle),command-applied state and rebuilds the tree.
Two scenario steps (19 and 27) leave a submenu entry with no text for Detox to
match, so they are reached by row position within the overflow menu instead;
the absence of a submenu header is asserted indirectly, since a header would
otherwise show up as an extra match for the text it renders.
Changes
FabricExample/e2e/single-feature-tests/stack-v5/test-stack-toolbar-nested-menu-android.e2e.ts(37 test cases across 9
describeblocks).e2e-utils.ts:getMatches/countMatchesaccept anorEmptyoption so an expectedabsence resolves to
[]/0instead of throwing. It is opt-in preciselybecause it also swallows a crashed app or a dropped Detox connection.
waitUntil(predicate, { timeout, interval, message })forconditions Detox's
waitForcannot express. On AndroidwaitForis onenative call retrying inside the app, so it asserts one property of one view
and the matcher needs a literal
atIndex— which rules out waiting on amatch count, or on the last match while the count is still settling. Both
come up here; the full rationale is in the function's JSDoc.
messageaccepts a builder function so the timeout error can report what the last
poll observed.
tapTopmostneeds a freshly built matcher — Detox'satIndexrewrites the matcher in place on Android.native-class-names.ts: addedListMenuItemView(a popup menu row, theanchor for addressing widgets by item title) and
AppCompatImageView(
group_divider/submenuarrow).test-stack-simple-nav.e2e.ts: rewrote its two local polling helpers on topof the shared
waitUntil. No behavior change.testIDs to the pickers, switches, send-command buttonand result text, and exported the option types the e2e spec reuses.
scenario.md: documented the e2e coverage and the phone-form-factorprerequisite — from 720dp smallest-width up, AppCompat opens submenus as
cascading popups next to their parent rather than replacing it, which the
test does not account for.