Skip to content

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

Closed
wants to merge 2 commits into from

Conversation

noomorph
Copy link
Collaborator

@noomorph noomorph commented Jul 18, 2022

Description

Resolves #2978.

For features/enhancements:

  • I have added/updated the relevant references in the documentation files.

For API changes:

  • I have made the necessary changes in the types index file.

@noomorph noomorph requested a review from d4vidi as a code owner July 18, 2022 16:46
@noomorph noomorph force-pushed the feat/app-permissions branch 2 times, most recently from 8de310e to c17d481 Compare July 19, 2022 14:12
@noomorph noomorph force-pushed the feat/app-permissions branch from c17d481 to 056704b Compare July 20, 2022 10:18
await this.deviceDriver.installApp(currentApp.binaryPath, currentApp.testBinaryPath);
if (!_.isEmpty(currentApp.permissions)) {
await this.deviceDriver.setPermissions(currentApp.bundleId, currentApp.permissions);
}
Copy link
Collaborator

@d4vidi d4vidi Jul 21, 2022

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;
Copy link
Collaborator

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' &#124; 'NO' &#124; 'unset'` |
Copy link
Collaborator

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)
Copy link
Collaborator

@d4vidi d4vidi Jul 21, 2022

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:
Copy link
Collaborator

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

@stale
Copy link

stale bot commented Sep 16, 2022

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.
Thank you for your contributions.
For more information on bots in this reporsitory, read this discussion.

@stale stale bot added the 🏚 stale label Sep 16, 2022
@stale
Copy link

stale bot commented Sep 24, 2022

The issue has been closed for inactivity.

@stale stale bot closed this Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(WIP) Support for default permissions
2 participants