Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLElement should reject ambiguous matches. #238

Open
wearhere opened this issue Jul 23, 2014 · 1 comment
Open

SLElement should reject ambiguous matches. #238

wearhere opened this issue Jul 23, 2014 · 1 comment
Labels
Milestone

Comments

@wearhere
Copy link
Contributor

If multiple matches can be found for a given predicate, SLElement should log a warning and consider a match not to be found.

Open questions:

  • should rejecting ambiguous matches be optional? I'm leaning toward yes, because I guess there could be circumstances where you wanted to match one of a set of elements and didn't care which one.
  • if rejecting ambiguous matches is optional, what's the default? I'm leaning toward rejecting because an ambiguous match isn't useful--it's just a matter of luck whether or not you got the one you wanted. This would be a change in behavior but again I don't think the previous behavior was all that great. This would be a performance hit though because we would have to always enumerate the entire accessibility hierarchy when matching.
@lisbakke
Copy link

How significant of a performance hit is it?

Have you guys considered a 'debug' mode for tests?

[[SLTestController sharedTestController] runTests:[SLTest allTests] withCompletionBlock:nil withDebugMode:YES];

There's other things I would find useful in debugmode, as well. Sometimes it can be hard by looking at the instruments output to figure out which line of code ran before a failure. Even though we wrap UIAElement, the problem is that we use helper utilities to do a lot of common actions, so the resulting failure always claims it happened in our utilities file.

@wearhere wearhere added this to the v2.0.0 milestone Jul 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants