How can I access the pins on an MKMapView via XCTest's UI Tests?
I want to count the number, verify specific ones are there (based on accessibility id or title), etc.
There doesn't seem to be a XCUIElementType for MKAnnotation.
I'm having a hard time finding any documentation on MKMapView + XCTest.
The annotation views aren't under
maps
unfortunately. You will find map points of interest there instead. To query for an annotation view you should useXCUIApplication().windows.element.otherElements["Custom Identifier"]
.Add the
accessibilityIdentifier = "Custom Identifier"
to your annotation view, not annotation.MKAnnotation
doesn't implementaccessibilityIdentifier
.