React Native Detox:无法接受来自系统警报弹出的位置许可

编程入门 行业动态 更新时间:2024-10-08 19:50:29
本文介绍了React Native Detox:无法接受来自系统警报弹出的位置许可的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

使用命令行启动应用程序detox test --configuration ios.sim.debug

Launch app from command line using detox test --configuration ios.sim.debug

通过代码启动应用程序await device.launchApp({ permissions: { location: 'always', notification: 'YES' } })

完成登录流程,直到应用通过 react-native-permissions 询问位置Permissions.request('location', { type: 'always' })(事先检查位置权限检查是否已设置为始终"(在这种情况下,应用程序不会询问)

Go through login flow until app asks for location via react-native-permissions Permissions.request('location', { type: 'always' }) (with prior check to see if location permission check already set to'always' (in which case app doesn't ask) )

看到系统提示弹出要求确认位置权限

See system alert pop up asking to confirm location permission

Detox 无法看到弹出的系统警报,因此无法点击按钮来选择位置的权限

Detox cannot see system alert pop up and thus can't click on button to choose permission always for location

应该能够点击位置许可系统按钮中的始终允许"按钮.但不能.

Should be able to tap on 'Always Allow' button in location permission system button. But can't.

请参阅我的代码:github/wix/Detox/issues/1330.

See my code at: github/wix/Detox/issues/1330 .

推荐答案

before(async () => { await device.launchApp({ permissions: { location: 'always', }, }); });

在测试前启动具有所需权限的应用

Launch app with required permissions before tests

更多推荐

React Native Detox:无法接受来自系统警报弹出的位置许可

本文发布于:2023-11-27 21:27:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639663.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:弹出   警报   位置   系统   Native

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!