FaridSafi / react-native-google-places-autocomplete

Customizable Google Places autocomplete component for iOS and Android React-Native apps
MIT License
2k stars 849 forks source link

Feature Request: Add testID for each row on the adresse list #791

Open grolousi opened 2 years ago

grolousi commented 2 years ago

Is your feature request related to a problem? Please describe.

I'm doing E2E testing and I need to inject a testID prop to be able to interact with a component. Using the TextInputProps I'm able to do that with the input but not the with the items in the list.

Describe the solution you'd like

Add an "testID" prop to the TouchableHighlight on the "_renderRowComponent"

Note: Maybe there is a way to do that already and I didn't find it

Thank you for your time !

grolousi commented 2 years ago

@FaridSafi @bell-steven I'll be glad to do the PR if needed. Just want to be sure I didn't miss something

Thank for you time !

jomasim commented 1 year ago

using detox try this: <Box testID="address"> <GooglePlacesAutocomplete ref={ref} listViewDisplayed="auto" fetchDetails={true} onPress={(data, details = null) => { if (details) { handleLocationSelection(details) } }} placeholder="Search..." query={{ ... }} /> </Box>

access element: await element(by.id('address')).typeText('south west')

KrisLau commented 1 year ago

I would also like this feature as tapping based on the accessible text using Maestro is inconsistent

MarcHbb commented 5 months ago

It would be a nice feature for integration tests