cashapp / AccessibilitySnapshot

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

Hide text field and text view cursors while snapshotting #206

Closed NickEntin closed 4 months ago

NickEntin commented 4 months ago

Resolves #15

DavidBrunow commented 4 months ago

You may have already considered and rejected this idea, but I've used UITextField.appearance().tintColor = .clear in the past to globally hide the cursors while creating snapshots.

NickEntin commented 4 months ago

You may have already considered and rejected this idea, but I've used UITextField.appearance().tintColor = .clear in the past to globally hide the cursors while creating snapshots.

@DavidBrunow Great suggestion, but I don't think there's a way to restore the original tint colors after the snapshot using the appearance API. If there's a way I don't know about, I'd love to hear.

NickEntin commented 4 months ago

Hmm the iOS 16 build is failing due to missing activation point targets. I've seen this issue locally too, but can't figure out what causes it. Sometimes the image just doesn't load.

    ActivationPointTests.testActivationPointEnabled()
    ActivationPointTests.testActivationPointEnabledWhenOverridden()
    -[ImpreciseObjectiveCTests testSimpleViewWithActivationPointAlways]
    -[ObjectiveCTests testSimpleViewWithActivationPointAlways]
    -[ObjectiveCTests testSimpleViewWithActivationPointDefault]
    SnapshotTestingTests.testShowingActivationPoint()
    SnapshotTestingTests.testShowingActivationPoint()
NickEntin commented 4 months ago

Filed #208 to track the activation point issue.