I am not able to get UI Testing record a custom UICollectionViewCell selection.
How to do it? Is it supported?
Below is the code automatically generated when i tapped first cell.
I am setting these properties too:
in cellForItemAtIndexPath
cell.isAccessibilityElement = YES;
cell.accessibilityIdentifier = [NSString stringWithFormat:
@"HistoryCollectionViewCell-%d-%d",
(int)indexPath.section,
(int)indexPath.item];
cell.accessibilityValue = cell.accessibilityIdentifier;
cell.accessibilityLabel = cell.accessibilityIdentifier;
cell.contentView.isAccessibilityElement = YES;
cell.contentView.accessibilityIdentifier = [NSString stringWithFormat:
@"HistoryObjectContentView-%d-%d",
(int)indexPath.section,
(int)indexPath.item];
cell.contentView.accessibilityValue = cell.contentView.accessibilityIdentifier;
cell.contentView.accessibilityLabel = cell.contentView.accessibilityIdentifier;
In my TestFile.m
XCUIApplication *app = [[XCUIApplication alloc] init];
[app.buttons[@"btnTabHistory"] tap];
[[[[[app childrenMatchingType:XCUIElementTypeWindow] elementBoundByIndex:0] childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther].element tap];
Let me know if you need more info. :)