I just started using Detox to test my react native app and I'm having some trouble to test Pickers. I basically need to be able to choose a value from a Picker! But it seems impossible!!
Here is my Picker:
<Picker
style={styles.picker}
itemStyle={styles.pickerItem}
testID="picker"
selectedValue={selectedValue}
onValueChange={this.updateValue}
>
<Picker.Item key={0} label="Choose one" value={null} />
{values.map(value => {
return (
<Picker.Item
key={value}
label={value}
value={value}
testID={value}
/>
);
})}
</Picker>
And here is my test:
await element(by.type("UIPickerView")).setColumnToValue(0, "Apple");
But all I get is an error message saying it was not possible to set the value because it doesn't exist, but it does! Cause I'm looking at it right now!
Does anyone knows the right way to set a value in a Picker?
Any help would be great!