Skip to content

Conversation

@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:

  • Custom actions become visible in the element tree.
  • Clients like Appium (or other accessibility tools) can read them and make further validations or conclusions.
  • Accessibility regressions related to custom actions become detectable.

Implementation Notes

  • The value is retrieved using private attribute _XC_kAXXCAttributeCustomActions

These changes are additive, so they do not change existing behaviour.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 20, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: ihor-kravchenko-evinced / name: Ihor Kravchenko (49f1d0d, f9518ed)

@mykola-mokhnach
Copy link

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

@ihor-kravchenko-evinced ihor-kravchenko-evinced force-pushed the feat/add-cutom-custom-actions-attribute branch from 400c791 to 6fbf62e Compare December 20, 2025 12:25
@ihor-kravchenko-evinced ihor-kravchenko-evinced changed the title Add support for custom accessibility actions feat: expose customActions on the element Dec 25, 2025
@ihor-kravchenko-evinced ihor-kravchenko-evinced force-pushed the feat/add-cutom-custom-actions-attribute branch from ded5241 to ab036df Compare December 25, 2025 12:41
Add support for exposing custom accessibility actions from UI elements.
@ihor-kravchenko-evinced ihor-kravchenko-evinced force-pushed the feat/add-cutom-custom-actions-attribute branch from ab036df to f9518ed Compare December 25, 2025 13:09
@ihor-kravchenko-evinced ihor-kravchenko-evinced marked this pull request as ready for review December 25, 2025 13:11
@ihor-kravchenko-evinced
Copy link
Author

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

@mykola-mokhnach thank you for the feedback. I've added tests for page source generation and element attributes fetching.

Copy link
Member

@KazuCocoa KazuCocoa left a 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 = @", ";

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;

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

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 ?: @", ";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Author

@ihor-kravchenko-evinced ihor-kravchenko-evinced Dec 26, 2025

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]]) {

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants