cashapp / AccessibilitySnapshot

Easy regression testing for iOS accessibility
Apache License 2.0
534 stars 65 forks source link

Snapshots on iOS 16 sometimes show activation point unexpectedly #165

Closed NickEntin closed 5 months ago

NickEntin commented 9 months ago

Adding iOS 16 to our project's test config yielded many new crosshair overlays on buttons. There may be a pixel-rounding change that AccessibilityHierarchyParser.defaultActivationPoint(for: ) needs to take into account. And on that note, that method could be sensitive to text fields that are first responder (where the activation point is on the insertion bar rather than the center of the view).

Originally posted by @pwesten in https://github.com/cashapp/AccessibilitySnapshot/issues/117#issuecomment-1668349604

NickEntin commented 5 months ago

Reproduced this on iOS 17. Looks like it's sub-pixel offsets.

(lldb) po activationPoint
▿ (173.0, 425.83333333333337)
  - x : 173.0
  - y : 425.83333333333337
(lldb) po defaultActivationPoint(for: element.object)
▿ (172.91666666666666, 426.0)
  - x : 172.91666666666666
  - y : 426.0