Open gurgeous opened 7 years ago
Hmm, I wonder if that might be an issue when considering tapping on custom UIAlertControllers that have their own views in the buttons or so. BTW, are you able to tap on the alert using grey_text(@"Download")
? as in here
grey_text
works great, thanks! This is the first I heard of it, though, and I've been perusing the project for a few weeks now. Is it documented somewhere?
It isn't documented anywhere per se, it's a part of disambiguating the matchers. Notice how in the trace,
"<_UIAlertControllerActionView:0x7f9df3435eb0; AX=Y; AX.label='Download'; AX.frame={{188, 352}, {134.5, 44}}; AX.activationPoint={255.25, 374}; AX.traits='UIAccessibilityTraitButton'; AX.focused='N'; frame={{0, 0}, {134.5, 44}}; opaque; alpha=1>",
"<UILabel:0x7f9df34369f0; AX=Y; AX.label='Download'; AX.frame={{216, 364}, {78.5, 20.5}}; AX.activationPoint={255.25, 374.25}; AX.traits='UIAccessibilityTraitStaticText'; AX.focused='N'; frame={{0, 12}, {78.5, 20.5}}; opaque; alpha=1; UIE=N; text='Download'>"
The text='Download'
was what separated the two. We try to provide matchers that can help identify and pinpoint these differing characteristics.
Is it documented somewhere?
Yes, it's documented in the cheatsheet
Just listing the method name doesn't count! :)
If this is the best way to find buttons, it should be more prominent in the docs.
@gurgeous, agreed :). We have the Selection API section in our docs to cover this. If you feel it's not clear enough when it comes to pointing to grey_text(), then feel free to add to it or provide a suggestion on how to make it more clear to users.
I can't easily test UIAlertController.StyleAlert because each button has two accessible views with the same label:
It's easy to workaround the issue with grey_allOf, but this is a common case that should be handled by the framework in my opinion.