O'Reilly logo

iOS 8 SDK Development, 2nd Edition by Janie Clayton, Chris Adamson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing Asynchronously

Take another look at running the app. After the app appears, it takes a second or two for the web page to load. But from the test’s point of view, as soon as the app is up and running, it is ready to be tested. What’s happening is that we are testing too soon. We need a way to wait before we run our test.

What we need is asynchronous testing, the ability to test things that happen at unpredictable times. If we wanted to test that 2 + 2 == 4, or that a string has a certain value, we could do that right away, because the value would be there right when we asked for it. But with the web view, we don’t know when (or if) its contents will be set. Asynchronous testing lets us test these kinds of unpredictable events.

Prior ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required