-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] ActivityIndicator: setting resource-id
from the testID
prop
#48271
Closed
mateoguzmana
wants to merge
3
commits into
facebook:main
from
mateoguzmana:fix/android-activity-indicator-test-id
Closed
[Android] ActivityIndicator: setting resource-id
from the testID
prop
#48271
mateoguzmana
wants to merge
3
commits into
facebook:main
from
mateoguzmana:fix/android-activity-indicator-test-id
Conversation
This file contains 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
facebook-github-bot
added
the
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
label
Dec 14, 2024
facebook-github-bot
added
the
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
label
Dec 14, 2024
mateoguzmana
changed the title
[Android] ActivityIndicator: setting
[Android] ActivityIndicator: setting Dec 14, 2024
resource-id
from the testID propresource-id
from the testID
prop
mateoguzmana
force-pushed
the
fix/android-activity-indicator-test-id
branch
from
December 15, 2024 23:42
bdb2f31
to
d5a918f
Compare
javache
approved these changes
Dec 16, 2024
@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Merged
This PR has been merged.
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
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
testID
prop that is passed to the ActivityIndicator component is not being applied as aresource-id
. In this PR, we overwrite theonInitializeAccessibilityNodeInfo
in theProgressBarContainerView
to set thisresource-id
.Changelog:
[ANDROID][ADDED] - ActivityIndicator: setting
resource-id
from thetestID
propTest Plan:
Render a simple activity indicator and pass a
testID
as 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)