Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle Touch ID / Face ID while running our Flutter integration tests?

Tags:

flutter

dart

Is there any way by which we can either bypass or handle the Touch ID/Face ID authentication while running our Flutter integration tests wether in emulator or on a real device?

like image 379
R D Avatar asked Nov 18 '25 12:11

R D


1 Answers

There is no way to interact with those iOS system popups from Flutter integration tests. The same applies to requests for permission like location or camera access.

You can mock the classes that trigger the popups to get around this, i. e. extend the original class and override the methods that trigger the system popup to just return the expected value. You will then decide if you provide the mock or the real class to your app. For your device authentication problem this could mean you don't request real authentication and just return true. For the permission request you need to run the app at least once manually and confirm the permissions. Subsequent runs can be automated integration tests that skip the requests and just assume the user confirmed.

like image 183
ToniTornado Avatar answered Nov 21 '25 00:11

ToniTornado