0

We have recently started expanding our UI testing suite and have started to incorporate some tests that involve Google's FusedLocationProviderClient.

In particular one of our tests involves showing a different carousel when the user is within 30km of a location. Since this is achieved using a use case IsUserLocal we have mocked this use case so that, regardless of the location from the FusedLocation, it always returns true.

Unfortunately, however, our LocationRequest callback never returns a value when the tests are run on Firebase Test Lab (FTL). When I run the same test on an emulator or a real device it works as expected. We have also noticed that Google maps are always blank in the videos on FTL too. So I suspect that all the Location APIs are not working on FTL.

I'd read that this could be because FTL re-signs the apk but I've tried various things with our GoogleMaps API key - such as not restricting it, adding the service account key to it, adding the production Google generated key to the debug package that our test APK is built on but we still see blank Google Maps and a failing test.

Is it possible to get the location services working properly on Firebase, and if so, how?

Barry Irvine
  • 13,858
  • 3
  • 25
  • 36
  • Are you by any means running your app in Test Lab using multiple devices at once? There's a possibility that you are hitting rate limits and causing your map to be degraded. – Yrll Jun 08 '23 at 04:09
  • @Yrll We're only running it on a single device (although we're using the `beta` gcloud so we're also running it in parallel on 4 shards). However, I think it extremely unlikely that we're hitting the rate limit – Barry Irvine Jun 12 '23 at 11:33

0 Answers0