In XCTest there's a way to get all UI elements by type, and then filter by accessibilityIdentifier like:
app.buttons[someID]
But what if I don't know the type of the view? If I'm looking for a UIView, I can write:
app.otherElements[someID]
but this excludes UIButton views.
I can implement this by calling all the methods in succession (staticTexts, textViews, buttons, otherElements etc.), but something tells me it's not great in performance, because the list of types is huge.
Is there a generic method?