Skip to content

chore(test): e2e test-tabs-tab-bar-layout-direction#3899

Open
LKuchno wants to merge 24 commits intomainfrom
@lkuchno/e2e-test-tabs-tab-bar-layout-direction
Open

chore(test): e2e test-tabs-tab-bar-layout-direction#3899
LKuchno wants to merge 24 commits intomainfrom
@lkuchno/e2e-test-tabs-tab-bar-layout-direction

Conversation

@LKuchno
Copy link
Copy Markdown
Collaborator

@LKuchno LKuchno commented Apr 17, 2026

Description

This PR introduces E2E Detox automation for the test-tabs-tab-bar-layout-direction scenario verifying TabBar layout direction logic. The changes ensure that the direction prop correctly respects or overrides system LTR/RTL settings. Included updates to the test screen to provide necessary testID hooks for Detox.

Closes: https://github.com/software-mansion/react-native-screens-labs/issues/1143

Changes

test-tabs-tab-bar-layout-direction.e2e.ts:

  • Implemented full cross-platform Detox suite.
  • Added logic to toggle system RTL via launch arguments on iOS and UI interaction on Android.
  • Utilized frame coordinate validation to verify visual positioning of tabs.

test-tabs-tab-bar-layout-direction/index.tsx:

  • Added testID props to the ScrollView, RTL info text, and pickers.
  • Renamed "Config" tab to "Tab1" for better alignment with the test scenario.
  • Added tabBarItemAccessibilityLabel to both routes to facilitate coordinate-based testing.

test-tabs-tab-bar-layout-direction/scenario.md:

  • Refined scenario structure to follow agreed template.
  • Synchronized expected outcomes with the new E2E implementation details.
  • Removed section 'Precedence chain verification' as those steps were focused on system/RN settings.

@LKuchno LKuchno requested a review from kkafar April 17, 2026 10:12
@LKuchno LKuchno marked this pull request as draft April 17, 2026 10:17
@LKuchno LKuchno changed the title @lkuchno/e2e test tabs tab bar layout direction chore(test): e2e test_tabs_tab_bar_layout direction Apr 17, 2026
@LKuchno LKuchno changed the title chore(test): e2e test_tabs_tab_bar_layout direction chore(test): e2e test_tabs_tab_bar_layout_direction Apr 17, 2026
@LKuchno LKuchno added area:tabs Issue related to bottom tabs type:e2e Actions related to e2e maintenance and development, especially automation. type:chore A general maintenance task, that does not fall into other categories. labels Apr 17, 2026
@LKuchno LKuchno marked this pull request as ready for review April 17, 2026 14:04
@LKuchno LKuchno marked this pull request as draft April 21, 2026 10:37
@LKuchno LKuchno marked this pull request as ready for review April 22, 2026 11:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Detox E2E test suite for the test-tabs-tab-bar-layout-direction single-feature scenario to validate TabBar ordering under LTR/RTL, and updates the scenario screen/docs to provide the hooks and expectations needed for automation.

Changes:

  • Added a cross-platform Detox suite that asserts visual tab ordering via element frame coordinates under LTR and RTL.
  • Updated the test scenario screen with testID hooks and accessibility labels for stable E2E targeting.
  • Refined the manual scenario markdown to match the new automated coverage and expected outcomes.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
apps/src/tests/single-feature-tests/tabs/test-tabs-tab-bar-layout-direction/scenario.md Updates the written scenario structure and expected outcomes to align with the new E2E coverage.
apps/src/tests/single-feature-tests/tabs/test-tabs-tab-bar-layout-direction/index.tsx Adds Detox-targetable testIDs and tab item accessibility labels; renames the first tab to “Tab1”.
FabricExample/e2e/single-feature-tests/tabs/test-tabs-tab-bar-layout-direction.e2e.ts Introduces the Detox test suite validating tab ordering under LTR/RTL and direction overrides.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

'Tabs',
'test-tabs-tab-bar-layout-direction',
);
await element(by.id('react-allow-rtl-picker')).tap();
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android cleanup in afterAll toggles allowRTL instead of reverting forceRTL. Since I18nManager.forceRTL() is persisted, this can leak RTL into later E2E runs. Restore the original state by disabling forceRTL again (and re-enabling allowRTL if it was changed) before reloading React Native.

Suggested change
await element(by.id('react-allow-rtl-picker')).tap();
await element(by.id('react-force-rtl-picker')).tap();

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +76 to 78
- [ ] Expected: Tab bar displays in LTR order — TabsHost overrides RTL from
RN/system. Tab1 is displayed as the the leftmost item.

Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate word in expected outcome: "as the the leftmost item" should be "as the leftmost item".

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…tabs-tab-bar-layout-direction/scenario.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
LKuchno and others added 4 commits April 27, 2026 11:24
…layout-direction.e2e.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…out-direction/scenario.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…out-direction/scenario.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…out-direction/scenario.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@LKuchno LKuchno changed the title chore(test): e2e test_tabs_tab_bar_layout_direction chore(test): e2e test-tabs-tab-bar-layout-direction Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tabs Issue related to bottom tabs type:chore A general maintenance task, that does not fall into other categories. type:e2e Actions related to e2e maintenance and development, especially automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants