chore(test): add e2e test for test-tabs-system-item-ios scenario#4147
Open
LKuchno wants to merge 24 commits into
Open
chore(test): add e2e test for test-tabs-system-item-ios scenario#4147LKuchno wants to merge 24 commits into
LKuchno wants to merge 24 commits into
Conversation
…mitem, add new tab with systemitem and empty title prop - no title
…efinition to match route_cofig order
…ns into @lkuchno/test-tab-system-item-ios
…ns into @lkuchno/e2e-test-tab-system-item-ios
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an iOS-only Detox e2e test suite for the test-tabs-system-item-ios single-feature scenario to validate systemItem behavior and runtime overrides (systemItem/title/icon), and updates the scenario + screen to support stable test targeting.
Changes:
- Added a new Detox e2e suite covering static rendering and runtime cycling/combination of
systemItem, title overrides, and icon overrides. - Updated the test screen to expose stable
testIDs for config state labels/section headers and tab bar items. - Updated scenario documentation to explicitly list what is and isn’t automated.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| FabricExample/e2e/single-feature-tests/tabs/test-tabs-system-item-ios.e2e.ts | New Detox suite for iOS systemItem tab bar behavior and overrides. |
| apps/src/tests/single-feature-tests/tabs/test-tabs-system-item-ios/index.tsx | Adds testIDs for Detox targeting and tab bar item IDs; minor JSX change. |
| apps/src/tests/single-feature-tests/tabs/test-tabs-system-item-ios/scenario.md | Documents current automation coverage and known manual gaps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+20
to
+66
| describeIfiOS('Tab Bar System Item', () => { | ||
| beforeAll(async () => { | ||
| await device.reloadReactNative(); | ||
| await selectSingleFeatureTestsScreen('Tabs', 'test-tabs-system-item-ios'); | ||
| }); | ||
|
|
||
| describe('Static System Item tab', () => { | ||
| it('should display the tab bar with system item titles and icons', async () => { | ||
| await expect(element(by.type('UITabBar'))).toBeVisible(); | ||
| await expect(element(by.text('Static System Item'))).toBeVisible(); | ||
| await expect(element(by.id('bookmark-tab-item'))).toHaveLabel( | ||
| 'Bookmarks', | ||
| ); | ||
| await expect(element(by.id('custom-tab-item'))).toHaveLabel('Favorites'); | ||
| await expect( | ||
| element(by.id('book.fill').and(by.label('bookmark'))).atIndex(0), | ||
| ).toExist(); | ||
| await expect( | ||
| element(by.id('star.fill').and(by.label('favorite'))).atIndex(0), | ||
| ).toExist(); | ||
| }); | ||
|
|
||
| it('tab bar item icon and title should remain the same when switching between tabs', async () => { | ||
| await element(by.id('custom-tab-item')).tap(); | ||
| await expect(element(by.text('Runtime Config'))).toBeVisible(); | ||
| await expect( | ||
| element(by.id('book.fill').and(by.label('bookmark'))).atIndex(0), | ||
| ).toExist(); | ||
| await expect(element(by.id('bookmark-tab-item'))).toHaveLabel( | ||
| 'Bookmarks', | ||
| ); | ||
|
|
||
| await element(by.id('bookmark-tab-item')).tap(); | ||
| await expect(element(by.text('Static System Item'))).toBeVisible(); | ||
| await expect( | ||
| element(by.id('book.fill').and(by.label('bookmark'))).atIndex(0), | ||
| ).toExist(); | ||
| await expect(element(by.id('bookmark-tab-item'))).toHaveLabel( | ||
| 'Bookmarks', | ||
| ); | ||
| }); | ||
| }); | ||
| }); | ||
|
|
||
| describe('Runtime Config tab — initial state', () => { | ||
| beforeAll(async () => { | ||
| await element(by.id('custom-tab-item')).tap(); |
Comment on lines
+2
to
+6
| import { | ||
| describeIfiOS, | ||
| forceTapByLabeliOS, | ||
| selectSingleFeatureTestsScreen, | ||
| } from '../../e2e-utils'; |
…g ai review comments" This reverts commit d298452.
kligarski
approved these changes
Jun 10, 2026
Comment on lines
+393
to
+395
| await element(by.id('heart').and(by.label('love'))) | ||
| .atIndex(0) | ||
| .tap(); |
kligarski
approved these changes
Jun 11, 2026
| async function tapSystemIconOption() { | ||
| await element(by.text('system')).atIndex(1).tap(); | ||
| } | ||
| function isIOSVersionAtLeast(version: string): boolean { |
Contributor
There was a problem hiding this comment.
Suggested change
| function isIOSVersionAtLeast(version: string): boolean { | |
| function isIOSVersionAtLeast(version: string): boolean { |
nit
Comment on lines
+41
to
+43
| const tabBarButtonType = isIOSVersionAtLeast('26.0') | ||
| ? '_UITabButton' | ||
| : 'UITabBarButton'; |
Contributor
There was a problem hiding this comment.
This is something that might break in the future if there are some changes to native hierarchy in next iOS versions but I don't think we have really any other option here so it's okay.
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
This PR implements the Detox e2e test suite for the
test-tabs-system-item-iosscenario, covering thesystemItemprop on iOS tab bar items.The test covers: static system item rendering, runtime
systemItemcycling (favorites/history/search), title override cycling (custom/hidden/system), icon override cycling (custom SFSymbols vs. system fallback), and combinations of all three overrides. All test blocks are wrapped indescribeIfiOSsince this feature is iOS-only. The scenario.md is updated to reflect what is and isn't automated.The following are explicitly not automated (documented in
scenario.md):Closes https://github.com/software-mansion/react-native-screens-labs/issues/1410
Changes
test-tabs-system-item-ios.e2e.ts- new Detox test suitetestIDattributes to config state display labels and section headers; addtabBarItemTestIDto both tab route configso enable reliable Detox targetingscenario.mdto replace "TBD" with the actual automation status, listing known gaps