android-maps-compose icon indicating copy to clipboard operation
android-maps-compose copied to clipboard

Marker/Info Window Test Tags

Open anqus opened this issue 3 years ago • 5 comments

I can't find a way to tap on map markers or their info windows as part of instrumentation UI tests. With other components in Compose, it's possible to find nodes during testing using testTags or contentDescriptions.

It would be useful to add these to markers or their modifiers to help with testing. Also keen to hear if there's another way of doing this!

anqus avatar Sep 18 '22 19:09 anqus

This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!

stale[bot] avatar Jun 18 '23 08:06 stale[bot]

bump

anqus avatar Jun 18 '23 12:06 anqus

Be able to click a marker to show Markers info in order to validate it might be helpful for testing in compose, I tried with tag parameter but any node is being created with the passed tag in MarkerInfoWindowContent:

not working example:

MarkerInfoWindowContent(
        state = rememberMarkerState(position = location),
        tag = ID_TRACKING_MAP_MARKER_TAG
    ) { ... }

Output of the following: this.composeTestRule.onRoot(true).printToLog("trackingMapAgentScreenMap_MarkersInfoTest")

is (see how any node has the passed tag):

printToLog:
Printing with useUnmergedTree = 'true'
Node #1 at (l=0.0, t=290.0, r=1080.0, b=2274.0)px
 |-Node #2 at (l=0.0, t=290.0, r=1080.0, b=2274.0)px
   MergeDescendants = 'true'

gerardoeg avatar Jul 28 '23 22:07 gerardoeg

I tried using MarkerComposable with the testTag modifier, but it doesn't work either 😢

CallumNZ avatar Feb 11 '24 21:02 CallumNZ