Detox: UIPickerView does not contain desired value
Sorry guys, but all about iOS Picker was closed without any conclusion. I have exactly the same issue as https://github.com/wix/Detox/issues/798. Also, the question on stackoverflow has no answer https://stackoverflow.com/questions/50082463/testing-picker-with-detox-in-react-native
so
if I use “testID”:
await element(by.id('testIdPicker')).setColumnToValue(0, 'en');
I get
"Description" : "Interaction cannot continue because the desired element was not found."
If I use “type”:
await element(by.type('UIPickerView')).setColumnToValue(0, 'en');
I get
"Description" : "UIPickerView does not contain desired value!"
Detox, Node, Device, Xcode and macOS Versions
- Detox: 9.0.4
- React Native: 0.57.4
- Node: 11.1.0
- Device:*
- Xcode: 10.0
- macOS: 10.13.6
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (10 by maintainers)
Commits related to this issue
- Fix several picker woes Closes #1051 Also updated docs — committed to wix/Detox by LeoNatan 5 years ago
- Fix several picker woes (#1497) * Fix several picker woes Closes #1051 Also updated docs * Remove requirement for matcher.js — committed to wix/Detox by LeoNatan 5 years ago
I’ll be providing a fix soon. As a bonus, I will also simplify setting picker values in RN date pickers (allow selecting by id, not just by class).
I tested the new implementation and it seems to be working properly now. Thanks @LeoNatan 🥇 👍
Thanks!
Just to make sure, I wonder how this test passes then?
https://github.com/wix/Detox/blob/bdab58681ee6fb10100d43809a9c64f9ebf294c6/detox/test/e2e/17.datePicker.test.js#L7-L11