Skip to content

trading-point/screenshot-testing-ios-demo

Repository files navigation

Screenshot Tests

This is a project to demonstrate how screenshot testing works and how to setup and configure in your iOS project.

Documentation

Take a look at the documentation at https://github.com/uber/ios-snapshot-test-case

Getting started

Setup Guide:

  1. Create a Project with Unit Test Target
  2. Run pod init (make sure you have the latests cocoapods)
  3. Open Podfile and paste the following
target 'YourProjectNameTests' do
inherit! :search_paths
pod 'iOSSnapshotTestCase'
end
  1. Run pod install

  2. Add the following Environment Variables in your Project

Name Value
FB_REFERENCE_IMAGE_DIR $(SOURCE_ROOT)/$(PROJECT_NAME)Tests/ReferenceImages
IMAGE_DIFF_DIR $(SOURCE_ROOT)/$(PROJECT_NAME)Tests/FailureDiffs

Of course you can set any folder you want inside your project, depending on where you want to save your Reference Images that will be created from Screenshot Testing.

Configuration:

We have created some combination functions that takes care to test multiple devices and even multiple themes. With those configurations you will make sure that you cover Minor and Edge Cases that can stretch your UI and also creating images can make a lot easier the communication with the Designer of the App to confirm the final UIViews created.

You can find the configuration files here

About

Screenshot testing for iOS platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published