New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

marionette-client

Package Overview
Dependencies
Maintainers
3
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.11.0 to 0.12.0-alpha

97

lib/marionette/client.js

@@ -95,3 +95,10 @@ (function(module, ns) {

*
* // alternatively there is a lazy api which test runners can use.
*
* var client = new Client(null, { lazy: true });
*
* // accepts same arguments as normal constructor calls.
* client.resetWithDriver(driver, {});
*
*
* @class Marionette.Client

@@ -103,38 +110,7 @@ * @constructor

function Client(driver, options) {
if (typeof(options) === 'undefined') {
options = {};
}
this.driver = driver;
this.defaultCallback = options.defaultCallback || false;
// when the driver is lazily added skip
if (!driver && options && options.lazy)
return;
// pick up some options from the driver
if (driver.defaultCallback && !this.defaultCallback) {
this.defaultCallback = driver.defaultCallback;
}
if (driver.isSync) {
this.isSync = driver.isSync;
}
if (!this.defaultCallback) {
this.defaultCallback = driver.defaultCallback ?
driver.defaultCallback :
function() {};
}
// create hooks
this._hooks = {};
// create the initial state for this client
this._state = {
context: 'content',
scriptTimeout: 5000,
searchTimeout: 250
};
// give the root client a scope.
this._scope = {};
for (var key in this._state) {
this._scope[key] = this._state[key];
}
this.resetWithDriver(driver, options);
}

@@ -262,2 +238,49 @@

/**
* Resets the internal state of the client.
*
* This is only safe to do when the client has no session.
*
* @param {Marionette.Drivers.Abstract} driver fully initialized driver.
* @param {Object} options options for driver.
*/
resetWithDriver: function(driver, options) {
if (typeof(options) === 'undefined') {
options = {};
}
this.driver = driver;
this.defaultCallback = options.defaultCallback || false;
// pick up some options from the driver
if (driver.defaultCallback && !this.defaultCallback) {
this.defaultCallback = driver.defaultCallback;
}
if (driver.isSync) {
this.isSync = driver.isSync;
}
if (!this.defaultCallback) {
this.defaultCallback = driver.defaultCallback ?
driver.defaultCallback :
function() {};
}
// create hooks
this._hooks = {};
// create the initial state for this client
this._state = {
context: 'content',
scriptTimeout: 5000,
searchTimeout: 250
};
// give the root client a scope.
this._scope = {};
for (var key in this._state) {
this._scope[key] = this._state[key];
}
},
/**
* Adds a plugin to the client instance.

@@ -676,2 +699,6 @@ *

this._sendCommand(cmd, 'ok', function(err, value) {
// clear state of the past session
this.session = null;
this.actor = null;
this.driver.close();

@@ -678,0 +705,0 @@ this._handleCallback(callback, err, value);

{
"name": "marionette-client",
"version": "0.11.0",
"version": "0.12.0-alpha",
"main": "lib/marionette/index",

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

Sorry, the diff of this file is too big to display

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