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 ...

Get Test iOS Apps with UI Automation now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.