Flutter integration test firebase auth (email link or google sign in)

Viewed 1135

I'm adding integration testing (using the integration_test package) to my app but I am running into a problem.

Let me explain. The first step when my app launch is authentication for which I have 3 options: firebase email link, firebase google sign in, and firebase facebook sign in.

What is blocking me is that all these sign in methods require actions outside of the main app dart code and thus are not accessible by flutter driver.

Am I missing something here? And if not how should that case be handled?

Cheers!

2 Answers

You can add the fourth way of signing in - using username and password. Firebase should support this kind of very common situation, so you can do it within lines of code.

If you do not want the end users to login by password, you can simply disable this method in production build and only enable it in debug build.

Another way is to mock your authentication system. In other words, when doing testing, you have a button called "fake sign in", and your integration test driver just click that button.

Related