Join John Nastos for an in-depth discussion in this video Writing tests for the app interface, part of iOS Address Book App: Hands On.
- View Offline
- [Voiceover] Now that we've looked at writing tests…for the apps code, let's look at a different technique…that we can use to write tests for the applications UI.…When I first created this project in Xcode,…I was sure to include both unit tests…and UI test targets.…Because I did that, in the Project Navigator,…you can see that below the test file we were using…for testing in the last video, there's another…swift file specifically for UI tests.…Inside, there's a default template,…much like we saw for the unit tests.…If you look near the bottom of the Xcode window,…there's a very important button…that we're going to use for these tests.…
It's a red circle, which is meant to be…a record button.…If you click it, it should launch the application…and once it does, it attempts to translate…your interactions with the app into code…that can then be executed again as a test.…So, now that I've clicked the Record button,…I can click the Add button and you can see,…that a line of code gets added,…to represent that interaction.…
Build the project step-by-step and then use what you've learned to explore your own app ideas.
- Creating the project in Xcode
- Using Auto Layout to design the UI
- Attaching the interface to the code
- Creating the data model, including a Person class
- Adding stored data to the UI
- Displaying a contact's address with MapKit
- Linking contact info to other iOS apps
- Adding persistence
- Working with table views
- Writing tests
- Preparing to publish the app in the App Store