software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
5.85k stars 954 forks source link

Unable to pass testID prop to RectButton #1661

Open nextlevelbeard opened 2 years ago

nextlevelbeard commented 2 years ago

testID prop on RectButton component does not take effect. Furthermore, accessible prop also appears to suffer from the same issue. With RN 0.64.

<RectButton testID="test">
thecodecafe commented 2 years ago

@nextlevelbeard I was just reading your article on using Appium with react native, I'm thinking we need an accessibilityLabel as well since Appium needs this for creating the X-Path for android testID appears to not be used for android according to this post from Appium.

bsmith-self commented 1 year ago

Any movement on adding one or both of these props? We are also trying to test our RN app with Appium, and this seems like a pretty simple passthrough. I might be willing to make a PR myself if the maintainers would be open to that

fcoradini commented 1 month ago

I am working with React Native/Appium and required the ID for my selectors. I was able to achieve this using accessibilityLabel on RectButton.

accessibilityLabel on React Native generates accessibility-id on both Android and iOS (ref)

"react-native": "0.72.6",
"react-native-gesture-handler": "~2.12.0",
dgreasi commented 1 month ago

I am having the same using while trying to test the app with Maestro. The testID is available in iOS but not in Android.

I am guessing something is off.

My workaround is quite similar with the above recommendations.

For now I am using accessibilityLabel in the View I have inside RectButton since the RectButton itself doesn't accept an accessibilityLabel.

"react-native": "0.72.5",
"react-native-gesture-handler": "^2.16.0",