首页 > 解决方案 > 有什么方法可以使用 Detox 在 Android 上的 Picker 中选择一个项目?

问题描述

根据文档,选择值的方法仅适用于 IOS。Android 有什么建议的解决方法吗?

标签: androidreact-nativedetox

解决方案


await waitFor(element(by.id('android_touchable_wrapper'))).toBeVisible()

await element(by.id('android_picker_headless').withAncestor(by.id('android_touchable_wrapper'))).atIndex(0).tap()

await element(by.text('Picker Value Dropdown 1')).tap()

推荐阅读