??????????????

??????????????????????Щ????????????????????????e????tap()????????????????
var tabBar = UIATarget.localTarget().frontMostApp().tabBar();
var tabButton = tabBar.buttons()["First"];   
 
// Tap the tab bar !
tabButton.tap();

?????????????UIAButtons??doubleTap()??twoFingerTap()??????????????????????????????????????????????????????в????????????????

?????? ?????
UIATarget.localTarget().tap({x:100?? y:200});
UIATarget.localTarget().doubleTap({x:100?? y:200});
UIATarget.localTarget().twoFingerTap({x:100?? y:200});

?????? ?????
UIATarget.localTarget().pinchOpenFromToForDuration({x:20?? y:200}??{x:300?? y:200}??2);
UIATarget.localTarget().pinchCloseFromToForDuration({x:20?? y:200}?? {x:300?? y:200}??2);

?????? ?????????
UIATarget.localTarget().dragFromToForDuration({x:160?? y:200}??{x:160??y:400}??1);
UIATarget.localTarget().flickFromTo({x:160?? y:200}??{x:160?? y:400});

?????????????????????????????????????????Χ?????????????????????????????????0.5??С??60??

??????????????????????£?

????1????Instruments (⌘R)

????2????Scripts?????? ??????????

????3?????“Add > Import”??????TestAutomation/TestUI/Test-1.js?????????????浽???·????

????4?????????? (⌘R) ?????????????…

??????????Test-1.js????
var testName = "Test 1";
var target = UIATarget.localTarget();
var app = target.frontMostApp();
var window = app.mainWindow();
UIALogger.logStart( testName );
app.logElementTree();
//-- select the elements
UIALogger.logMessage( "Select the first tab" );
var tabBar = app.tabBar();
var selectedTabName = tabBar.selectedButton().name();
if (selectedTabName != "First") {
    tabBar.buttons()["First"].tap();
}
//-- tap on the text fiels
UIALogger.logMessage( "Tap on the text field now" );
var recipeName = "Unusually Long Name for a Recipe";
window.textFields()[0].setValue(recipeName);
target.delay( 2 );
//-- tap on the text fiels
UIALogger.logMessage( "Dismiss the keyboard" );
app.logElementTree();
app.keyboard().buttons()["return"].tap();
var textValue = window.staticTexts()["RecipeName"].value();
if (textValue === recipeName){
    UIALogger.logPass( testName ); 
}
else{
    UIALogger.logFail( testName ); 
}

??????ν?????????????????????????tab??б??????л????????tab?????????????????????“Unusually Long Name for a Recipe”?????????????????????????Щ?μ????????????UIATarget??delay(Number timeInterval) ??????????????????????????Щ?????UIALogger??logMessage( String message) ??????????????????????????????????UIALogger??logPass(String message)????????????????????????????????

?????????????η???????????????????????????

app.keyboard().buttons()["return"].tap();