Skip to content

chore(test): e2e test-tabs-ime-insets-android#4154

Open
LKuchno wants to merge 6 commits into
mainfrom
@lkuchno/e2e-test-tabs-IME-insets
Open

chore(test): e2e test-tabs-ime-insets-android#4154
LKuchno wants to merge 6 commits into
mainfrom
@lkuchno/e2e-test-tabs-IME-insets

Conversation

@LKuchno

@LKuchno LKuchno commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds a Detox e2e test covering the Android-only tabBarRespectsIMEInsets behavior for the TabsHost/TabsScreen components. The test exercises all four combinations of tabBarRespectsIMEInsets (true/false) and safeAreaViewBottomEdgeEnabled (true/false), asserting that the tab bar and on-screen text either remain stationary or shift up as expected.

The test screen (test-tabs-ime-insets-android) is lightly amended to add testID props to all interactive elements and tab bar items so the Detox queries are unambiguous. The scenario metadata is updated to reflect that e2e coverage is now complete.

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

Changes

  • e2e/Android: Added test-tabs-ime-insets-android.e2e.ts — Detox suite guarded by describeIfAndroid covering four tabBarRespectsIMEInsets × safeAreaViewBottomEdgeEnabled combinations, with frame-Y assertions before/after keyboard open and after dismiss
  • e2e/Android: Added readKeyboardTopAndroid / getKeyboardTopAndroid helpers that parse adb dumpsys window output to determine the stable IME frame top, and dismissKeyboardAndroid that calls device.pressBack() and polls until the keyboard is gone
  • Test screen: Added testID props to the two Switch controls, the TextInput, the bottom Text, and the config tab bar item in test-tabs-ime-insets-android/index.tsx to make Detox queries deterministic
  • Scenario metadata: Updated scenario-description.ts e2eCoverage from 'tbd' to 'full' and updated scenario.md to document that all manual steps are covered by the new e2e test

@LKuchno LKuchno requested a review from Copilot June 11, 2026 11:55
@LKuchno LKuchno changed the title chore(test): e2e test for ime chore(test): e2e test-tabs-ime-insets-android Jun 11, 2026
@LKuchno LKuchno added platform:android Issue related to Android part of the library 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. labels Jun 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Android-only Detox E2E coverage for tabBarRespectsIMEInsets behavior in the Tabs single-feature test scenario, plus the necessary testID hooks and scenario metadata updates so the new automation is discoverable and deterministic.

Changes:

  • Adds a new Detox suite (test-tabs-ime-insets-android.e2e.ts) that validates tab bar/text vertical positioning across four prop combinations while the IME opens/closes.
  • Updates the test screen to include stable testID values for switches, text input, bottom text, and tab bar items.
  • Marks the scenario’s E2E coverage as full and updates the scenario docs accordingly.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
FabricExample/e2e/single-feature-tests/tabs/test-tabs-ime-insets-android.e2e.ts New Android-only Detox test that measures element frame Y + IME top (via adb dumpsys window) across prop combinations.
apps/src/tests/single-feature-tests/tabs/test-tabs-ime-insets-android/index.tsx Adds testID/tabBarItemTestID hooks so Detox selectors are unambiguous.
apps/src/tests/single-feature-tests/tabs/test-tabs-ime-insets-android/scenario-description.ts Updates e2eCoverage metadata from tbdfull.
apps/src/tests/single-feature-tests/tabs/test-tabs-ime-insets-android/scenario.md Documents that the scenario is now fully covered by E2E.

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


TBD: Planned, but will be implemented separately.
Full: All manual steps are covered by an E2E test based on changes to the tab bar
and text frame Y-positions,as well as their positions relative to the open keyboard.
Comment on lines +102 to +113
const kbTop = await getKeyboardTopAndroid();
const yTabAfter = (await getTabBarItemAttrs()).frame.y;
const yTextAfter = (await getTextAttrs()).frame.y;

jestExpect(yTabAfter).toEqual(yTabBefore);
jestExpect(yTextAfter).toEqual(yTextBefore);
jestExpect(
yTabAfter + (await getTabBarItemAttrs()).frame.height,
).toBeGreaterThan(kbTop);
jestExpect(
yTextAfter + (await getTextAttrs()).frame.height,
).toBeGreaterThan(kbTop);
Comment on lines +129 to +141
const kbTop = await getKeyboardTopAndroid();
const yTabAfter = (await getTabBarItemAttrs()).frame.y;
const yTextAfter = (await getTextAttrs()).frame.y;

jestExpect(yTabAfter).toBeLessThan(yTabBefore);
jestExpect(yTextAfter).toBeLessThan(yTextBefore);
jestExpect(yTextAfter).toBeLessThan(yTabAfter);
jestExpect(
yTabAfter + (await getTabBarItemAttrs()).frame.height,
).toBeLessThanOrEqual(kbTop);
jestExpect(
yTextAfter + (await getTextAttrs()).frame.height,
).toBeLessThanOrEqual(kbTop);
Comment on lines +166 to +172
const kbTop = await getKeyboardTopAndroid();
const yTabAfter = (await getTabBarItemAttrs()).frame.y;
const yTextAfter = (await getTextAttrs()).frame.y;

jestExpect(
yTabAfter + (await getTabBarItemAttrs()).frame.height,
).toBeLessThanOrEqual(kbTop);
Comment on lines +194 to +205
const kbTop = await getKeyboardTopAndroid();
const yTabAfter = (await getTabBarItemAttrs()).frame.y;
const yTextAfter = (await getTextAttrs()).frame.y;

jestExpect(yTabAfter).toEqual(yTabBefore);
jestExpect(yTextAfter).toEqual(yTextBefore);
jestExpect(
yTabAfter + (await getTabBarItemAttrs()).frame.height,
).toBeGreaterThan(kbTop);
jestExpect(
yTextAfter + (await getTextAttrs()).frame.height,
).toBeGreaterThan(kbTop);
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 platform:android Issue related to Android part of the library 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