appium-uiauto
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -101,6 +101,6 @@ // The Command Proxy relays UIAuto message to and from Appium. It is also the | ||
if (hasResult && !curCommand) { | ||
logger.info("Got a result when we weren't expecting one! Ignoring it"); | ||
logger.info("Result was: " + data.result); | ||
logger.debug("Got a result when we weren't expecting one! Ignoring it"); | ||
logger.debug("Result was: " + data.result); | ||
} else if (!hasResult && curCommand) { | ||
logger.info("Instruments didn't send a result even though we were expecting one"); | ||
logger.debug("Instruments didn't send a result even though we were expecting one"); | ||
hasResult = true; | ||
@@ -140,3 +140,3 @@ data.result = false; | ||
onReceiveCommand = null; | ||
logger.info("Sending command to instruments: " + curCommand.cmd); | ||
logger.debug("Sending command to instruments: " + curCommand.cmd); | ||
c.write(JSON.stringify({cmd: curCommand.cmd})); | ||
@@ -205,3 +205,3 @@ c.end(); | ||
if (err) return cb(err); | ||
logger.info("Instruments socket server started at " + sock); | ||
logger.debug("Instruments socket server started at " + sock); | ||
cb(); | ||
@@ -208,0 +208,0 @@ }); |
@@ -57,3 +57,3 @@ // Generate a bootstrap for the UIAuto Instruments script containing | ||
var prepareBootstrap = function (opts) { | ||
logger.warn('Preparing uiauto bootstrap'); | ||
logger.debug('Preparing uiauto bootstrap'); | ||
opts = opts || {}; | ||
@@ -105,5 +105,5 @@ | ||
if (codeIsGood){ | ||
logger.warn('Reusing dynamic bootstrap:', dynamicBootstrapPath); | ||
logger.debug('Reusing dynamic bootstrap:', dynamicBootstrapPath); | ||
} else { | ||
logger.warn('Creating or overwritting dynamic bootstrap:', dynamicBootstrapPath); | ||
logger.debug('Creating or overwritting dynamic bootstrap:', dynamicBootstrapPath); | ||
fs.writeFileSync(dynamicBootstrapPath, code, { flag: 'w+'}); | ||
@@ -110,0 +110,0 @@ } |
{ | ||
"name": "appium-uiauto", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "appium uiauto ios driver", | ||
"main": "lib/main.js", | ||
"bin": { | ||
}, | ||
"bin": {}, | ||
"scripts": { | ||
@@ -33,3 +32,3 @@ "test": "echo \"Error: no test specified\" && exit 1" | ||
"devDependencies": { | ||
"appium-instruments": "1.1.1", | ||
"appium-instruments": "~1.2.0", | ||
"chai": "~1.9.1", | ||
@@ -36,0 +35,0 @@ "chai-as-promised": "~4.1.1", |
@@ -42,3 +42,3 @@ 'use strict'; | ||
process.env.VERBOSE_INSTRUMENTS = false; | ||
sinon.spy(logger, "warn"); | ||
sinon.spy(logger, "debug"); | ||
}); | ||
@@ -48,3 +48,3 @@ | ||
process.env.VERBOSE_INSTRUMENTS = origEnv.VERBOSE_INSTRUMENTS; | ||
logger.warn.restore(); | ||
logger.debug.restore(); | ||
}); | ||
@@ -62,3 +62,4 @@ | ||
}).then(function () { | ||
logger.warn.getCall(1).args[0].should.match(/Creating or overwritting dynamic bootstrap/); | ||
logger.debug.calledWithMatch(/Creating or overwritting dynamic bootstrap/).should.be.ok; | ||
logger.debug.reset(); | ||
}) | ||
@@ -72,5 +73,6 @@ // second call: should reuse bootstrap file | ||
}).then(function () { | ||
logger.warn.getCall(3).args[0].should.match(/Reusing dynamic bootstrap/); | ||
logger.debug.calledWithMatch(/Reusing dynamic bootstrap/).should.be.ok; | ||
logger.debug.reset(); | ||
}) | ||
// second call call with different param: should create different bootstrap file | ||
// third call call with different param: should create different bootstrap file | ||
.then(function () { return prepareBootstrap({verboseInstruments: true});}) | ||
@@ -83,6 +85,7 @@ .then(function (bootstrapFile) { | ||
.then(function () { | ||
logger.warn.getCall(5).args[0].should.match(/Creating or overwritting dynamic bootstrap/); | ||
}).nodeify(done); | ||
logger.debug.calledWithMatch(/Creating or overwritting dynamic bootstrap/).should.be.ok; | ||
}) | ||
.nodeify(done); | ||
}); | ||
}); |
@@ -1,2 +0,2 @@ | ||
/* globals env, alerts, commands */ | ||
/* globals env, alerts, commands, $ */ | ||
@@ -17,2 +17,3 @@ /* jshint ignore:start */ | ||
env.init(dynamicEnv); | ||
$.isVerbose = env.isVerbose; | ||
alerts.configure(); | ||
@@ -19,0 +20,0 @@ commands.startProcessing(); |
@@ -78,16 +78,16 @@ // The message route is the following: | ||
try { | ||
$.log("Running system command #" + curAppiumCmdId + ": " + cmdLog); | ||
$.debug("Running system command #" + curAppiumCmdId + ": " + cmdLog); | ||
res = $.system().performTaskWithPathArgumentsTimeout(env.nodePath, args, WAIT_FOR_DATA_TIMEOUT); | ||
} catch (e) { | ||
$.log(e.name + " error getting command " + curAppiumCmdId + ": " + e.message); | ||
$.debug(e.name + " error getting command " + curAppiumCmdId + ": " + e.message); | ||
return null; | ||
} | ||
if (!res) { | ||
$.log("Command proxy client (" + cmd + ") exited with null res"); | ||
$.debug("Command proxy client (" + cmd + ") exited with null res"); | ||
return null; | ||
} | ||
if (res.exitCode !== 0) { | ||
$.log("Command proxy client (" + cmd + ") exited with " + res.exitCode + | ||
$.debug("Command proxy client (" + cmd + ") exited with " + res.exitCode + | ||
", here's stdout:"); | ||
$.log(res.stdout); | ||
$.debug(res.stdout); | ||
return null; | ||
@@ -110,7 +110,7 @@ } | ||
var result; | ||
$.log("Got new command " + curAppiumCmdId + " from instruments: " + cmd); | ||
$.debug("Got new command " + curAppiumCmdId + " from instruments: " + cmd); | ||
try { | ||
if (cmd.indexOf(BOOTSTRAP_CONFIG_PREFIX) === 0) { | ||
var configStr = cmd.slice(BOOTSTRAP_CONFIG_PREFIX.length); | ||
$.log("Got bootstrap config: " + configStr); | ||
$.debug("Got bootstrap config: " + configStr); | ||
eval(configStr); | ||
@@ -147,6 +147,6 @@ } else if (cmd === MORE_COMMAND) { | ||
result = ''; | ||
$.log("Command executed without response"); | ||
$.debug("Command executed without response"); | ||
} | ||
if (typeof result.status === "undefined" || typeof result.status === "object") { | ||
$.log("Result is not protocol compliant, wrapping"); | ||
$.debug("Result is not protocol compliant, wrapping"); | ||
result = { | ||
@@ -153,0 +153,0 @@ status: errors.Success.code, |
@@ -136,6 +136,6 @@ /* globals $, errors */ | ||
// assume another alert popped up | ||
$.log("Waited for a while and alert didn't close, moving on"); | ||
$.debug("Waited for a while and alert didn't close, moving on"); | ||
isClosed = true; | ||
} else { | ||
$.log("Waiting for alert to close..."); | ||
$.debug("Waiting for alert to close..."); | ||
this.delay(300); | ||
@@ -142,0 +142,0 @@ alert = $.mainApp().alert(); |
@@ -15,3 +15,4 @@ /* globals $ */ | ||
, logTree: function () {$($.mainApp()).logTree();} | ||
, debug: function (s) { if ($.isVerbose) UIALogger.logDebug(s); } | ||
}); | ||
})(); |
@@ -65,3 +65,3 @@ /* globals $, errors */ | ||
case 'pressKey': | ||
$.log("Hiding keyboard by pressing the key: " + keyName); | ||
$.debug("Hiding keyboard by pressing the key: " + keyName); | ||
try { | ||
@@ -68,0 +68,0 @@ var keys = $.keyboard().buttons(); |
@@ -50,3 +50,3 @@ /* globals errors, $ */ | ||
if (el.name() !== null) { | ||
$.log('Lookup returned ' + el + ' with the name "' + el.name() + '" (id: ' + id + ').'); | ||
$.debug('Lookup returned ' + el + ' with the name "' + el.name() + '" (id: ' + id + ').'); | ||
} | ||
@@ -53,0 +53,0 @@ this.cache[id] = el; |
@@ -84,3 +84,3 @@ /* globals $, errors */ | ||
for (var i = 0; i < indicators.length; i++) { | ||
$.log("[" + counter + "] waiting on " + indicators[i].type() + ": " + | ||
$.debug("[" + counter + "] waiting on " + indicators[i].type() + ": " + | ||
" visible: " + indicators[i].isVisible() + | ||
@@ -107,3 +107,3 @@ " parent: " + indicators[i].parent().type()); | ||
// indicators never went away... | ||
$.log("WARNING: Waited for indicators to become non-visible but they never did, moving on"); | ||
$.debug("WARNING: Waited for indicators to become non-visible but they never did, moving on"); | ||
return { | ||
@@ -110,0 +110,0 @@ status: errors.UnknownError.code, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13339147
3223