I'm using patrol for writing UI tests in flutter, in android version, the app uses "android.permission.WRITE_SETTINGS", which should be allowed by the user, through the following screen: allow writing system settings screen
How to turn on the toggle switch using patrol?
I used:
await $.native.grantPermissionWhenInUse();
but I got:
The following PatrolActionException was thrown running a test: Patrol action failed: NativeAutomatorClientException: grantPermissionWhenInUse() failed with Invalid response: 404 selector button to allow permission while using found nothing
While I was expecting granting writing permission.
The details could be found here: https://patrol.leancode.co/tips-and-tricks#granting-sensitive-permission-through-the-settings-app