Handle permission popups in your Maestro tests
Learn how to control iOS app permissions directly within your Maestro test flows on BrowserStack App Automate
When testing iOS applications, you commonly encounter system dialogs requesting access to protected resources, such as contacts, notifications, or photos. Maestro enables you to programmatically grant or deny these permissions directly within your test flows, ensuring uninterrupted test execution.
Platform support: This permission-handling behavior currently applies only to iOS apps on BrowserStack App Automate. It does not configure Android runtime permission dialogs.
Configure global permissions
Maestro enables you to manage iOS app permissions during the app launch sequence. You can simulate scenarios where the app grants or denies all requested permissions universally.
Default behavior
By default, the launchApp command initializes the application with a neutral permission state. In this state, the system does not pre-configure permissions, and instead prompts you via standard system dialogs as needed.
To modify this behavior, you must specify the permissions argument within your flow.
Apply permissions globally
To apply a single policy to all permission requests, use the all key. This is useful for quickly bypassing system dialogs to focus on app functionality.
- The
allkey only acceptsallowordenyas values. - For real devices, these are the only permission settings allowed.
Grant all permissions
The following configuration automatically grants every permission the application requests:
Add the following configuration to your Maestro flow:
The application automatically grants every permission it requests without showing system dialogs.
Deny all permissions
To automatically deny every permission requested by the application:
Add the following configuration to your Maestro flow:
The application automatically denies every permission it requests without showing system dialogs.
Changes to permission configuration
Previously, when you passed permission configurations to Maestro, the framework did not automatically handle permission popups. As a result, you typically managed permission popups within your test scripts, often by scripting explicit interactions with permission dialogs.
New behavior
With the deployment of the newer Maestro version, the framework honors the provided permission configurations automatically. TThe MaestroAlertMonitor now detects and handles permission popups according to the permissions you specify, without requiring manual intervention in your scripts.
Potential impact
High risk of session failures:
If your existing test scripts already include manual handling of permission popups (such as tapping “Allow” or “Don’t Allow”), these scripts may now conflict with Maestro’s automatic handling. This can result in double interactions, unexpected UI states, or test failures.
Required action:
Review and update your test scripts to remove any manual permission handling logic, as Maestro now takes care of these dialogs automatically. Failing to do so may cause sessions to fail or behave unpredictably.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!