[Android] ActivityIndicator: setting resource-id from the testID prop#48271
Closed
mateoguzmana wants to merge 3 commits intofacebook:mainfrom
Closed
[Android] ActivityIndicator: setting resource-id from the testID prop#48271mateoguzmana wants to merge 3 commits intofacebook:mainfrom
resource-id from the testID prop#48271mateoguzmana wants to merge 3 commits intofacebook:mainfrom
Conversation
resource-id from the testID propresource-id from the testID prop
bdb2f31 to
d5a918f
Compare
javache
approved these changes
Dec 16, 2024
Contributor
|
@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
Collaborator
|
This pull request was successfully merged by @mateoguzmana in 87b1bad When will my fix make it into a release? | How to file a pick request? |
facebook-github-bot
pushed a commit
that referenced
this pull request
Dec 19, 2024
Summary: Follow up from #48271 and #48254, I noticed that the Modal component also doesn't map the `resource-id` from the `testID` on Android. This PR addresses that. ## Changelog: [ANDROID] [FIXED] - Modal: Setting `resource-id` from `testID` prop Pull Request resolved: #48313 Test Plan: Alternatively do: ``` $ adb shell uiautomator dump UI hierchary dumped to: /sdcard/window_dump.xml $ adb pull /sdcard/window_dump.xml /sdcard/window_dump.xml: 1 file pulled, 0 skipped. 1.1 MB/s (3505 bytes in 0.003s) ``` and check in XML: ` resource-id="playground-modal" class="android.view.ViewGroup" ` ------- Using Appium, check that the `testID` prop passed from JS is mapped as `resource-id` in the rendered view group of the Modal. <details> <summary>Example of the code implementation in the RNTester Playground:</summary> ```tsx function Playground() { const [modalVisible, setModalVisible] = React.useState(false); return ( <> <Modal visible={modalVisible} testID="playground-modal"> <Text testID="inner-text-test-id">Hello World!</Text> </Modal> <Button title="Open Modal" onPress={() => { setModalVisible(true); }} /> </> ); } ``` </details> <details> <summary>Output in Appium Inspector:</summary> <img width="913" alt="image" src="https://github.com/user-attachments/assets/514ae2b3-35a8-4a1a-8efc-1ca6bd73f189" /> </details> Reviewed By: javache Differential Revision: D67369350 Pulled By: alanleedev fbshipit-source-id: a799ad5b974895a39d9287e3d76d1139a6ef6a83
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.
Summary:
Fixes #39092
Right now, the
testIDprop that is passed to the ActivityIndicator component is not being applied as aresource-id. In this PR, we overwrite theonInitializeAccessibilityNodeInfoin theProgressBarContainerViewto set thisresource-id.Changelog:
[ANDROID][ADDED] - ActivityIndicator: setting
resource-idfrom thetestIDpropTest Plan:
Render a simple activity indicator and pass a
testIDas follows:Inspect the element using an e2e tool such as Maestro or Appium, the `resource-id` is not present: (see screenshot)
Apply the changes and then:
Inspect again, the `resource-id` is present now: (see screenshot)