【发布时间】:2018-05-29 15:15:53
【问题描述】:
我在混合应用上使用 detox。我想在本机代码中使用 by.id
目前我是这样登录的:
try {
// 'Email address' is the input's placeholder text
await waitFor(element(by.text('Email address')).atIndex(0))
.toBeVisible()
.withTimeout(TIMEOUT);
await expect(element(by.label('Email address')).atIndex(0)).toBeVisible();
await element(by.label('Email address')).atIndex(0).typeText(config[email].email);
} catch (err) {
// Email addresses get cached, so you won't find the text 'Email address' after the first login
} finally {
await element(by.label('Password')).atIndex(0).typeText(devConfig[email].password);
await element(by.label('Sign in')).atIndex(0).tap();
}
我想做这样的事情。
await element(by.id('email')).typeText(devConfig[email].password);
await element(by.id('password')).typeText(devConfig[email].password);
await element(by.id('login')).tap();
如何向原生 ios 输入添加 id?
【问题讨论】:
标签: ios react-native detox