facebookarchive / ios-snapshot-test-case

Snapshot view unit tests for iOS
MIT License
2.66k stars 253 forks source link

Snapshots with system keyboard #61

Closed dzenbot closed 9 years ago

dzenbot commented 9 years ago

Is this possible to achieve? Some of the tests I'm running depend of the system keyboard to be displayed as well. I've tried many things, without success.

dstnbrkr commented 9 years ago

Hi @dzenbot, could you share a code example of what isn't working?

orta commented 9 years ago

This was to support things like: https://github.com/slackhq/SlackTextViewController/raw/master/Screenshots/slacktextviewcontroller_demo.gif

I believe @dzenbot fixed it by looking at the root window instead of a view in particular.

dzenbot commented 9 years ago

Yes, I ended up stubbing a UIWindow instance, and setting the rootVC with my VC to test. And the snapshot is done using the window instead.

Result: https://slack-files.com/T031NHW8U-F041Y8ZG2-d4dd00cf75

Thanks!

joeblau commented 8 years ago

@dzenbot Can you post an snippet of what you did?

dzenbot commented 8 years ago

@joeblau: you can see a few examples here https://github.com/slackhq/SlackTextViewController/blob/master/SlackTextViewController/SnapshotTests/AutoCompletionTests.m

joeblau commented 8 years ago

@dzenbot Thanks!