UIAutomation????iOS?????????(??)
???????????? ???????[ 2013/4/3 11:46:28 ] ????????
?????????????
????3?????????????????????????
???????Tune-up????
???????????????????????α?д?????????????????????????????д???Щ????????????????????????????????
var target = UIATarget.localTarget();
var app = target.frontMostApp();
var window = app.mainWindow();
???????????????????????С??Javascript???????????д??UIAutomation??????????????https://github.com/alexvollmer/tuneup_js??????????????????????????????檔?????????????Tune-Up????????±?д?????Test1.js??
#import "tuneup/tuneup.js"
test("Test 1"?? function(target?? app) {
var window = app.mainWindow();
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();
assertEquals(recipeName?? textValue);
});
????Tune-Up??????????д???????????????????????????????????
ssertTrue(expression?? message)??
assertMatch(regExp?? expression?? message)??
assertEquals(expected?? received?? message)??
assertFalse(expression?? message)??
assertNull(thingie?? message)??
assertNotNull(thingie?? message)??
assertNull(thingie?? message)??
assertNotNull(thingie?? message)
???????
?????????????????????????????磬??????????????????uiautomation-ext.js?????????UIATarget??????logDevice??????
extend(UIATarget.prototype?? {
logDevice: function(){
UIALogger.logMessage("Dump Device:");
UIALogger.logMessage(" model: " + UIATarget.localTarget().model());
UIALogger.logMessage(" rect: " + JSON.stringify(UIATarget.localTarget().rect()));
UIALogger.logMessage(" name: "+ UIATarget.localTarget().name());
UIALogger.logMessage(" systemName: "+ UIATarget.localTarget().systemName());
UIALogger.logMessage(" systemVersion: "+ UIATarget.localTarget().systemVersion());
}
});
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11