【发布时间】:2019-02-28 00:24:03
【问题描述】:
请多多包涵,我是排毒新手!我目前正在评估 Detox 作为一种众所周知的非常慢的黑盒自动化工具的替代品!
环境
- 排毒:v9.0.1
- xCode:v9.4.1
- macOS:High Sierra 10.13.2
使用以下方法执行测试:
detox test --debug-synchronization --loglevel trace
我正在编写一个自动化测试,用于登录我们的应用并验证登录页面。登录后,我无法识别任何元素,因为我得到的错误是:
"appState": "Waiting for an animation to finish. Continuous animations may never finish and must be stopped explicitly. Animations attached to hidden view may still be running in the background.\nWaiting for view's draw or layout pass to complete."
和
detox[94060] INFO: [actions.js] Sync Timed:
animateWithDuration:delay:options:animations:completion:
detox[94060] INFO: [actions.js] Sync Timed: performSelector
@selector(removeInactiveFingerTips) on DTXTouchVisualizerWindow
detox[94060] INFO: [actions.js] Sync App State: undefined
detox[94060] INFO: [actions.js] Sync Dispatch Queue: com.apple.main-
thread
detox[94060] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE]
{"type":"cleanupDone","messageId":8,"params":{}}
我已将 URL 添加到黑名单中,这有助于消除一些错误,现在我已将我的步骤包含在 device.disableSynchronization 和 device.enableSynchronization 的众多组合中,这似乎没有帮助。请查看我当前的测试版本:
describe('Signon and browse', () => {
beforeEach(async () => {
await device.reloadReactNative();
});
it('I log into the app', async () => {
await element(by.id('input_username')).replaceText('mysername');
await element(by.id('input_password')).replaceText('mypassword');
await element(by.id('button-signon')).tap();
await device.disableSynchronization();
await waitFor(element(by.id('app-title'))).toHaveValue('DISCOVER').withTimeout(20000);
await device.enableSynchronization();
})
});
我是一名测试自动化开发人员,而不是应用程序的 ReactNative 开发人员,因此我不确定在实际的 ReactNative 代码中是否需要更改某些内容 - 这对我们来说将是一个大问题!
感谢您的帮助。
【问题讨论】:
标签: detox