Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

marionette-client

Package Overview
Dependencies
Maintainers
5
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marionette-client - npm Package Compare versions

Comparing version 0.15.2 to 0.15.3

86

lib/marionette/client.js

@@ -624,4 +624,12 @@ (function(module, ns) {

var modifiedTest = test;
if (test.length === 0) {
// Give me a callback!
modifiedTest = function(done) {
done(null, test());
};
}
return (sync ? this.waitForSync : this.waitForAsync).call(
this, test, callback, interval, timeout);
this, modifiedTest, callback, interval, timeout);
},

@@ -639,7 +647,17 @@

waitForSync: function(test, callback, interval, timeout) {
var err, result;
while (Date.now() < timeout) {
if (test()) {
return callback(null);
if (err) {
throw err;
}
if (result) {
return callback();
}
test(function(_err, _result) {
err = _err;
result = _result;
});
this.executeAsyncScript(function(waitMillis) {

@@ -650,3 +668,3 @@ setTimeout(marionetteScriptFinished, waitMillis);

callback(new Error('timeout exceeded'));
callback(new Error('timeout exceeded!'));
},

@@ -668,22 +686,17 @@

var result, err;
try {
result = test();
} catch (e) {
err = e;
}
test(function(err, result) {
if (err || result) {
return callback(err, result);
}
if (result || err) {
return callback(err || null);
}
var next = this.waitForAsync.bind(
this,
test,
callback,
interval,
timeout
);
var next = this.waitForAsync.bind(
this,
test,
callback,
interval,
timeout
);
setTimeout(next, interval);
setTimeout(next, interval);
}.bind(this));
},

@@ -741,2 +754,15 @@

/**
* Returns the capabilities of the current session.
*
* @method sessionCapabilities
* @param {Function} [callback]
* executed with capabilities of current session.
* @return {Object} A JSON representing capabilities.
*/
sessionCapabilities: function sessionCapabilities(callback) {
var cmd = { type: 'getSessionCapabilities' };
return this._sendCommand(cmd, 'value', callback);
},
/**
* Callback will receive the id of the current window.

@@ -746,3 +772,3 @@ *

* @method getWindow
* @param {Function} callback executed with id of current window.
* @param {Function} [callback] executed with id of current window.
* @return {Object} self.

@@ -758,5 +784,5 @@ */

*
* @method getWindow
* @method getWindows
* @chainable
* @param {Function} callback executes with an array of ids.
* @param {Function} [callback] executes with an array of ids.
*/

@@ -886,4 +912,12 @@ getWindows: function getWindows(callback) {

/**
* setSearchTimeout
* Sets a timeout for the find methods.
*
* When searching for an element using either Marionette.findElement or
* Marionette.findElements, the method will continue trying to locate the
* element for up to timeout ms.
*
* This can be useful if, for example, the element you’re looking for might
* not exist immediately, because it belongs to a page which is currently
* being loaded.
*
* @method setSearchTimeout

@@ -890,0 +924,0 @@ * @chainable

{
"name": "marionette-client",
"version": "0.15.2",
"version": "0.15.3",
"main": "lib/marionette/index",

@@ -5,0 +5,0 @@ "description": "Marionette Javascript Client",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc