node-simctl
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -27,6 +27,7 @@ 'use strict'; | ||
function simExec(command, timeout) { | ||
function simCommand(command, timeout) { | ||
var args = arguments.length <= 2 || arguments[2] === undefined ? [] : arguments[2]; | ||
var env = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3]; | ||
return _regeneratorRuntime.async(function simExec$(context$1$0) { | ||
var executingFunction = arguments.length <= 4 || arguments[4] === undefined ? _teen_process.exec : arguments[4]; | ||
return _regeneratorRuntime.async(function simCommand$(context$1$0) { | ||
while (1) switch (context$1$0.prev = context$1$0.next) { | ||
@@ -44,3 +45,3 @@ case 0: | ||
context$1$0.prev = 3; | ||
return context$1$0.abrupt('return', (0, _teen_process.exec)('xcrun', args, { timeout: timeout, env: env })); | ||
return context$1$0.abrupt('return', executingFunction('xcrun', args, { timeout: timeout, env: env })); | ||
@@ -64,2 +65,47 @@ case 7: | ||
function simExec(command, timeout) { | ||
var args = arguments.length <= 2 || arguments[2] === undefined ? [] : arguments[2]; | ||
var env = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3]; | ||
return _regeneratorRuntime.async(function simExec$(context$1$0) { | ||
while (1) switch (context$1$0.prev = context$1$0.next) { | ||
case 0: | ||
return context$1$0.abrupt('return', simCommand(command, timeout, args, env, function (c, a, ob) { | ||
return (0, _teen_process.exec)(c, a, ob); | ||
})); | ||
case 1: | ||
case 'end': | ||
return context$1$0.stop(); | ||
} | ||
}, null, this); | ||
} | ||
function simSubProcess(command, timeout) { | ||
var args = arguments.length <= 2 || arguments[2] === undefined ? [] : arguments[2]; | ||
var env = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3]; | ||
return _regeneratorRuntime.async(function simSubProcess$(context$1$0) { | ||
var _this = this; | ||
while (1) switch (context$1$0.prev = context$1$0.next) { | ||
case 0: | ||
return context$1$0.abrupt('return', simCommand(command, timeout, args, env, function callee$1$0(c, a, ob) { | ||
return _regeneratorRuntime.async(function callee$1$0$(context$2$0) { | ||
while (1) switch (context$2$0.prev = context$2$0.next) { | ||
case 0: | ||
return context$2$0.abrupt('return', new _teen_process.SubProcess(c, a, ob)); | ||
case 1: | ||
case 'end': | ||
return context$2$0.stop(); | ||
} | ||
}, null, _this); | ||
})); | ||
case 1: | ||
case 'end': | ||
return context$1$0.stop(); | ||
} | ||
}, null, this); | ||
} | ||
function installApp(udid, appPath) { | ||
@@ -116,2 +162,5 @@ return _regeneratorRuntime.async(function installApp$(context$1$0) { | ||
case 2: | ||
return context$1$0.abrupt('return', context$1$0.sent); | ||
case 3: | ||
case 'end': | ||
@@ -123,2 +172,20 @@ return context$1$0.stop(); | ||
function spawnSubProcess(udid, executablePath) { | ||
var env = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; | ||
return _regeneratorRuntime.async(function spawnSubProcess$(context$1$0) { | ||
while (1) switch (context$1$0.prev = context$1$0.next) { | ||
case 0: | ||
context$1$0.next = 2; | ||
return _regeneratorRuntime.awrap(simSubProcess('spawn', 0, [udid, executablePath], env)); | ||
case 2: | ||
return context$1$0.abrupt('return', context$1$0.sent); | ||
case 3: | ||
case 'end': | ||
return context$1$0.stop(); | ||
} | ||
}, null, this); | ||
} | ||
function shutdown(udid) { | ||
@@ -170,9 +237,26 @@ return _regeneratorRuntime.async(function shutdown$(context$1$0) { | ||
function deleteDevice(udid) { | ||
var loopFn; | ||
return _regeneratorRuntime.async(function deleteDevice$(context$1$0) { | ||
var _this2 = this; | ||
while (1) switch (context$1$0.prev = context$1$0.next) { | ||
case 0: | ||
context$1$0.next = 2; | ||
return _regeneratorRuntime.awrap(simExec('delete', 0, [udid])); | ||
loopFn = function loopFn() { | ||
return _regeneratorRuntime.async(function loopFn$(context$2$0) { | ||
while (1) switch (context$2$0.prev = context$2$0.next) { | ||
case 0: | ||
context$2$0.next = 2; | ||
return _regeneratorRuntime.awrap(simExec('delete', 0, [udid])); | ||
case 2: | ||
case 2: | ||
case 'end': | ||
return context$2$0.stop(); | ||
} | ||
}, null, _this2); | ||
}; | ||
context$1$0.next = 3; | ||
return _regeneratorRuntime.awrap((0, _asyncbox.retryInterval)(5, 200, loopFn)); | ||
case 3: | ||
case 'end': | ||
@@ -187,3 +271,3 @@ return context$1$0.stop(); | ||
return _regeneratorRuntime.async(function eraseDevice$(context$1$0) { | ||
var _this = this; | ||
var _this3 = this; | ||
@@ -203,3 +287,3 @@ while (1) switch (context$1$0.prev = context$1$0.next) { | ||
} | ||
}, null, _this); | ||
}, null, _this3); | ||
}; | ||
@@ -404,2 +488,3 @@ | ||
exports.spawn = spawn; | ||
exports.spawnSubProcess = spawnSubProcess; | ||
exports.shutdown = shutdown; | ||
@@ -411,2 +496,4 @@ exports.createDevice = createDevice; | ||
// retry delete with a sleep in between because it's flakey | ||
// retry erase with a sleep in between because it's flakey | ||
@@ -434,2 +521,2 @@ | ||
// otherwise return all the sdk -> device mappings. | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9zaW1jdGwuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7NEJBQXFCLGNBQWM7O3dCQUNMLFVBQVU7OzRCQUNkLGVBQWU7O3NCQUMzQixRQUFROzs7O0FBR3RCLElBQU0sR0FBRyxHQUFHLDZCQUFVLFFBQVEsQ0FBQyxDQUFDOztBQUVoQyxTQUFlLE9BQU8sQ0FBRSxPQUFjLEVBQUUsT0FBYztNQUFFLElBQVUseURBQUcsRUFBRTtNQUNuRSxHQUFHLHlEQUFHLEVBQUU7Ozs7O0FBRVYsWUFBSSxJQUFJLFFBQVEsRUFBRSxPQUFPLDRCQUFLLElBQUksRUFBQyxDQUFDO0FBQ3BDLFdBQUcsQ0FBQyxJQUFJLGtDQUFnQyxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxzQkFBaUIsT0FBTyxDQUFHLENBQUM7OztBQUdsRixXQUFHLEdBQUcsb0JBQUUsUUFBUSxD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biAgaWYgKGZvclNkaykge1xuICAgIGlmICghZGV2aWNlc1tmb3JTZGtdKSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoYFNkayAnJHtmb3JTZGt9JyB3YXMgbm90IGluIGxpc3Qgb2Ygc2ltY3RsIHNka3NgKTtcbiAgICB9XG4gICAgcmV0dXJuIGRldmljZXNbZm9yU2RrXTtcbiAgfVxuXG4gIC8vIG90aGVyd2lzZSByZXR1cm4gYWxsIHRoZSBzZGsgLT4gZGV2aWNlIG1hcHBpbmdzLlxuICByZXR1cm4gZGV2aWNlcztcbn1cblxuZXhwb3J0IHsgaW5zdGFsbEFwcCwgcmVtb3ZlQXBwLCBsYXVuY2gsIHNwYXduLCBzcGF3blN1YlByb2Nlc3MsIHNodXRkb3duLCBjcmVhdGVEZXZpY2UsXG4gICAgICAgICBkZWxldGVEZXZpY2UsIGVyYXNlRGV2aWNlLCBnZXREZXZpY2VzIH07XG4iXX0= |
@@ -1,2 +0,2 @@ | ||
import { exec } from 'teen_process'; | ||
import { exec, SubProcess } from 'teen_process'; | ||
import { retryInterval } from 'asyncbox'; | ||
@@ -9,4 +9,3 @@ import { getLogger } from 'appium-logger'; | ||
async function simExec (command:string, timeout:number, args:Array = [], | ||
env = {}) { | ||
async function simCommand (command:string, timeout:number, args:Array = [], env = {}, executingFunction = exec) { | ||
// run a particular simctl command | ||
@@ -22,3 +21,3 @@ args = ['simctl', command, ...args]; | ||
try { | ||
return exec('xcrun', args, {timeout, env}); | ||
return executingFunction('xcrun', args, {timeout, env}); | ||
} catch (e) { | ||
@@ -33,2 +32,14 @@ if (e.stderr) { | ||
async function simExec (command:string, timeout:number, args:Array = [], env = {}) { | ||
return simCommand(command, timeout, args, env, (c, a, ob) => { | ||
return exec(c, a, ob); | ||
}); | ||
} | ||
async function simSubProcess (command:string, timeout:number, args:Array = [], env = {}) { | ||
return simCommand(command, timeout, args, env, async (c, a, ob) => { | ||
return new SubProcess(c, a, ob); | ||
}); | ||
} | ||
async function installApp (udid:string, appPath:string):void { | ||
@@ -47,5 +58,9 @@ await simExec('install', 0, [udid, appPath]); | ||
async function spawn (udid:string, executablePath:string, env = {}):void { | ||
await simExec('spawn', 0, [udid, executablePath], env); | ||
return await simExec('spawn', 0, [udid, executablePath], env); | ||
} | ||
async function spawnSubProcess (udid:string, executablePath:string, env = {}):void { | ||
return await simSubProcess('spawn', 0, [udid, executablePath], env); | ||
} | ||
async function shutdown (udid:string):void { | ||
@@ -67,3 +82,7 @@ await simExec('shutdown', 0, [udid]); | ||
async function deleteDevice (udid:string):void { | ||
await simExec('delete', 0, [udid]); | ||
let loopFn:Function = async () => { | ||
await simExec('delete', 0, [udid]); | ||
}; | ||
// retry delete with a sleep in between because it's flakey | ||
await retryInterval(5, 200, loopFn); | ||
} | ||
@@ -144,3 +163,3 @@ | ||
export { installApp, removeApp, launch, spawn, shutdown, createDevice, | ||
export { installApp, removeApp, launch, spawn, spawnSubProcess, shutdown, createDevice, | ||
deleteDevice, eraseDevice, getDevices }; |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"author": "https://github.com/appium", | ||
@@ -33,3 +33,4 @@ "license": "Apache-2.0", | ||
"source-map-support": "^0.2.8", | ||
"teen_process": "^1.3.1" | ||
"teen_process": "^1.3.1", | ||
"lodash": "^3.10.1" | ||
}, | ||
@@ -44,5 +45,4 @@ "scripts": { | ||
"chai": "^3.2.0", | ||
"gulp": "^3.9.0", | ||
"lodash": "^3.10.1" | ||
"gulp": "^3.9.0" | ||
} | ||
} |
@@ -157,5 +157,14 @@ ## node-simctl | ||
`spawn(udid, executablePath, env)` | ||
- spawns a process on the simulator specified by `udid` with given environment variable in `env` | ||
`spawnSubProcess(udid, executablePath, env)` | ||
- spawns a process on the simulator specified by `udid` with given environment variable in `env` | ||
- returns a (SubProcess)[https://github.com/appium/node-teen_process#teen_processsubprocess] object. | ||
### Usage | ||
See [specs](test/simctl-specs.js) for examples of usage. |
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
66273
3
813
170
6
+ Addedlodash@^3.10.1
+ Addedlodash@3.10.1(transitive)