Created
February 13, 2015 05:39
-
-
Save alexbosworth/2410117298c22dc971e3 to your computer and use it in GitHub Desktop.
UIAutomation, delay until network activity indicator is missing
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
/** 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