RN Picker.Item doesn't have accessibility label when opened in Appium - react-native

I am using React Native picker (#react-native-community/picker) to create picker fields in react native.
Now after building the APK, I ran the app in Appium. My aim is to using Appium to select the picker items. For that I need accessibilityId. So, I passed accessibilityLabel in Picker and Picker.Item.
But when I am inspecting the items I can't find any accessibilityId.
I want to perform the click operations and create test script, and I don't want to use the XPath. That's why I want accessibilityId. Is there any way to make accessibilityId available to Picker Items? Or is there any way to select these items and do click operations?

In your react code try to add accessibilityLabel in some kind of tag that generates native "View" tag in android. You can try wrap this picker element in <TouchableOpacity> and then add the label.
<TouchableOpacity accessibilityLabel="picker-mr">

Related

How To Create Dynamic Top Tab React Native Like Dynamic tabs Android

I'm using "#react-navigation/material-top-tabs"
Is it possible to create tabs dynamically? Please suggest or provide a snack link with an example, I'm not able to get any solution to make it dynamic.

Components for only tabs in React-Native

I want to achieve this in react-native,
Is there a component that have this tab switching animation with also capability off adding an icon next to tabName if possible.
P.S: I found a component react-native-material-tabs but without the ability to an icon. Also found components that requires container component, where I just need one for tabs for my use case.

Render Sign In With Google button react native expo

I am trying to use expo google siginin. However I cannot find how to render the signin button itself. How do I get the actual button to render in my view?
I am using this doc: https://docs.expo.io/versions/v36.0.0/sdk/google/
Expo doesn't provide the button for you. You can use react-native-elements. They have a SocialIcon component, which does exactly what you need. Just give it type={"google"} as a prop.
<SocialIcon
title={"Sign In With Google"}
button={true}
type={"google"}
/>
More about the component here.

How to add unique ID for react native app without use accessibilityLabel

I need to write automation test for app that written in React Native.
Our developers have some problem with unique ID for each elements in app.
Right now, React Native does not support for unique ID, but support contentDescription via accessibilityLabel.
The problem is that we can't currently use accessibilityLabel attribute, because we need it for accessibility in the future.
The question is, how to give unique ID for elements and not find them by xpath, since xpath doesn't suit us.

React Native: Popup menu like dev menu

in my app I wanna have a pop up menu that looks like the dev menu, and I wonder if there is a component / module that I can use to get a similar menu in react native or do I have to build it from scratch?
Thanks :)
you can use NativeBase ActionSheet component
check it doc for more info