1

Our company uses golden files for our automated UI testing. It detects UI changes caused by code changes during our PR pipeline Continous Integration. However, it detects several false changes which were caused by the Map not loading properly due to internet latency.

For the case below, notice the white areas on the left. The testing software thought these were UI changes which are actually not and the test for this case failed even though it was supposed to pass.

Does anyone have any experience dealing with Google maps on any framework like Javascript, Android, or iOS when doing UI Testing?

Ideally, it would be best if a tiny portion of the Google map is downloaded offline during the UI testing but does the Google Maps SDK has anything for that?

If not, can we replace the image layer of a specific region on the map with a static offline image or can we mock the API calls done by the map to load those tiles?

enter image description here

TSR
  • 17,242
  • 27
  • 93
  • 197
  • Is a `TileProvider` an option - it could provide static images and you could map all coordinates to a small set of images. Your test framework would have to add the tile provider to the map instance. – Computable Sep 09 '22 at 01:36
  • Yes, that would work, Do you have a link to a quick start code on how to do that with Javascript Android or iOS – TSR Sep 09 '22 at 13:28
  • This answer has a good example of how to implement in android (java) - simple enough to easily see how you may adapt: https://stackoverflow.com/a/14833256/17856705. The key part for a test framework (I would guess) is gaining access to the map instance in order to install it. – Computable Sep 09 '22 at 13:44
  • Here's the google maps top-level docs on tile overlays (android, ios, javascript): https://developers.google.com/maps/documentation/android-sdk/tileoverlay – Computable Sep 09 '22 at 13:50

0 Answers0