Skip to content

Instantly share code, notes, and snippets.

@alexbosworth
Created February 13, 2015 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexbosworth/2410117298c22dc971e3 to your computer and use it in GitHub Desktop.
Save alexbosworth/2410117298c22dc971e3 to your computer and use it in GitHub Desktop.
UIAutomation, delay until network activity indicator is missing
/** Delay execution until status bar Network Activity is completed
{}
*/
automation.afterNetworkActivityEnds = function(args, cbk) {
var statusBar = target.frontMostApp().statusBar();
var predicate = "name beginswith 'Network'";
while (statusBar.elements().firstWithPredicate(predicate).isValid()) {
UIALogger.logMessage("Waiting for network");
target.delay(0.2);
}
cbk();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment