Chapter 9Testing Alerts

Alerts are another means of getting input from the user. But by their nature, alerts interrupt the flow of execution. This can complicate automated testing.

Let’s just avoid the problem while making those alerts testable. In this chapter, you’ll learn how to use the ViewControllerPresentationSpy framework to test alerts. You’ll be able to test alerts using unit tests, which are faster and more reliable than UI tests.

Get iOS Unit Testing by Example 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.