-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat(config): default app permissions (iOS) #3493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8de310e
to
c17d481
Compare
c17d481
to
056704b
Compare
await this.deviceDriver.installApp(currentApp.binaryPath, currentApp.testBinaryPath); | ||
if (!_.isEmpty(currentApp.permissions)) { | ||
await this.deviceDriver.setPermissions(currentApp.bundleId, currentApp.permissions); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I didn't go deeply into this but something about this approach feels a bit off. It assumes that the permissions can be set in such a global way - before an instance of the app is launched. While it works on iOS, I can't 100% say the same about Android / a theoretical future platform.
What about applying a similar solution to the launch-args technique, which is set in advance and handled on-site (i.e. in launch app)?
@@ -201,6 +202,7 @@ declare global { | |||
build?: string; | |||
testBinaryPath?: string; | |||
launchArgs?: Record<string, any>; | |||
permissions?: DevicePermissions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant?
|
||
| Permission | Values | | ||
|---------------|---------------------------------------------------------| | ||
| calendar | `'YES' | 'NO' | 'unset'` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&124;
doesn't seem to render well
@@ -528,3 +530,32 @@ Exposes [`UiAutomator`’s `UiDevice` API](https://developer.android.com/referen | |||
**This is not a part of the official Detox API**, it may break and change whenever an update to `UiDevice` or `UiAutomator` Gradle dependencies (`androidx.test.uiautomator:uiautomator`) is introduced. | |||
|
|||
[`UiDevice`’s autogenerated code](https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/src/android/espressoapi/UIDevice.js) | |||
|
|||
### Permissions (iOS only) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add link in ToC
|
||
When you are [configuring the apps](APIRef.Configuration.md#apps-configurations) list in your | ||
Detox config file or [launching the app](#2-permissionsset-runtime-permissions-ios-only), | ||
you can give certain permissions beforehand to it to avoid this inconvenient modal: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A simple and elegant explanation
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
The issue has been closed for inactivity. |
Description
Resolves #2978.