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

Resetting the Simulator to Test Permissions

We’re moving faster now that we’ve tucked away the complexity of the raw shell commands in our Rakefile. Let’s keep going and use our “focus” task to help us construct a new behavior test that asserts what users should see if they deny access to the GPS coordinates.

Users are asked for permissions only the first time the application launches after install. If we were testing this from the Instruments GUI, then we’d have to reset the simulator or remove the application between each run. Because we’re building a shell script to automatically run our tests, we leverage that to reset the simulator automatically between each run.

First let’s change our “focus” task to run a new test file we’re going ...

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