Search code examples
unit-testinggoogle-mapsrobotiumandroid-4.0-ice-cream-sandwichjunit3

Android unit testing framework that can interact with Google Maps API. Does one exist?


I am working with Google Maps on Android 4.0 and I would like to know:

Is there a testing framework (or anything..) that can interact with the Google Maps API? What are the possibilities when interacting/testing with Google Maps on Android? Is it not possible to find all pins on the map and perform a click on them or perhaps determine zoom level?

There seem to be a couple questions on this website dealing with similar issues/questions with no answer.

I realize "interact with" is a broad term. I am really looking for any kind of help whether it is a suggestion or just to tell me something is not possible.

I have been using JUnit but it seems limited by itself. Just today I started looking at Robotium since the majority of tests I need to do are UI based. I am new to Robotium so maybe it is possible with this and I have not discovered it yet?


Solution

  • In case anyone wants to know after much searching I finally found something that can test Google Maps. Things such as zoom level and I believe tap pin (method is called tapMapMarkerItem()) are supported. I have not tested the pin tap yet tho. Apparently the awesome Robotium does not support map testing by itself. Nicholas Albion was nice enough to create an extension to provides testing support for maps on Android. Thank you so much Nicholas!


    So here it is:
    1. Download the Robotium jars from robotium.org (I found this helpful http://www.vogella.com/articles/AndroidTesting/article.html - by Lars Vogel)
    2. Download the extension from https://github.com/nalbion/robotium-maps