Skip to content

Instantly share code, notes, and snippets.

@sgoodwin
Created November 5, 2012 00:28
Show Gist options
  • Save sgoodwin/4014543 to your computer and use it in GitHub Desktop.
Save sgoodwin/4014543 to your computer and use it in GitHub Desktop.
var target = UIATarget.localTarget();
var app = target.frontMostApp();
var window = app.mainWindow();
var testName = "Dummy Test";
function dummyTest(){
UIALogger.logStart(testName);
var button = window.buttons()["Go"];
if(!button.isValid()){
UIALogger.logFail("The Go Button was invalid!");
return;
}
button.tap();
var label = window.staticTexts()["Poopsicles!"];
label.isValid(); // This makes it wait until animation transition completes and the label appears before checking values.
window.logElementTree();
var title = label.label();
if(title == "Poopsicles!"){
UIALogger.logPass(testName);
}else{
UIALogger.logFail("The label's title was " + title);
}
}
dummyTest();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment