question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Picker.Item missing testID

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
react-native-botcommented, Nov 2, 2018

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.

0reactions
thymikeecommented, May 30, 2019

Thanks! Picker is moving to a community repo, I moved the issue there: https://github.com/react-native-community/react-native-picker/issues/8

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to find the element with data-testid - Stack Overflow
I am following the docs for react-testing-library to find if the element with data-testid attribute is rendered or not.
Read more >
react-native-picker-picker-fix - npm package | Snyk
React Native Picker for iOS, Android, macOS, and Windows For more information ... Looks like react-native-picker-picker-fix is missing a security policy.
Read more >
React Native Item
renderItem: takes an item object from data to construct . Props label color testID value Reference Props label Text to display for this...
Read more >
Picker.Item - React Native
Individual selectable item in a Picker. ... testID ​. Used to locate the item in end-to-end tests. Type, Required. string, No. value ​....
Read more >
Some components ignore html data attributes
However, setting a data-testid attribute (or really any data- ... The ones for Slider, SliderLabel, MultiSelect, and DatePicker are not.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found