如何解决本机首先加载后无法访问排毒中的元素
我正在从本机应用程序开始的应用程序上运行排毒,现在将其作为本机应用程序和本机代码的组合。
我正在使用iOS模拟器检查测试。
我的应用程序是从iOS本机端开始的,并且在其上运行了排毒测试并获取了元素(一切正常),但是随着应用程序流程的进行,首先加载bundle(索引)。 js-(用于运行react-native端),我们无法通过排毒访问元素(在native端),并且测试失败。
在本机端(iOS)中,我输入了-accessibilityIdentifier
describe('Previews',() => {
beforeAll(async () => {
await device.launchApp({ permissions: {notifications: 'YES',location:'always'}});
});
it('should tap on acceptButton',async () => {
await element(by.id('acceptButton')).tap();
});
it('should tap on enable Notifications button',async () => {
await element(by.id('enableNotificationsButton')).tap();
});
// Here the bundle of the react-native loading,and the detox can't find 'editButton'
// 'editButton' it's still in the native side
it('should click on editButton',async() => {
await element(by.id('editButton')).toBeVisible();
});
});
得到此警告:
detox[73960] WARN: [Client.js/PENDING_REQUESTS] App has not responded to the network requests below:
(id = 6) invoke: {"type":"action","action":"tap","predicate":{"type":"id","value":"continueFaceIdButton"}}
Unresponded network requests might result in timeout errors in Detox tests.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。