Skip to content

Commit

Permalink
feat: Add element attributes to the performAccessibilityAudit output (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaUA authored Nov 16, 2023
1 parent b67222e commit 0d7e4a6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,19 @@ - (BOOL)fb_dismissKeyboardWithKeyNames:(nullable NSArray<NSString *> *)keyNames
if (nil != auditTypeValue) {
auditType = valuesToNamesMap[auditTypeValue] ?: [auditTypeValue stringValue];
}

id extractedElement = extractIssueProperty(issue, @"element");

id<FBXCElementSnapshot> elementSnapshot = [extractedElement fb_takeSnapshot];
NSDictionary *elementAttributes = elementSnapshot ? [self.class dictionaryForElement:elementSnapshot recursive:NO] : @{};

[resultArray addObject:@{
@"detailedDescription": extractIssueProperty(issue, @"detailedDescription") ?: @"",
@"compactDescription": extractIssueProperty(issue, @"compactDescription") ?: @"",
@"auditType": auditType,
@"element": [extractIssueProperty(issue, @"element") description] ?: @"",
@"elementDescription": [extractIssueProperty(issue, @"element") debugDescription] ?: @"",
@"element": [extractedElement description] ?: @"",
@"elementDescription": [extractedElement debugDescription] ?: @"",
@"elementAttributes": elementAttributes ?: @{},
}];
return YES;
};
Expand Down

0 comments on commit 0d7e4a6

Please sign in to comment.