Chapter 2Testing Behavior with UI Automation

We’ve learned a bit about how UI Automation functions, but the script we recorded doesn’t do anything useful for us. Let’s put UI Automation to work. We’re going to write a simple acceptance test that focuses on verifying application behavior through the eyes of the users, what they do, and what they expect. Automated acceptance-test scripts are a great way to demonstrate that we know how a feature is supposed to work, and we can re-run them at any time to inform us if the feature breaks.

Let’s start with something simple and write a test to make sure that the user is able to remove a search term from the list in our app, like we see in the following figure.

Figure 12. Deleting the “coffee” search ...

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.