chore(test): e2e test-tabs-ime-insets-android#4154
Open
LKuchno wants to merge 6 commits into
Open
Conversation
…ents and with open keyboard
…ns into @lkuchno/e2e-test-tabs-IME-insets
Contributor
There was a problem hiding this comment.
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
testIDvalues for switches, text input, bottom text, and tab bar items. - Marks the scenario’s E2E coverage as
fulland 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 tbd → full. |
| 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); |
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
Adds a Detox e2e test covering the Android-only
tabBarRespectsIMEInsetsbehavior for theTabsHost/TabsScreencomponents. The test exercises all four combinations oftabBarRespectsIMEInsets(true/false) andsafeAreaViewBottomEdgeEnabled(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 addtestIDprops 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
test-tabs-ime-insets-android.e2e.ts— Detox suite guarded bydescribeIfAndroidcovering fourtabBarRespectsIMEInsets×safeAreaViewBottomEdgeEnabledcombinations, with frame-Y assertions before/after keyboard open and after dismissreadKeyboardTopAndroid/getKeyboardTopAndroidhelpers that parseadb dumpsys windowoutput to determine the stable IME frame top, anddismissKeyboardAndroidthat callsdevice.pressBack()and polls until the keyboard is gonetestIDprops to the twoSwitchcontrols, theTextInput, the bottomText, and the config tab bar item intest-tabs-ime-insets-android/index.tsxto make Detox queries deterministicscenario-description.tse2eCoveragefrom'tbd'to'full'and updatedscenario.mdto document that all manual steps are covered by the new e2e test