Software Dev

It’s Time for Snapshot Testing

I love the idea of snapshot testing. It’s a simple way to automatically test an app’s UI.

It works like this:

  1. Set the app up in a certain state and take a screenshot. Save the screenshot. 📸
  2. Next time when you run the same test, you compare screenshots. 📷 📸
  3. If something changed unexpectedly, then you know there’s trouble. 💥

Here’s a nice series about how to do it for iOS/ Xcode.

👉 Snapshot Testing. Testing the UI and Beyond (Part 1)

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”). 🤯

Image for post

Via iOS Dev Weekly.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.