Skip to content

Instantly share code, notes, and snippets.

@Cee
Created March 25, 2015 15:41
Show Gist options
  • Select an option

  • Save Cee/496748f5723214c9ca20 to your computer and use it in GitHub Desktop.

Select an option

Save Cee/496748f5723214c9ca20 to your computer and use it in GitHub Desktop.
var testName = "HomeVC Test";
UIALogger.logStart(testName);
var app = UIATarget.localTarget().frontMostApp();
var mainWindow = app.mainWindow();
mainWindow.buttons()[4].tap();
UIATarget.localTarget().captureScreenWithName("HomeVC");
UIALogger.logMessage("Start testing...");
var collectionView = mainWindow.collectionViews()[0];
for (var i = 0; i < collectionView.cells().length; i++) {
// Enter
UIATarget.localTarget().delay(1);
collectionView.cells()[i].tap();
// Wait
UIATarget.localTarget().delay(1);
UIATarget.localTarget().captureScreenWithName("Capture Pic " + i);
UIATarget.localTarget().delay(1);
// Back
UIATarget.localTarget().frontMostApp().mainWindow().navigationBar().buttons()[0].tap();
UIATarget.localTarget().delay(1);
}
UIALogger.logPass(testName);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment