I love the idea of snapshot testing. It’s a simple way to automatically test an app’s UI.
It works like this:
- Set the app up in a certain state and take a screenshot. Save the screenshot. 📸
- Next time when you run the same test, you compare screenshots. 📷 📸
- If something changed unexpectedly, then you know there’s trouble. 💥
Here’s a nice series about how to do it for iOS/ Xcode.
And GitHub: swift-snapshot-testing
The coolest thing is that you actually upload your screenshots in any new pull requests, so you can literally see what the change is all about (“The perfect pull request”). 🤯
Via iOS Dev Weekly.