O'Reilly logo

Test iOS Apps with UI Automation by Jonathan Penn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hiding Test-Setup Code from Release

Since we’re embedding a data factory into our application code, we should consider the impact this could have out in the wild. NearbyMe is a simple application, and an average user wouldn’t be able to set environment variables to trigger these destructive data operations, so it doesn’t matter much in this case. But if you have sensitive setup information for automated tests in your own applications, you may not want to compile the code paths that activate it, or even compile test-code files at all.

We’re going to practice forking our code so test-specific setup code exists only in our test-specific build. We’ll start by setting up a separate target that our test scheme will use. We’ll utilize preprocessor ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required