swift-snapshot-testing icon indicating copy to clipboard operation
swift-snapshot-testing copied to clipboard

Restore first responder after cleaning up UI hierarchy

Open dmitri-zganiaiko opened this issue 3 years ago • 0 comments

This change fixes the following case:

  • UITextField (or UITextView) is a first responder
  • snapshot test runs
  • UITextField is no more the first responder

The fix is particularly useful when the same view is passed to two snapshot tests one after another. Say, the first snapshot test is a plain UI check, and the second one is an accessibility or layout test.

dmitri-zganiaiko avatar Feb 11 '22 13:02 dmitri-zganiaiko