Set Up iOS Smoke Tests in Three Steps!

Joe Susnick
3 min readAug 25, 2017

I was recently tasked with helping someone set up some smoke tests and it took me longer than I want to admit. We tried a few different approaches before settling on using a build configuration to manage which tests are run. Hopefully this saves you a few minutes.

WARNING — having smoke tests will allow more time for coding and less time for eating chips off your belly. You have been warned.

Me, waiting for tests to run.

I’m going to assume you have a passing familiarity with Fastlane, but this process should be pretty universal even if you’re using a different build tool.

Step One:

Create a new build configuration.

Under Project Info, find Configurations and hit the plus button.

Hit the plus button

Duplicate an existing target. This shows me duplicating “Debug” but you can duplicate your test target if you have one.

Duplicate it!

Name your new configuration SmokeTest or something similar that will help you remember what it is.

Note: If you have Cocoapods set up, close xcode, run pod install, and reopen your workspace. This will setup your pods for your new configuration.

Step Two:

Update your scheme to only run the smoke tests for that configuration

Open the scheme editor:

Edit your scheme

Under Test select your new configuration:

New Config

Expand the tests and deselect the ones that you do not want to run as part of your smoke test:

Only check the tests you want to run

Step 3:

Run it your smoke tests with Fastlane’s scan

(leave a comment if you know of any different tools that allow you to run tests for a specific configuration, not sure if there are any…)

Create a new lane in your Fastfile and specify your new configuration.

Now you can run fastlane smoke_test from whatever CI platform you’re using.

Easy!

--

--