答案 0 :(得分:2)
Detox 7.3.x支持与iOS UIPickerView
的互动。按类型匹配UIPickerView
,并与之互动。
await expect(element(by.type('UIPickerView'))).toBeVisible();
await element(by.type('UIPickerView')).setColumnToValue(1,"6");
await element(by.type('UIPickerView')).setColumnToValue(2,"34");
答案 1 :(得分:1)
datetimepicker进行了排毒测试,您可以在此处检查代码:
if (global.device.getPlatform() === 'ios') {
const testElement = await element(
by.type('UIPickerView').withAncestor(by.id('dateTimePicker')),
);
await testElement.setColumnToValue(0, 'November');
await testElement.setColumnToValue(1, '3');
await testElement.setColumnToValue(2, '1800');
await expect(dateTimeText).toHaveText('11/03/1800');
} else {
// for Android
}