use a more test-like example

This commit is contained in:
Jonathan Lipps
2013-01-12 11:06:48 -08:00
parent 2af241e162
commit fd91294cc4
2 changed files with 13 additions and 4 deletions

View File

@@ -81,7 +81,7 @@ while(runLoop) {
var result = eval(command);
console.log("####"+commandId+"####"+result+"####");
var url = 'send_result/'+commandId+'/'+encodeURIComponent(result);
doCurl('GET', endpoint + url, function(err, res) {
doCurl('GET', endpoint + url, null, function(err, res) {
console.log("Sent result to server");
});
}

View File

@@ -38,9 +38,18 @@ build(appRoot, function(err) {
inst.launch(function() {
console.log('done launching');
inst.sendCommand("application.bundleID()", function(result) {
console.log("Got result from instruments: " + result);
process.exit(0);
inst.sendCommand("application.bundleID()", function(bundleId) {
console.log("Bundle ID is " + bundleId);
inst.sendCommand("mainWindow.textFields()[0].setValue('3');", function() {
inst.sendCommand("mainWindow.textFields()[1].setValue('5');", function() {
inst.sendCommand("mainWindow.buttons()[0].tap();", function() {
inst.sendCommand("mainWindow.staticTexts()[0].value()", function(sum) {
console.log("Sum should be 8 and is " + sum);
process.exit(0);
});
});
});
});
});
}, function(code) {
process.exit(code);