Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
desired-capabilities
Advanced tools
utilities for parsing shorthand Selenium capabilities objects
Tools for generating Selenium browser specs from shorthand strings and objects.
npm install desired-capabilities
capabilities(str)
or capabilities.parse(str)
Parses the a string in the form:
browser(@versions)?(:platforms)?
where:
versions
can either be a single version or an inclusive numeric range in
the form start..end
.platforms
can be one or more comma-separated platform names or
shorthands, such as xp
or win7
.var caps = require('desired-capabilities');
var assert = require('assert');
assert.deepEqual(caps.parse('ie@8:xp'), {
browserName: 'internet explorer',
browserVersion: '8',
platform: 'Windows XP'
});
Consult the Sauce Labs or BrowserStack docs for a list of available browsers and platforms.
capabilities(obj)
or capabilities.expand(object)
Returns an array of variations of the provided capabilities object
for each of the browserVersion
and platform
values, using the
same logic as the string parser.
var caps = require('desired-capabilities');
var assert = require('assert');
assert.deepEqual(caps({
browserName: 'Chrome',
browserVersion: '8..9'
}), [
{
browserName: 'Chrome',
browserVersion: 8,
platform: 'any'
},
{
browserName: 'Chrome',
browserVersion: 9,
platform: 'any'
}
]);
capabilities(array)
Expands or parses all of the values in the array to produce one big list of capabilities. The values in the array may be either strings, objects, or nested arrays.
var caps = require('desired-capabilities');
var assert = require('assert');
assert.deepEqual(
caps(['phantomjs', 'ie@8..9', 'chrome@40', {
browserName: 'ff',
browserVersion: 36
}]),
[
{
browserName: 'phantomjs',
browserVersion: 'any',
platform: 'any'
},
{
browserName: 'internet explorer',
browserVersion: 8,
platform: 'any'
},
{
browserName: 'internet explorer',
browserVersion: 9,
platform: 'any'
},
{
browserName: 'chrome',
browserVersion: '40',
platform: 'any'
},
{
browserName: 'firefox',
browserVersion: '36'
platform: 'any'
},
]
);
FAQs
utilities for parsing shorthand Selenium capabilities objects
The npm package desired-capabilities receives a total of 18,846 weekly downloads. As such, desired-capabilities popularity was classified as popular.
We found that desired-capabilities demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.