[Detox Patch] Add support for autoGrantPermissions capability (AAP-20840) - #7
Open
vvHacker007 wants to merge 1 commit into
Open
[Detox Patch] Add support for autoGrantPermissions capability (AAP-20840)#7vvHacker007 wants to merge 1 commit into
vvHacker007 wants to merge 1 commit into
Conversation
Adds autoGrantPermissions to the cloud session caps so the client forwards it to BrowserStack, where the platform pre-grants the app's requested Android runtime permissions at session start (AAP-20840). Mirrors the local-testing caps addition (ff319fa). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
autoGrantPermissionsto the cloud session capabilities, mirroring the local-testing caps addition (ff319fa / original PR #7):detox/src/configuration/index.js— forward the cap in the websocket?caps=querydetox/src/configuration/composeSessionConfig.js— add tocloudSupportedCaps(no "not honoured" warning) + boolean validationdetox/detox.d.ts— type forsession.autoGrantPermissionsUsage:
Why
JIRA: AAP-20840 — Detox has no Appium driver to honour
autoGrantPermissions, and Android Detox exposes no permissions API of its own, so runtime-permission dialogs currently block Detox tests on BrowserStack. The platform side now pre-grants the app's requested permissions at session start when this capability is set:pm grantengine)Without this client change the capability is silently dropped on the customer's machine (the caps query is built from a fixed whitelist), so this PR is the customer-facing enabler.
Testing
Verified end-to-end on devdas staging with exactly this patch applied to the installed 20.51.3 client (same device/host/app across runs, OnePlus 11R / Android 13):
d255d75a90064296f27ce9de8ac421f317b3af1f41b7394a0fc8ceaf7229b9f3ff775f05e3b58f51Note
Needs an npm republish of the patched package after merge for customers to pick it up.
🤖 Generated with Claude Code