Skip to content

[Detox Patch] Add support for autoGrantPermissions capability (AAP-20840) - #7

Open
vvHacker007 wants to merge 1 commit into
patched-20.51.3from
AAP-20840_autogrant-permissions-cap
Open

[Detox Patch] Add support for autoGrantPermissions capability (AAP-20840)#7
vvHacker007 wants to merge 1 commit into
patched-20.51.3from
AAP-20840_autogrant-permissions-cap

Conversation

@vvHacker007

@vvHacker007 vvHacker007 commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

What

Adds autoGrantPermissions to 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= query
  • detox/src/configuration/composeSessionConfig.js — add to cloudSupportedCaps (no "not honoured" warning) + boolean validation
  • detox/detox.d.ts — type for session.autoGrantPermissions

Usage:

session: {
  server: 'wss://detox.browserstack.com/init',
  autoGrantPermissions: true,
}

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:

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):

  • cap set + platform fix: CAMERA / RECORD_AUDIO / LOCATION granted at session start (~0.33s), no permission dialogs — session d255d75a90064296f27ce9de8ac421f317b3af1f
  • cap set, old platform: ignored (baseline) — session 41b7394a0fc8ceaf7229b9f3ff775f05e3b58f51
  • cap not set: nothing granted (gate verified)

Note

Needs an npm republish of the patched package after merge for customers to pick it up.

🤖 Generated with Claude Code

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>
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.

1 participant