react-native-picker / picker

Picker is a cross-platform UI component for selecting an item from a list of options.
MIT License
1.45k stars 273 forks source link

[BUG] [iOS] Picker item testID does not show up in Appium / BrowserStack #493

Open jesuscc1993 opened 1 year ago

jesuscc1993 commented 1 year ago

Summary

The testID prop is set to items but it does not show up in Appium / BrowserStack when loading the iOS build.

Context

The testID prop is properly set:

{
  label: 'Algérie',
  testID: 'bsid-dz',
  value: 'DZ'
}

...and can be seen when debugging XCode:

xcode-debugger

However, this ID does not appear in any form when inspecting the app in Appium / BrowserStack:

appium-censored

At first I thought this had to be some issue on our end, since no one else seems to be complaining about it. But it looks like everything is as it should be and I have not been able to make any progress on this so I started to think this might actually be a library issue.

I tried updating the code to this:

// this makes it so accessibility props are accounted for
label.isAccessibilityElement = YES;
// these should show up on Appium, but none does
label.accessibilityHint = _items[row][@"testID"];
label.accessibilityIdentifier = _items[row][@"testID"];
label.accessibilityLabel = _items[row][@"testID"];
label.accessibilityValue = _items[row][@"testID"];

...but none of the accessibility props ever show up on Appium.

I'll keep looking into it, since I have been tasked to, but I have close to no experience with the native side and I am basically out of ideas so I doubt I'll be able to figure this out on my own.

Versions

"@react-native-picker/picker": "2.4.9", "react": "17.0.1", "react-native": "0.64.0",

AngelCampa commented 10 months ago

I'm having the exact same issue. If there's a solution let me know

wmcbain commented 2 months ago

Also encountering the same issue, it's hard to fix this even with patch-package as Option is obfuscated by react-native-web