FirebaseUI-Android icon indicating copy to clipboard operation
FirebaseUI-Android copied to clipboard

unable to use Firebase UI with Firebase Test Lab

Open LeeHounshell opened this issue 8 years ago • 5 comments

The current Firebase UI version 2.3.0 does not work with Firebase "Test Lab" sign-in credentials.

The Google Play Console allows developers to upload Alpha and Beta app versions. These versions can be automatically checked (for free) using Firebase Test Lab. However, the current Firebase UI version does not expose UI elements that allow Test Lab to automatically login to an app. This prevents developers from obtaining test results from beyond the login pages.

Please allow Firebase UI to work seamlessly with Firebase Test Lab using the Google Play Console's "pre launch report" configuration.

LeeHounshell avatar Sep 26 '17 01:09 LeeHounshell

@LeeHounshell Here's how I've gotten around that restriction:

val signInIntent: Intent get() = AuthUI.getInstance().createSignInIntentBuilder()
        .setAvailableProviders(
                if (isInTestMode) listOf(AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build())
                else ALL_PROVIDERS)
        // ...
        .build()

val isInTestMode: Boolean by lazy {
    Settings.System.getString(RobotScouter.INSTANCE.contentResolver, "firebase.test.lab") == "true"
}

SUPERCILEX avatar Sep 26 '17 02:09 SUPERCILEX

Perhaps we should include this information in the docs.

WillieCubed avatar Sep 29 '17 01:09 WillieCubed

The new crawler introduced in October 2017 (described as one that "provides a more comprehensive review of your app") re-signs the app making Google Account login fail. To use google account login one need to fallback to the previous crawler by opting out in the settings. https://support.google.com/googleplay/android-developer/answer/7002270

You can use the new crawler by providing the login resource names in the console's settings (Pre-launch report -> Settings tab). I tried this:

  • 'email' as login resource name,
  • 'password' as password resource name,
  • 'button_done' as button resource name (this is the button on the password prompt screen, the one on the email prompt is 'button_next', but test lab seems to tap it anyway).

But it is not reliable for some reason. From what I saw in the recoreded sessions sometimes even though the email is provided clicking 'button_next' navigates to sign up screen instead of password prompt (even though the account does exist). It does not seem to be API dependant (it succeedes on one device and fails on another with the same Android version).

EDIT: Link to firebase doc page describing how to detect that app is running on test lab: https://firebase.google.com/docs/test-lab/android-studio#modify_instrumented_test_behavior_for_testlab

gswierczynski avatar Oct 04 '17 13:10 gswierczynski

Hi, I am also facing this same issue with the firebase-ui auth library. It is always failing to sign in.

@SUPERCILEX I am developing the app in Java, do you know a workaround for this?

If anyone knows how to deal with it please help!

Thanks!

NishaShinde avatar Nov 19 '19 13:11 NishaShinde

If you are uploading your app on Test Lab via GCloud CLI there is now a option --no-resign. This way Test Lab won't overwrite your app signing which likely is the issue here. You can also create test account on Firebase console for Firebase Auth UI cases.

ArcherEmiya05 avatar Apr 09 '22 23:04 ArcherEmiya05