marionette-client
Advanced tools
Comparing version 1.7.5 to 1.7.6
@@ -0,2 +1,4 @@ | ||
/* global Marionette */ | ||
(function(module, ns) { | ||
'use strict'; | ||
@@ -3,0 +5,0 @@ /** |
@@ -0,2 +1,4 @@ | ||
/* global Marionette */ | ||
(function(module, ns) { | ||
'use strict'; | ||
@@ -417,3 +419,5 @@ var Element = ns.require('element'), | ||
onScriptTimeout: function() { | ||
console.log('Screenshot: ' + 'data:image/png;base64,' + this.screenshot()); | ||
console.log('Screenshot: ' + | ||
'data:image/png;base64,' + | ||
this.screenshot()); | ||
}, | ||
@@ -507,3 +511,2 @@ | ||
var self = this; | ||
var result; | ||
@@ -683,2 +686,11 @@ try { | ||
function done(_err, _result) { | ||
err = _err; | ||
result = _result; | ||
} | ||
function sleep(waitMillis) { | ||
setTimeout(marionetteScriptFinished, waitMillis); | ||
} | ||
while (Date.now() < timeout) { | ||
@@ -689,10 +701,4 @@ if (err || result) { | ||
test(function(_err, _result) { | ||
err = _err; | ||
result = _result; | ||
}); | ||
this.executeAsyncScript(function(waitMillis) { | ||
setTimeout(marionetteScriptFinished, waitMillis); | ||
}, [interval]); | ||
test(done); | ||
this.executeAsyncScript(sleep, [interval]); | ||
} | ||
@@ -874,5 +880,6 @@ | ||
* @param {String|Marionette.Element} [id] iframe id or element. | ||
* If you call this function without an argument, it will switch to the top-level frame. | ||
* If you call this function without an argument, | ||
* it will switch to the top-level frame. | ||
* @param {Object} [options] options to be mixed in the command parameters. | ||
* @param {Boolean} [options.focus] If 'true', will switch the focus to the frame. | ||
* @param {Boolean} [options.focus] Should switch the focus to the frame. | ||
* @param {Function} callback called with boolean. | ||
@@ -1219,9 +1226,14 @@ * | ||
* @chainable | ||
* @param {String} script script to run. | ||
* @param {String} script to run. | ||
* @param {Array} [args] optional args for script. | ||
* @param {Function} callback will receive result of the return \ | ||
* call in the script if there is one. | ||
* @param {String} optional sandbox is a tag referring to the sandbox you | ||
* wish to use; if you specify a new tag, a new sandbox | ||
* will be created. If you use the special tag 'system', | ||
* the sandbox will be created using the system principal | ||
* which has elevated privileges. | ||
* @return {Object} self. | ||
*/ | ||
executeScript: function executeScript(script, args, callback) { | ||
executeScript: function executeScript(script, args, callback, sandbox) { | ||
if (typeof(args) === 'function') { | ||
@@ -1231,2 +1243,4 @@ callback = args; | ||
} | ||
if (typeof(sandbox) === 'undefined') | ||
sandbox = 'default'; | ||
return this._executeScript({ | ||
@@ -1236,3 +1250,4 @@ name: 'executeScript', | ||
script: script, | ||
args: args | ||
args: args, | ||
sandbox: sandbox | ||
} | ||
@@ -1322,3 +1337,5 @@ }, callback || this.defaultCallback); | ||
throw new Error( | ||
'invalid option for using: \'' + cmd.parameters.using + '\' use one of : ' + | ||
'invalid option for using: \'' + | ||
cmd.parameters.using + | ||
'\' use one of : ' + | ||
this.searchMethods.join(', ') | ||
@@ -1333,5 +1350,6 @@ ); | ||
if (result instanceof this.Element) { | ||
return self._handleCallback(callback, err, result); | ||
return self._handleCallback(callback, err, result); | ||
} | ||
var element; | ||
if (result instanceof Array) { | ||
@@ -1483,2 +1501,3 @@ element = []; | ||
* @param {String} options.args arguments for script. | ||
* @param {String} options.sandbox sandbox you wish to use | ||
* @param {Boolean} options.timeout timeout only used in 'executeJSScript'. | ||
@@ -1489,15 +1508,11 @@ * @param {Function} callback executes when script finishes. | ||
_executeScript: function _executeScript(options, callback) { | ||
var timeout = options.timeout, | ||
self = this, | ||
cmd = { | ||
name: options.name, | ||
parameters: { | ||
script: this._convertFunction(options.parameters.script), | ||
args: this._prepareArguments(options.parameters.args || []) | ||
} | ||
}; | ||
return this._sendCommand(cmd, 'value', callback); | ||
return this._sendCommand({ | ||
name: options.name, | ||
parameters: { | ||
script: this._convertFunction(options.parameters.script), | ||
args: this._prepareArguments(options.parameters.args || []), | ||
sandbox: options.parameters.sandbox | ||
} | ||
}, 'value', callback); | ||
} | ||
}; | ||
@@ -1504,0 +1519,0 @@ |
@@ -0,2 +1,4 @@ | ||
/* global Marionette */ | ||
(function(module, ns) { | ||
'use strict'; | ||
@@ -3,0 +5,0 @@ var debug = require('debug')('marionette:command-stream'); |
@@ -0,2 +1,4 @@ | ||
/* global Marionette */ | ||
(function(module, ns) { | ||
'use strict'; | ||
@@ -3,0 +5,0 @@ /** |
@@ -0,2 +1,4 @@ | ||
/* global Marionette */ | ||
(function(module, ns) { | ||
'use strict'; | ||
@@ -3,0 +5,0 @@ module.exports = { |
@@ -0,4 +1,6 @@ | ||
'use strict'; | ||
var debug = require('debug')('marionette:tcp-sync'); | ||
var wire = require('json-wire-protocol'); | ||
var debug = require('debug')('marionette:tcp-sync'); | ||
var sockittome = require('sockit-to-me'); | ||
var DEFAULT_HOST = 'localhost'; | ||
@@ -25,3 +27,3 @@ var DEFAULT_PORT = 2828; | ||
this.sockit.setPollTimeout(this.connectionTimeout + SOCKET_TIMEOUT_EXTRA); | ||
}; | ||
} | ||
@@ -49,3 +51,4 @@ TcpSync.prototype.isSync = true; | ||
TcpSync.prototype.waitForSocket = function(options, callback) { | ||
// the logic is lifted from http://dxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette/marionette.py#562 | ||
// the logic is lifted from | ||
// mozilla-central/source/testing/marionette/client/marionette/marionette.py | ||
@@ -78,3 +81,3 @@ if (typeof(options) === 'function') { | ||
sockit.close(); | ||
if (s.indexOf(":") != -1) { | ||
if (s.indexOf(':') != -1) { | ||
callback(); | ||
@@ -96,6 +99,6 @@ return; | ||
setTimeout(probeSocket.bind(self), interval); | ||
}; | ||
} | ||
probeSocket(); | ||
} | ||
}; | ||
@@ -143,3 +146,3 @@ TcpSync.prototype.connect = function(callback) { | ||
var stream = new wire.Stream(); | ||
var char, data, error; | ||
var data, error; | ||
@@ -146,0 +149,0 @@ stream.on('data', function(parsed) { |
@@ -1,10 +0,8 @@ | ||
var Abstract, CommandStream; | ||
'use strict'; | ||
var Abstract = require('./abstract'); | ||
var CommandStream = require('../../marionette/command-stream'); | ||
var debug = require('debug')('marionette:tcp'); | ||
var net = require('net'); | ||
var debug = require('debug')('marionette:tcp'), | ||
// we must reference the object not the function for mocking | ||
retrySocket = require('socket-retry-connect'); | ||
var retrySocket = require('socket-retry-connect'); | ||
Abstract = require('./abstract'); | ||
CommandStream = require('../../marionette/command-stream'); | ||
/** TCP **/ | ||
@@ -61,3 +59,2 @@ Tcp.Socket = net.Socket; | ||
Tcp.prototype._connect = function connect() { | ||
var client, self = this; | ||
var options = { | ||
@@ -72,3 +69,3 @@ port: this.port, | ||
this.socket = socket; | ||
client = this.client = new CommandStream(this.socket); | ||
this.client = new CommandStream(this.socket); | ||
this.client.on('command', this._onClientCommand.bind(this)); | ||
@@ -75,0 +72,0 @@ }.bind(this)); |
@@ -0,1 +1,2 @@ | ||
/* global Marionette */ | ||
/** | ||
@@ -5,2 +6,4 @@ @namespace | ||
(function(module, ns) { | ||
'use strict'; | ||
/** | ||
@@ -7,0 +10,0 @@ * Creates an element reference |
@@ -0,2 +1,5 @@ | ||
/* jshint -W069 */ | ||
/* global Marionette */ | ||
(function(module, ns) { | ||
'use strict'; | ||
@@ -23,3 +26,4 @@ var STATUSES = Object.freeze({ | ||
'invalid selector': 'InvalidSelector', | ||
'webdriver error': 'GenericError' | ||
'webdriver error': 'GenericError', | ||
'element not accessible': 'ElementNotAccessibleError' | ||
}); | ||
@@ -47,2 +51,3 @@ | ||
32: STATUSES['invalid selector'], | ||
56: STATUSES['element not accessible'], | ||
500: STATUSES['webdriver error'] | ||
@@ -49,0 +54,0 @@ }); |
@@ -0,2 +1,4 @@ | ||
/* global Marionette */ | ||
(function(module, ns) { | ||
'use strict'; | ||
@@ -3,0 +5,0 @@ function merge() { |
@@ -0,2 +1,4 @@ | ||
/* global Marionette */ | ||
(function(module, ns) { | ||
'use strict'; | ||
@@ -3,0 +5,0 @@ var exports = module.exports; |
(function(global, module) { | ||
'use strict'; | ||
@@ -45,3 +46,3 @@ /** | ||
set exports(val) { | ||
return paths[this.path] = val; | ||
return (paths[this.path] = val); | ||
}, | ||
@@ -93,3 +94,3 @@ | ||
*/ | ||
if (this.window) | ||
if (typeof(window) !== 'undefined') | ||
window.Marionette = Module; | ||
@@ -96,0 +97,0 @@ |
@@ -0,2 +1,4 @@ | ||
/* global Marionette */ | ||
(function(module, ns) { | ||
'use strict'; | ||
@@ -3,0 +5,0 @@ /** |
@@ -0,1 +1,2 @@ | ||
/* global Marionette */ | ||
(function(module, ns) { | ||
@@ -15,3 +16,3 @@ 'use strict'; | ||
} | ||
}; | ||
} | ||
@@ -41,3 +42,3 @@ /** | ||
} catch (e) { | ||
throw new Error("Could not parse json: '" + json + '"'); | ||
throw new Error('Could not parse json: "' + json + '"'); | ||
} | ||
@@ -44,0 +45,0 @@ |
@@ -1,3 +0,4 @@ | ||
var CommandStream = require('../marionette/command-stream'), | ||
debug = require('debug')('marionette:connection-manager'); | ||
'use strict'; | ||
var CommandStream = require('../marionette/command-stream'); | ||
var debug = require('debug')('marionette:connection-manager'); | ||
@@ -4,0 +5,0 @@ /** |
{ | ||
"name": "marionette-client", | ||
"version": "1.7.5", | ||
"version": "1.7.6", | ||
"author": "The Gaia Team <dev-gaia@lists.mozilla.org>", | ||
"description": "Marionette Javascript Client", | ||
"license": "MIT", | ||
"main": "lib/marionette/index", | ||
@@ -11,21 +10,12 @@ | ||
"debug": "~0.6", | ||
"json-wire-protocol": "~0.2.1", | ||
"socket-retry-connect": "~0.0.1", | ||
"sockit-to-me": "0.3.2" | ||
"json-wire-protocol": "*", | ||
"socket-retry-connect": "*", | ||
"sockit-to-me": "*" | ||
}, | ||
"devDependencies": { | ||
"mocha": "2.0.x", | ||
"xpcwindow": "0.4.4", | ||
"yuidocjs": "~0.3", | ||
"test-agent": "~0.12", | ||
"node-static": "~0.6", | ||
"marionette-js-runner": "1.0.x", | ||
"mozilla-download": "1.0.x", | ||
"chai": "~1.7.2" | ||
}, | ||
"scripts": { | ||
"test": "make ci" | ||
} | ||
} |
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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 3 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
312519
3
75
0
7337
204
4
5
5
+ Addedjson-wire-protocol@1.0.0(transitive)
+ Addedsockit-to-me@1.0.2(transitive)
- Removedeventemitter2@0.4.14(transitive)
- Removedjson-wire-protocol@0.2.1(transitive)
- Removedsockit-to-me@0.3.2(transitive)
Updatedjson-wire-protocol@*
Updatedsocket-retry-connect@*
Updatedsockit-to-me@*