O'Reilly logo

Test iOS Apps with UI Automation by Jonathan Penn

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

Converting Our Test Suite to Screen Objects

Now that our toolbox is getting handier, we can quickly update the old test that removes a search term. Let’s do some more experimentation and plan out the new test in the new test-suite file to replace the old one:

04-OrganizingTestCode/step12/automation/test_suite.js
 
test(​"Removing the 'coffee' search term"​, ​function​() {
 
var​ s = SearchTermScreen;
 
s.removeTerm(​"coffee"​);
 
s.assertNoTerm(​"coffee"​);
 
});

Pretty straightforward. We only have two high-level steps to perform. Neither the removeTerm nor the assertNoTerm method exists yet, so let’s start by building removeTerm on the SearchTermScreen object:

04-OrganizingTestCode/step12/automation/lib/screens/SearchTermScreen.js
 
// ... ...

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