mirror of
https://github.com/appium/appium.git
synced 2026-02-18 07:58:56 -06:00
use a more test-like example
This commit is contained in:
2
instruments/bootstrap_example.js
vendored
2
instruments/bootstrap_example.js
vendored
@@ -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");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user