Socket
Socket
Sign inDemoInstall

protractor

Package Overview
Dependencies
Maintainers
2
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protractor - npm Package Compare versions

Comparing version 4.0.4 to 4.0.5

.idea/jsLibraryMappings.xml

41

built/browser.js

@@ -9,2 +9,3 @@ "use strict";

var net = require('net');
var selenium_webdriver_1 = require('selenium-webdriver');
var url = require('url');

@@ -113,3 +114,4 @@ var util = require('util');

.forEach(function (method) {
if (!_this[method] && typeof webdriverInstance[method] == 'function') {
if (!_this[method] &&
typeof webdriverInstance[method] == 'function') {
if (methodsToSync.indexOf(method) !== -1) {

@@ -275,4 +277,4 @@ ptorMixin(_this, webdriverInstance, method, _this.waitForAngular.bind(_this));

if (browserErr) {
throw 'Error while waiting for Protractor to ' +
'sync with the page: ' + JSON.stringify(browserErr);
throw new Error('Error while waiting for Protractor to ' +
'sync with the page: ' + JSON.stringify(browserErr));
}

@@ -318,7 +320,7 @@ })

else {
pendingTimeoutsPromise = webdriver.promise.fulfilled({});
pendingTimeoutsPromise = selenium_webdriver_1.promise.fulfilled({});
}
var pendingHttpsPromise = _this.executeScript_(clientSideScripts.getPendingHttpRequests, 'Protractor.waitForAngular() - getting pending https' +
description, _this.rootEl);
return webdriver.promise
return selenium_webdriver_1.promise
.all([pendingTimeoutsPromise, pendingHttpsPromise])

@@ -378,3 +380,4 @@ .then(function (arr) {

ProtractorBrowser.prototype.isElementPresent = function (locatorOrElement) {
var element = (locatorOrElement.isPresent) ? locatorOrElement :
var element = (locatorOrElement.isPresent) ?
locatorOrElement :
this.element(locatorOrElement);

@@ -572,3 +575,3 @@ return element.isPresent();

}, function (err) {
throw 'Error while running testForAngular: ' + err.message;
throw new Error('Error while running testForAngular: ' + err.message);
})

@@ -592,4 +595,4 @@ .then(loadMocks, deferred.reject);

.then(null, function (err) {
throw 'Error while running module script ' + name_1 + ': ' +
err.message;
throw new Error('Error while running module script ' + name_1 + ': ' +
err.message);
})

@@ -721,2 +724,3 @@ .then(null, deferred.reject);

ProtractorBrowser.prototype.validatePortAvailability_ = function (port) {
var _this = this;
if (this.debuggerValidated_) {

@@ -740,3 +744,3 @@ return webdriver.promise.fulfilled(false);

});
return doneDeferred.then(null, function (err) {
return doneDeferred.then(function () { _this.debuggerValidated_ = true; }, function (err) {
console.error(err);

@@ -761,2 +765,3 @@ process.exit(1);

ProtractorBrowser.prototype.initDebugger_ = function (debuggerClientPath, onStartFn, opt_debugPort) {
var _this = this;
// Patch in a function to help us visualize what's going on in the control

@@ -806,6 +811,13 @@ // flow.

process.on('exit', function () { nodedebug.kill('SIGTERM'); });
nodedebug.on('message', function (m) {
nodedebug
.on('message', function (m) {
if (m === 'ready') {
debuggerReadyPromise.fulfill();
}
})
.on('exit', function () {
logger.info('Debugger exiting');
// Clear this so that we know it's ok to attach a debugger
// again.
_this.dbgCodeExecutor_ = null;
});

@@ -910,2 +922,3 @@ });

};
return pausePromise;
};

@@ -962,2 +975,6 @@ /**

ProtractorBrowser.prototype.pause = function (opt_debugPort) {
if (this.dbgCodeExecutor_) {
logger.info('Encountered browser.pause(), but debugger already attached.');
return webdriver.promise.fulfilled(true);
}
var debuggerClientPath = __dirname + '/debugger/clients/wddebugger.js';

@@ -980,3 +997,3 @@ var onStartFn = function (firstTime) {

};
this.initDebugger_(debuggerClientPath, onStartFn, opt_debugPort);
return this.initDebugger_(debuggerClientPath, onStartFn, opt_debugPort);
};

@@ -983,0 +1000,0 @@ /**

@@ -66,3 +66,3 @@ "use strict";

if (arg._.length > 1) {
throw 'Error: more than one config file specified';
throw new Error('Error: more than one config file specified');
}

@@ -69,0 +69,0 @@ });

@@ -25,2 +25,3 @@ "use strict";

multiCapabilities: [],
verboseMultiSessions: false,
rootElement: 'body',

@@ -27,0 +28,0 @@ allScriptsTimeout: 11000,

@@ -103,3 +103,3 @@ var repl = require('repl');

self.client.req({command: 'disconnect'}, function() {
// Intentionally blank.
process.exit();
});

@@ -106,0 +106,0 @@ });

@@ -7,5 +7,6 @@ "use strict";

};
var selenium_webdriver_1 = require('selenium-webdriver');
var logger_1 = require('./logger');
var webdriver = require('selenium-webdriver');
var clientSideScripts = require('./clientsidescripts');
var logger_1 = require('./logger');
var logger = new logger_1.Logger('element');

@@ -82,8 +83,9 @@ var WEB_ELEMENT_FUNCTIONS = [

var _this = this;
if (getWebElements === void 0) { getWebElements = null; }
if (actionResults_ === void 0) { actionResults_ = null; }
_super.call(this);
this.browser_ = browser_;
this.getWebElements = getWebElements;
this.locator_ = locator_;
this.actionResults_ = actionResults_;
this.getWebElements = getWebElements || null;
// TODO(juliemr): might it be easier to combine this with our docs and just

@@ -117,5 +119,4 @@ // wrap each

* using the current elements in this ElementArrayFinder as the starting
* point.
* This function returns a new ElementArrayFinder which would contain the
* children elements found (and could also be empty).
* point. This function returns a new ElementArrayFinder which would contain
* the children elements found (and could also be empty).
*

@@ -155,3 +156,4 @@ * @alias element.all(locator).all(locator)

// This is the first time we are looking for an element
return ptor.waitForAngular('Locator: ' + locator).then(function () {
return ptor.waitForAngular('Locator: ' + locator)
.then(function () {
if (locator.findElementsOverride) {

@@ -178,3 +180,3 @@ return locator.findElementsOverride(ptor.driver, null, ptor.rootEl);

// a single list
return webdriver.promise.all(childrenPromiseList)
return selenium_webdriver_1.promise.all(childrenPromiseList)
.then(function (resolved) {

@@ -192,9 +194,6 @@ return resolved.reduce(function (childrenList, resolvedE) {

* Apply a filter function to each element within the ElementArrayFinder.
* Returns
* a new ElementArrayFinder with all elements that pass the filter function.
* The
* filter function receives the ElementFinder as the first argument
* and the index as a second arg.
* This does not actually retrieve the underlying list of elements, so it can
* be used in page objects.
* Returns a new ElementArrayFinder with all elements that pass the filter
* function. The filter function receives the ElementFinder as the first
* argument and the index as a second arg. This does not actually retrieve
* the underlying list of elements, so it can be used in page objects.
*

@@ -244,4 +243,3 @@ * @alias element.all(locator).filter(filterFn)

* Get an element within the ElementArrayFinder by index. The index starts at
* 0.
* Negative indices are wrapped (i.e. -i means ith element from last)
* 0. Negative indices are wrapped (i.e. -i means ith element from last)
* This does not actually retrieve the underlying element.

@@ -277,3 +275,3 @@ *

if (i < 0 || i >= parentWebElements.length) {
throw new webdriver.error.NoSuchElementError('Index out of bound. ' +
throw new selenium_webdriver_1.error.NoSuchElementError('Index out of bound. ' +
'Trying to access element at index: ' + index +

@@ -368,3 +366,4 @@ ', but there are ' +

return this.getWebElements().then(function (arr) { return arr.length; }, function (err) {
if (err.code == new webdriver.error.NoSuchElementError()) {
if (err.code &&
err.code == new webdriver.error.NoSuchElementError()) {
return 0;

@@ -403,2 +402,4 @@ }

*/
// map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?:
// any): U[];
ElementArrayFinder.prototype.applyAction_ = function (actionFn) {

@@ -415,4 +416,4 @@ var callerError = new Error();

noSuchErr = e;
noSuchErr.stack =
noSuchErr.stack + callerError.stack;
noSuchErr.stack = noSuchErr.stack +
callerError.stack;
}

@@ -539,5 +540,5 @@ else {

// All nested arrays and objects will also be fully resolved.
return webdriver.promise.fullyResolved(mapResult);
return selenium_webdriver_1.promise.fullyResolved(mapResult);
});
return webdriver.promise.all(list);
return selenium_webdriver_1.promise.all(list);
});

@@ -579,3 +580,3 @@ };

ElementArrayFinder.prototype.reduce = function (reduceFn, initialValue) {
var valuePromise = webdriver.promise.fulfilled(initialValue);
var valuePromise = selenium_webdriver_1.promise.fulfilled(initialValue);
return this.asElementFinders_().then(function (arr) {

@@ -719,3 +720,3 @@ return arr.reduce(function (valuePromise, elementFinder, index) {

if (webElements.length === 0) {
throw new webdriver.error.NoSuchElementError('No element found using locator: ' +
throw new selenium_webdriver_1.error.NoSuchElementError('No element found using locator: ' +
elementArrayFinder.locator().toString());

@@ -737,3 +738,3 @@ }

WEB_ELEMENT_FUNCTIONS.forEach(function (fnName) {
_this[fnName] = function () {
(_this)[fnName] = function () {
var args = [];

@@ -743,3 +744,3 @@ for (var _i = 0; _i < arguments.length; _i++) {

}
return _this.elementArrayFinder_[fnName]
return (_this.elementArrayFinder_)[fnName]
.apply(_this.elementArrayFinder_, args)

@@ -751,3 +752,3 @@ .toElementFinder_();

ElementFinder.fromWebElement_ = function (browser, webElem, locator) {
var getWebElements = function () { return webdriver.promise.fulfilled([webElem]); };
var getWebElements = function () { return selenium_webdriver_1.promise.fulfilled([webElem]); };
return new ElementArrayFinder(browser, getWebElements, locator)

@@ -794,3 +795,3 @@ .toElementFinder_();

});
return new webdriver.WebElementPromise(this.browser_.driver, id);
return new selenium_webdriver_1.WebElementPromise(this.browser_.driver, id);
};

@@ -916,3 +917,3 @@ /**

*
* @returns {ElementFinder} which resolves to whether
* @returns {webdriver.promise.Promise<boolean>} which resolves to whether
* the element is present on the page.

@@ -948,4 +949,4 @@ */

* identified by the subLocator is present, rather than the current element
* finder. i.e. `element(by.css('#abc')).element(by.css('#def')).isPresent()` is
* identical to `element(by.css('#abc')).isElementPresent(by.css('#def'))`.
* finder. i.e. `element(by.css('#abc')).element(by.css('#def')).isPresent()`
* is identical to `element(by.css('#abc')).isElementPresent(by.css('#def'))`.
*

@@ -955,3 +956,3 @@ * @see ElementFinder.isPresent

* @param {webdriver.Locator} subLocator Locator for element to look for.
* @returns {ElementFinder} which resolves to whether
* @returns {webdriver.promise.Promise<boolean>} which resolves to whether
* the subelement is present on the page.

@@ -1002,3 +1003,5 @@ */

ElementFinder.prototype.equals = function (element) {
return webdriver.WebElement.equals(this.getWebElement(), element.getWebElement ? element.getWebElement() : element);
return selenium_webdriver_1.WebElement.equals(this.getWebElement(), element.getWebElement ?
element.getWebElement() :
element);
};

@@ -1005,0 +1008,0 @@ return ElementFinder;

@@ -87,3 +87,3 @@ "use strict";

var errMsg = errMsgs[errPos];
if (e.message.indexOf(errMsg) !== -1) {
if (e.message && e.message.indexOf(errMsg) !== -1) {
return true;

@@ -90,0 +90,0 @@ }

var q = require('q');
var webdriver = require('selenium-webdriver');

@@ -65,3 +66,3 @@ var RunnerReporter = function(emitter) {

require('jasminewd2');
require('jasminewd2').init(webdriver.promise.controlFlow());

@@ -68,0 +69,0 @@ var jasmineNodeOpts = runner.getConfig().jasmineNodeOpts;

@@ -30,9 +30,4 @@ var q = require('q');

// The implementation of mocha's it.only uses global.it, so since that has
// already been wrapped we must avoid wrapping it a second time.
// See Mocha.prototype.loadFiles and bdd's context.it.only for more details.
var originalOnly = global.it.only;
global.it = mochaAdapters.it;
global.it.only = global.iit = originalOnly;
global.it.only = global.iit = mochaAdapters.iit;
global.it.skip = global.xit = mochaAdapters.xit;

@@ -39,0 +34,0 @@ } catch (err) {

@@ -101,2 +101,3 @@ "use strict";

var config = configParser.getConfig();
logger_1.Logger.set(config);
logger.debug('Running with --troubleshoot');

@@ -169,3 +170,4 @@ logger.debug('Protractor version: ' + require('../package.json').version);

var scheduler = new taskScheduler_1.TaskScheduler(config);
process.on('uncaughtException', function (e) {
process.on('uncaughtException', function (exc) {
var e = (exc instanceof Error) ? exc : new Error(exc);
var errorCode = exitCodes_1.ErrorHandler.parseError(e);

@@ -172,0 +174,0 @@ if (errorCode) {

@@ -73,3 +73,7 @@ "use strict";

this[name] = function () {
var locatorArguments = arguments;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
}
var locatorArguments = args;
return {

@@ -85,3 +89,3 @@ findElementsOverride: function (driver, using, rootSelector) {

},
toString: function toString() {
toString: function () {
return 'by.' + name + '("' +

@@ -96,10 +100,8 @@ Array.prototype.join.call(locatorArguments, '", "') + '")';

* Find an element by text binding. Does a partial match, so any elements
* bound
* to variables containing the input string will be returned.
* bound to variables containing the input string will be returned.
*
* Note: For AngularJS version 1.2, the interpolation brackets, (usually
* {{}}),
* are optionally allowed in the binding description string. For Angular
* version
* 1.3+, they are not allowed, and no elements will be found if they are used.
* {{}}), are optionally allowed in the binding description string. For
* Angular version 1.3+, they are not allowed, and no elements will be found
* if they are used.
*

@@ -132,5 +134,3 @@ * @view

},
toString: function toString() {
return 'by.binding("' + bindingDescriptor + '")';
}
toString: function () { return 'by.binding("' + bindingDescriptor + '")'; }
};

@@ -163,3 +163,3 @@ };

},
toString: function toString() {
toString: function () {
return 'by.exactBinding("' + bindingDescriptor + '")';

@@ -190,3 +190,3 @@ }

},
toString: function toString() { return 'by.model("' + model + '")'; }
toString: function () { return 'by.model("' + model + '")'; }
};

@@ -212,5 +212,3 @@ };

},
toString: function toString() {
return 'by.buttonText("' + searchText + '")';
}
toString: function () { return 'by.buttonText("' + searchText + '")'; }
};

@@ -236,5 +234,3 @@ };

},
toString: function toString() {
return 'by.partialButtonText("' + searchText + '")';
}
toString: function () { return 'by.partialButtonText("' + searchText + '")'; }
};

@@ -250,5 +246,3 @@ };

},
toString: function toString() {
return name + '("' + repeatDescriptor + '")';
},
toString: function () { return name + '("' + repeatDescriptor + '")'; },
row: function (index) {

@@ -259,3 +253,3 @@ return {

},
toString: function toString() {
toString: function () {
return name + '(' + repeatDescriptor + '").row("' + index + '")"';

@@ -268,3 +262,3 @@ },

},
toString: function toString() {
toString: function () {
return name + '("' + repeatDescriptor + '").row("' + index +

@@ -282,3 +276,3 @@ '").column("' + binding + '")';

},
toString: function toString() {
toString: function () {
return name + '("' + repeatDescriptor + '").column("' + binding +

@@ -292,3 +286,3 @@ '")';

},
toString: function toString() {
toString: function () {
return name + '("' + repeatDescriptor + '").column("' +

@@ -403,3 +397,3 @@ binding + '").row("' + index + '")';

},
toString: function toString() {
toString: function () {
return 'by.cssContainingText("' + cssSelector + '", "' + searchText +

@@ -435,5 +429,3 @@ '")';

},
toString: function toString() {
return 'by.option("' + optionsDescriptor + '")';
}
toString: function () { return 'by.option("' + optionsDescriptor + '")'; }
};

@@ -440,0 +432,0 @@ };

@@ -35,5 +35,5 @@ "use strict";

/**
* Flushes the buffer to stdout.
* Prints the contents of the buffer without clearing it.
*/
TaskLogger.prototype.flush = function () {
TaskLogger.prototype.peek = function () {
if (this.buffer) {

@@ -44,2 +44,10 @@ // Flush buffer if nonempty

logger.info(os.EOL);
}
};
/**
* Flushes the buffer to stdout.
*/
TaskLogger.prototype.flush = function () {
if (this.buffer) {
this.peek();
this.buffer = '';

@@ -46,0 +54,0 @@ }

@@ -51,2 +51,12 @@ "use strict";

};
var configParser = new configParser_1.ConfigParser();
if (this.configFile) {
configParser.addFileConfig(this.configFile);
}
if (this.additionalConfig) {
configParser.addConfig(this.additionalConfig);
}
var config = configParser.getConfig();
config.capabilities = this.task.capabilities;
config.specs = this.task.specs;
if (this.runInFork) {

@@ -62,2 +72,5 @@ var deferred_1 = q.defer();

.on('message', function (m) {
if (config.verboseMultiSessions) {
taskLogger_2.peek();
}
switch (m.event) {

@@ -95,12 +108,2 @@ case 'testPass':

else {
var configParser = new configParser_1.ConfigParser();
if (this.configFile) {
configParser.addFileConfig(this.configFile);
}
if (this.additionalConfig) {
configParser.addConfig(this.additionalConfig);
}
var config = configParser.getConfig();
config.capabilities = this.task.capabilities;
config.specs = this.task.specs;
var runner = new runner_1.Runner(config);

@@ -107,0 +110,0 @@ runner.on('testsDone', function (results) {

@@ -16,7 +16,3 @@ {

"typescript": "^2.0.0"
},
"devDependencies": {
"@types/jasmine": "^2.2.31",
"@types/node": "^6.0.35"
}
}

@@ -92,2 +92,6 @@ 'use strict';

var contents = '';
contents += '/// <reference path="../../@types/node/index.d.ts" />\n';
contents += '/// <reference path="../../@types/jasmine/index.d.ts" />\n';
contents += '/// <reference path="../typings/index.d.ts" />\n';
contents += 'import {ActionSequence, By, WebDriver, WebElement, WebElementPromise, promise, promise as wdpromise, until} from \'selenium-webdriver\';\n';
files.forEach(file => {

@@ -94,0 +98,0 @@ contents += parseTypingsFile(folder, file);

@@ -15,2 +15,4 @@ {

"dependencies": {
"@types/jasmine": "^2.2.31",
"@types/node": "^6.0.35",
"adm-zip": "0.4.7",

@@ -20,3 +22,3 @@ "chalk": "^1.1.3",

"jasmine": "2.4.1",
"jasminewd2": "0.0.9",
"jasminewd2": "0.0.10",
"optimist": "~0.6.0",

@@ -32,6 +34,4 @@ "q": "1.4.1",

"@types/glob": "^5.0.29",
"@types/jasmine": "^2.2.31",
"@types/minimatch": "^2.0.28",
"@types/minimist": "^1.1.28",
"@types/node": "^6.0.35",
"@types/optimist": "0.0.28",

@@ -75,3 +75,3 @@ "@types/q": "0.0.29",

"license": "MIT",
"version": "4.0.4"
"version": "4.0.5"
}

@@ -10,3 +10,8 @@ {

"noImplicitAny": true,
"outDir": "built/"
"outDir": "built/",
"types": [
"jasmine", "node",
"chalk", "glob", "minimatch",
"minimist", "optimist", "q"
]
},

@@ -22,4 +27,5 @@ "exclude": [

"exampleTypescript",
"typings/globals",
"spec"
]
}

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

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

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

Sorry, the diff of this file is not supported yet

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