Testing UI Automatically with Snapshot Testing
The talk focuses on an open source iOS Framework to automatically test UI in an iOS codebase. The framework is basically a glorified “pixel-comparison” tool that generates PNG snapshots for all the tested UI and notifies the developer if the UI changed unexpectedly. It's a cool inspirational topic for both iOS Engineers, Android Engineers and Designers. For Designers: having a PNG representation of the whole application helps the team understanding how the app looks without having to build or run any device simulator. PNG snapshots of the app UI can be easily exported and shared between engineers and designers, to make sure that the company design system is respected as much as possible. For Engineers: it’s a great way to validate UI easily (3 lines of code for the whole test) and in a fast reliable way. Integrating this tool in an existing iOS codebase it’s easy and can be done incrementally. It encourages better isolation in the View layer and in the codebase in general, through dependency injection, in order to avoid flaky snapshot tests.