Posted by: Brian Knorr on: August 4, 2009
Over the weekend I made some small changes to the way traversals work in UISpec. As a result the following method names have changed:
Calling these methods return exactly what you would except them to. The method parent finds the parent view, child gets you the first child view, and descendant retrieves the first descendant view. Of course each result is wrapped in a UIQuery object. And if you want all the views and not just the first, call the method all afterward. Here are some examples
//Finds the first child of the //first UITableViewCell app.tableViewCell.child; //Finds the all child views under //the first UITableViewCell app.tableViewCell.child.all; //Touches all the child views under the first UITableView app.tableView.child.all.touch //Both of these will find the first child UILabel //under UITableViewCell app.tableViewCell.child.label; [app.tableViewCell.child view:@"UILabel"]; //Both of these will find all the child UILabels //under UITableViewCell app.tableViewCell.child.label.all; [app.tableViewCell.child view:@"UILabel"].all; //And of course the default way still works the same //Finds the first descendant UILabel //under UITableViewCell app.tableViewCell.label; //Finds all the descendant UILabels //under UITableViewCell app.tableViewCell.label.all;
Also the documentation has been updated to reflect these changes.