appium-instruments
Advanced tools
Comparing version
@@ -7,3 +7,3 @@ // Wrapper around Apple's Instruments app | ||
exec = require('child_process').exec, | ||
logger = require('./logger.js').get(), | ||
logger = require('./logger.js'), | ||
fs = require('fs'), | ||
@@ -270,3 +270,3 @@ _ = require('underscore'), | ||
Instruments.prototype.launchAndKill = function (msToLetLive, cb) { | ||
logger.info("Launching instruments briefly then killing it"); | ||
logger.warn("Launching instruments briefly then killing it"); | ||
this.setInstrumentsPath(function (err) { | ||
@@ -295,2 +295,3 @@ if (err) return cb(err); | ||
Instruments.prototype.launch = function (cb) { | ||
logger.warn("Launching instruments"); | ||
// prepare temp dir | ||
@@ -348,8 +349,8 @@ var tmpDir = "/tmp/appium-instruments"; | ||
// on the fly | ||
if(simulatorSdkAndDevice === 'iPhone - Simulator - iOS 7.1') | ||
if (simulatorSdkAndDevice === 'iPhone - Simulator - iOS 7.1') | ||
simulatorSdkAndDevice = 'iPhone Retina (4-inch 64-bit) - Simulator - iOS 7.1'; | ||
if(simulatorSdkAndDevice === 'iPad - Simulator - iOS 7.1') | ||
if (simulatorSdkAndDevice === 'iPad - Simulator - iOS 7.1') | ||
simulatorSdkAndDevice = 'iPad Retina (64-bit) - Simulator - iOS 7.1'; | ||
if(simulatorSdkAndDevice !== this.simulatorSdkAndDevice) | ||
logger.info("Instruments device was changed from:\"", this.simulatorSdkAndDevice, "\" to:\"", | ||
if (simulatorSdkAndDevice !== this.simulatorSdkAndDevice) | ||
logger.info("Instruments device was changed from:\"", this.simulatorSdkAndDevice, "\" to:\"", | ||
simulatorSdkAndDevice + "\""); | ||
@@ -438,3 +439,3 @@ | ||
Instruments.prototype.getAvailableDevices = function (cb) { | ||
logger.info("Getting list of devices instruments supports"); | ||
logger.warn("Getting list of devices instruments supports"); | ||
this.setInstrumentsPath(function (err) { | ||
@@ -441,0 +442,0 @@ if (err) return cb(err); |
'use strict'; | ||
var logger = require('winston'); | ||
var logger = require('winston'), | ||
_ = require('underscore'); | ||
module.exports = { | ||
init: function (logger) { | ||
logger = logger; | ||
var loggerWrap = { | ||
init: function (_logger) { | ||
logger = _logger; | ||
}, | ||
get: function () { | ||
return logger; | ||
} | ||
}; | ||
_(['info','debug','warn','error']).each(function (level) { | ||
loggerWrap[level] = function () { | ||
var args = Array.prototype.slice.call(arguments, 0); | ||
logger[level].apply(logger, args); | ||
}; | ||
}); | ||
module.exports = loggerWrap; |
{ | ||
"name": "appium-instruments", | ||
"version": "0.1.21", | ||
"version": "1.0.0-beta1", | ||
"description": "IOS Instruments + instruments-without-delay launcher used by Appium", | ||
@@ -32,15 +32,17 @@ "main": "lib/main.js", | ||
"uuid-js": "~0.7.4", | ||
"rimraf": "~2.2.6", | ||
"mkdirp": "~0.3.5", | ||
"winston": "~0.7.2" | ||
"rimraf": "~2.2.8", | ||
"mkdirp": "~0.5.0", | ||
"winston": "~0.7.3" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1.17.1", | ||
"chai": "~1.9.0", | ||
"async": "~0.2.10", | ||
"appium-uiauto": "0.0.7", | ||
"q": "^1.0.1", | ||
"sinon": "~1.9.0", | ||
"appium-uiauto": "1.0.0-beta1", | ||
"async": "~0.9.0", | ||
"chai": "~1.9.1", | ||
"jscs": "~1.4.5", | ||
"jshint": "~2.5.1", | ||
"mocha": "~1.20.0", | ||
"q": "~1.0.1", | ||
"sinon": "~1.10.2", | ||
"sinon-chai": "~2.5.0" | ||
} | ||
} |
@@ -28,12 +28,14 @@ 'use strict'; | ||
function newInstrument(timeout) { | ||
return new Instruments({ | ||
app: path.resolve(__dirname, '../assets/TestApp.app'), | ||
bootstrap: utils.bootstrap, | ||
template: xcodeTraceTemplatePath, | ||
withoutDelay: true, | ||
xcodeVersion: '5.1', | ||
webSocket: null, | ||
launchTimeout: timeout, | ||
flakeyRetries: true, | ||
logNoColors: false, | ||
return utils.bootstrap.then(function (bootstrapFile) { | ||
return new Instruments({ | ||
app: path.resolve(__dirname, '../assets/TestApp.app'), | ||
bootstrap: bootstrapFile, | ||
template: xcodeTraceTemplatePath, | ||
withoutDelay: true, | ||
xcodeVersion: '5.1', | ||
webSocket: null, | ||
launchTimeout: timeout, | ||
flakeyRetries: true, | ||
logNoColors: false, | ||
}); | ||
}); | ||
@@ -45,7 +47,9 @@ } | ||
it('should start', function (done) { | ||
instruments = newInstrument(timeout); | ||
instruments.start(function (err) { | ||
should.not.exist(err); | ||
done(); | ||
}); | ||
newInstrument(timeout).then(function (_instruments) { | ||
instruments = _instruments; | ||
instruments.start(function (err) { | ||
should.not.exist(err); | ||
done(); | ||
}); | ||
}).done(); | ||
}); | ||
@@ -64,7 +68,10 @@ | ||
it('should start', function (done) { | ||
instruments = newInstrument(60000); | ||
instruments.shutdown(function (err) { | ||
err.should.include('Didn\'t not shutdown within'); | ||
done(); | ||
}); | ||
newInstrument(60000).then(function (_instruments) { | ||
instruments = _instruments; | ||
instruments.shutdown(function (err) { | ||
err.should.include('Didn\'t not shutdown within'); | ||
done(); | ||
}); | ||
}) | ||
.done(); | ||
}); | ||
@@ -86,13 +93,15 @@ }); | ||
} | ||
instruments = newInstrument(60000); | ||
instruments.getAvailableDevices(function (err, devices) { | ||
should.not.exist(err); | ||
if (iosVer >= 7.1) { | ||
devices.length.should.equal(7); | ||
devices.should.contain("iPhone - Simulator - iOS 7.1"); | ||
} else { | ||
devices.length.should.equal(0); | ||
} | ||
done(); | ||
}); | ||
newInstrument(60000).then(function (_instruments) { | ||
instruments = _instruments; | ||
instruments.getAvailableDevices(function (err, devices) { | ||
should.not.exist(err); | ||
if (iosVer >= 7.1) { | ||
devices.length.should.be.above(0); | ||
devices.should.contain("iPhone - Simulator - iOS 7.1"); | ||
} else { | ||
devices.length.should.equal(0); | ||
} | ||
done(); | ||
}); | ||
}).done(); | ||
}); | ||
@@ -99,0 +108,0 @@ }); |
@@ -7,3 +7,3 @@ 'use strict'; | ||
exports.bootstrap = require('appium-uiauto').bootstrap; | ||
exports.bootstrap = require('appium-uiauto').prepareBootstrap(); | ||
@@ -10,0 +10,0 @@ exports.getXcodeTraceTemplatePath = function () { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
619327
0.21%62
1.64%787
3.55%0
-100%9
28.57%+ Added
+ Added
- Removed
Updated
Updated
Updated