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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.