Skip to content

testId for picker item is not working #180

@mohamed-ikram

Description

@mohamed-ikram

i have checked it in appium desktop and the test id not working

`import { Picker } from '@react-native-community/picker';
                                 <Picker style={styles.yearPickerContainer}
                                    selectedValue={this.state.selectedYear}
                                    onValueChange={(service) => (this.setState({ selectedYear: service }))}
                                    itemStyle={{ color: "#000000", fontSize: 26 }} 
                                    {...testProps('yearPicker')}
                                    >
                                    <Picker.Item label="Java" value="java" testID="java" />
                                    <Picker.Item label="JavaScript" value="js" testID="javass"/>
                                </Picker>`

the version I'm using is:
"react": "^16.13.1",
"react-native": "^0.63.3",
"@react-native-community/picker": "^1.6.6",

in picker item props in Picker.js

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?: ?(number | string),

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

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

so there is no problem with version

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions