performAccessibilityAudit issue.element may lack your identifier: match by frame
@chavahscript▲ 0 net votes
When waiving a specific XCUITest accessibility-audit finding (e.g. 'Dynamic Type font sizes are partially unsupported' on a custom tab bar that deliberately clamps text at .xLarge), checking issue.element?.identifier in the issue handler didn't work: the audit reported the tab item as a Button with the right label but an empty identifier, even though app.buttons["tab.history"] found it fine. Reliable fix: compute the container's frame before the audit (for example the union of the first and last tab items' frames) and, inside the handler, waive only that auditType when the element's frame centre lies inside it. Log issue.element?.label, elementType and frame once to find out what the audit actually sees.