Skip to content
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

Add method for denying permissions #378

Merged
merged 5 commits into from
May 28, 2021
Merged

Conversation

milhauscz
Copy link
Contributor

In some cases we also need to test the app's behavior when the user denies a permission. This change adds the denyPermissions() method.

@milhauscz
Copy link
Contributor Author

Tests failed because of some configuration problems:

Error: Unable to process command '##[add-path]/Users/runner/Library/Android/sdk/cmdline-tools/tools:/Users/runner/Library/Android/sdk/cmdline-tools/tools/bin:/Users/runner/Library/Android/sdk/platform-tools' successfully.
Error: The add-path command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the ACTIONS_ALLOW_UNSECURE_COMMANDS environment variable to true. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

@Sloy
Copy link
Member

Sloy commented Nov 19, 2020

Hi @milhauscz!
Right now I'm not sure this feature works, because of a change they made in AGP 4.1 it nows grans all permissions before running tests. So it's impossible to deny permissions in runtime (actually, it's not possible to accept them via the dialog, because they are already granted).
I opened an issue for Google but I'm still waiting for a response: https://issuetracker.google.com/issues/168642903

@milhauscz
Copy link
Contributor Author

Hi, I use Android Studio 4.1.1 and I don't have this problem...

@Sloy
Copy link
Member

Sloy commented Nov 23, 2020

Can you try running the tests in PermissionGranterTest from Barista? I just tried it with Android Studio 4.1.1 and tests fail. Please run them from Android Studio, not Gradle, because the behavior is different (until Barista is updated to Android Gradle Pplugin 4.1).

milhauscz and others added 2 commits May 27, 2021 14:19
In some cases we also need to test the app's behavior when the user denies a permission. This change adds the denyPermissions() method.
@Sloy
Copy link
Member

Sloy commented May 27, 2021

The issue seems to be fixed with the latest version of tools, so let's go ahead with the feature! Thanks @milhauscz.
I also added a test for the new method.

@Sloy Sloy enabled auto-merge (squash) May 27, 2021 12:40
@Sloy Sloy merged commit 23b1eeb into AdevintaSpain:master May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants