如何点击权限按钮上的允许按钮弹出 [英] How to tap on Allow button on permission pop up
问题描述
我正在尝试使用排毒功能单击允许"按钮.
我尝试了以下操作:
我还尝试通过 element(by.label('Allow')).tap()
和 by.text
>
我不想在应用启动时设置位置权限.我想模拟一个允许和不允许位置权限的用户.
在您的 init.js
文件中,您可以允许以下权限:
beforeAll(async()=> {等待detox.init(config,{launchApp:false});等待device.launchApp({newInstance:true,权限:{notifications:'YES'}}));});
权限:
calendar = YES | NO相机=是|否联系人=是|否health =是|否homekit =是|否位置=始终|正在使用|从不medialibrary =是|否麦克风=是|否运动=是|否通知=是|否照片=是|否提醒=是|否siri =是|否
您可以在此处查看文档: https://github.com/wix/detox/blob/master/detox/test/e2e/13.permissions.test.js
I am trying to click on the Allow button using Detox.
I have tried the following:
Detox: iOS Simulator how to confirm alert message
I have also tried targeting the "Allow" button by element(by.label('Allow')).tap()
and also by.text
I do not want to set location permissions upon app launch. I would like to simulate a user allowing and not allowing location permissions.
In your init.js
file you can allow the permissions:
beforeAll(async () => {
await detox.init(config, { launchApp: false });
await device.launchApp({newInstance: true, permissions: {notifications: 'YES'}});
});
Permissions:
calendar=YES|NO
camera=YES|NO
contacts=YES|NO
health=YES|NO
homekit=YES|NO
location=always|inuse|never
medialibrary=YES|NO
microphone=YES|NO
motion=YES|NO
notifications=YES|NO
photos=YES|NO
reminders=YES|NO
siri=YES|NO
You can check the documentation here: https://github.com/wix/detox/blob/master/detox/test/e2e/13.permissions.test.js
这篇关于如何点击权限按钮上的允许按钮弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!