react-native-gesture-handler icon indicating copy to clipboard operation
react-native-gesture-handler copied to clipboard

Unable to pass testID prop to RectButton

Open nextlevelbeard opened this issue 4 years ago • 6 comments

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">

nextlevelbeard avatar Sep 28 '21 09:09 nextlevelbeard

@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.

thecodecafe avatar Oct 15 '21 10:10 thecodecafe

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

bsmith-self avatar Feb 01 '23 21:02 bsmith-self

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",

fcoradini avatar Mar 27 '24 23:03 fcoradini

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",

dgreasi avatar Apr 03 '24 09:04 dgreasi