-
Notifications
You must be signed in to change notification settings - Fork 801
Added print accessibility tree command. Find accessibility element command reworked #70
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
Conversation
|
This is fantastic. Great finds on the AX stuff! |
commands/FBAccessibilityCommands.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be helpful to add the ability to print the accessibility value and traits if possible. If you had the values for them, adding an optional second argument to pa11y would be pretty easy.
|
Hey, @KingOfBrian. |
|
@KingOfBrian How does this pull request compare / contrast to #55? |
|
Much better approach, with fewer round trips by a large margin. The different types of AX values can be added pretty easily. forceStartAccessibilityServer is awesome, I'm gonna add that to FRY to enable AX. I've never determined traversal choices via a nil accessiblityLabel, and I think it may cut the tree off a bit early. A UITableView accessibilityLabel for instance is used to store the empty table view AX value, and without actually testing, I'm not sure how this would work. There are other instances, like a navigation bar item where the accessibilityLabel is duplicated in an internal view. It's not important to pick up that distinction, but for a debug tool, I think it'd be better to be more liberal. And, some magic inside of _accessibilityElementsInContainer may behave differently than I think. Anyway, this approach is definitely the correct one. I don't have time to test it, as my AX work has passed for now. |
commands/FBAccessibilityCommands.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this will always be true, since foundLocally will always be false in this elif branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Did it correct way initially, but refactored wrong way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were you intending to rectify this in 55cca66?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this should work properly now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Added print accessibility tree command. Find accessibility element command reworked
|
Thanks @a2, and apologies @gkassabli for the dropped ball. I had asked a question and was waiting to hear back, but perhaps it wasn't seen. |
|
@kastiglione Yeah, I fixed it there. Apologies for not responding in thread |
Added print accessibility tree command that is based on Apple internal methods. It could print whole tree or subtree of specified root element.
Find accessibility element command was reworked to use internal API and make use of only relevant and visible elements