Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picker.Item missing testID #22084

Closed
robertofrontado opened this issue Nov 2, 2018 · 6 comments
Closed

Picker.Item missing testID #22084

robertofrontado opened this issue Nov 2, 2018 · 6 comments
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@robertofrontado
Copy link

robertofrontado commented Nov 2, 2018

Environment

React Native Environment Info:
System:
  OS: macOS High Sierra 10.13.6
  CPU: x64 Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz
  Memory: 82.27 MB / 8.00 GB
  Shell: 3.2.57 - /bin/bash
Binaries:
  Node: 8.11.3 - /usr/local/bin/node
  npm: 5.6.0 - /usr/local/bin/npm
SDKs:
  iOS SDK:
    Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
IDEs:
  Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
  react: 16.6.0-alpha.8af6728 => 16.6.0-alpha.8af6728
  react-native: 0.57.4 => 0.57.4
npmGlobalPackages:
  react-native-cli: 2.0.1
  react-native-git-upgrade: 0.2.7

Description

As you can see PickerIOS.Item does not have a testID, even though Picker.Item does.

Picker

type PickerItemProps = $ReadOnly<{|
  /**
   * Text to display for this item.
   */
  label: string,

  /**
   * The value to be passed to picker's `onValueChange` callback when
   * this item is selected. Can be a string or an integer.
   */
  value?: any,

  /**
   * Color of this item's text.
   * @platform android
   */
  color?: ColorValue,

  /**
   * Used to locate the item in end-to-end tests.
   */
  testID?: string,
|}>;

PickerIOS

type ItemProps = $ReadOnly<{|
  label: ?Label,
  value?: ?any,
  color?: ?ColorValue,
|}>;

So I can't find the Items using Detox

@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The "⏪Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@vonovak
Copy link
Collaborator

vonovak commented Nov 5, 2018

hi, why not just use Picker? It's the same thing as PickerIOS on ios...

@robertofrontado
Copy link
Author

I'm using Picker, which relies on PickerIOS

@vonovak
Copy link
Collaborator

vonovak commented Nov 5, 2018

ah, I see. It wasn't clear from the description. You can match the item by text for now, just fyi.

@robertofrontado
Copy link
Author

Yeah I'm aware, but the text might change since its coming from an API :/

@thymikee
Copy link
Contributor

Thanks! Picker is moving to a community repo, I moved the issue there: react-native-picker/picker#8

@facebook facebook locked as resolved and limited conversation to collaborators May 30, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label May 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants