-
Notifications
You must be signed in to change notification settings - Fork 462
feat: expose customActions on the element #1095
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
base: master
Are you sure you want to change the base?
feat: expose customActions on the element #1095
Conversation
|
The PR looks ok Please also add some integration tests to cover the new functionality for page source generation and element attributes fetching. Also, do not forget to update the element double declaration in unit tests |
400c791 to
6fbf62e
Compare
ded5241 to
ab036df
Compare
Add support for exposing custom accessibility actions from UI elements.
ab036df to
f9518ed
Compare
@mykola-mokhnach thank you for the feedback. I've added tests for page source generation and element attributes fetching. |
KazuCocoa
left a comment
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.
The code lgtm entirely. lets wait for the CI result
| FBSetCustomParameterForElementSnapshot(FBSnapshotMaxDepthKey, @50); | ||
| FBUseClearTextShortcut = YES; | ||
| FBLimitXpathContextScope = YES; | ||
| FBCustomActionsDelimiter = @", "; |
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.
I also think it makes sense to eliminate the extra space after comma
| * | ||
| * @param delimiter The delimiter string to use when joining custom actions | ||
| */ | ||
| + (void)setCustomActionsDelimiter:(NSString *)delimiter; |
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.
not sure if it makes sense to have this delimiter configurable. , should be enough
| XCTAssertEqualObjects(element.wdValue, @"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901"); | ||
| } | ||
|
|
||
| - (void)testCustomActionsAttributes |
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.
👍
|
|
||
| + (void)setCustomActionsDelimiter:(NSString *)delimiter | ||
| { | ||
| FBCustomActionsDelimiter = delimiter ?: @", "; |
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.
same here
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.
@mykola-mokhnach Removed custom delimiter configuration 49f1d0d.
| } | ||
|
|
||
| // Case 2: Array of custom actions | ||
| if ([raw isKindOfClass:[NSArray class]]) { |
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.
I think it would be more readable if this method is split into smaller ones for each case
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.
also fine to do that in another PR, just let me know what works best for you @ihor-kravchenko-evinced
Summary
This PR introduces support for exposing accessibility custom actions as an element attribute using private XCTest APIs.
Motivation
Once this is in place:
Implementation Notes
_XC_kAXXCAttributeCustomActionsThese changes are additive, so they do not change existing behaviour.