I run my e2e tests with Flutter Driver. The typical command I use is:
flutter drive --flavor=development --target=e2e/instrumented_app.dart --driver=e2e/scenarios/smoke_scenario.dart -d "iPhone 11"
However, after adding Push notifications support my tests timeout on launch because the Push Notifications prompt is shown. How to grant access or skip the prompt when running Flutter Driver tests?
What I came up with is to use Swift custom flags
In my AppDelegate in
didFinishLaunchingWithOptions
I used conditional flagSKIP_NOTIFICATIONS_PROMPT
:And I set this flag in Other Swift Flags section of Build Settings of the project for the
Debug-development
flavor which is used by default when running Flutter Driver tests: