Created
July 30, 2013 18:50
-
-
Save markrickert/6115693 to your computer and use it in GitHub Desktop.
Trying to loop through a UITableView... it prints out the "puts" line all at once.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "should select all cells and go back" do | |
wait 0.5 do #Wait for the view to load | |
ips = [] | |
(1..@screen.table_view.numberOfSections-1).to_a.each do |section| # (skip the first section) | |
rows = @screen.table_view.numberOfRowsInSection(section) | |
(0..rows-1).to_a.each do |row| | |
ips << NSIndexPath.indexPathForRow(row, inSection:section) | |
end | |
end | |
ips.each do |ip| | |
wait 0.75 do | |
@screen.table_view.scrollToRowAtIndexPath(ip, atScrollPosition:UITableViewScrollPositionMiddle, animated:false) | |
wait 1.5 do | |
puts "#{section}, #{row} (#{indexPath})" | |
tap(@screen.table_view.cellForRowAtIndexPath(indexPath)) | |
wait 0.75 do | |
tap("Back") | |
end | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment