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

testcafe-browser-provider-browserstack

Package Overview
Dependencies
Maintainers
4
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

testcafe-browser-provider-browserstack - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

70

lib/index.js

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

var _keys = require('babel-runtime/core-js/object/keys');
var _keys2 = _interopRequireDefault(_keys);
var _querystring = require('querystring');

@@ -38,2 +42,6 @@

var _url = require('url');
var _url2 = _interopRequireDefault(_url);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -50,2 +58,4 @@

var PROXY_AUTH_RE = /^([^:]*):(.*)$/;
var BROWSERSTACK_API_PATHS = {

@@ -76,2 +86,10 @@ browserList: {

var identity = function identity(x) {
return x;
};
var capitalize = function capitalize(str) {
return str[0].toUpperCase() + str.slice(1);
};
function delay(ms) {

@@ -83,2 +101,30 @@ return new _pinkie2.default(function (resolve) {

function copyOptions(source, destination) {
var transfromFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : identity;
(0, _keys2.default)(source).forEach(function (key) {
return source[key] && (destination[transfromFunc(key)] = source[key]);
});
}
function getProxyOptions(proxyConfig) {
try {
var _nodeUrl$parse = _url2.default.parse('http://' + proxyConfig),
hostname = _nodeUrl$parse.hostname,
port = _nodeUrl$parse.port,
auth = _nodeUrl$parse.auth;
var parsedAuth = auth.match(PROXY_AUTH_RE);
return {
host: hostname,
port: port,
user: parsedAuth && parsedAuth[1],
pass: parsedAuth && parsedAuth[2]
};
} catch (e) {
return {};
}
}
function createBrowserStackConnector(accessKey) {

@@ -89,7 +135,21 @@ return new _pinkie2.default(function (resolve, reject) {

var opts = {
'key': accessKey,
'logfile': _osFamily2.default.win ? 'NUL' : '/dev/null',
key: accessKey,
logfile: _osFamily2.default.win ? 'NUL' : '/dev/null',
forceLocal: !!process.env['BROWSERSTACK_FORCE_LOCAL'],
forceProxy: !!process.env['BROWSERSTACK_FORCE_PROXY'],
//NOTE: additional args use different format
'enable-logging-for-api': true
};
var proxyOptions = getProxyOptions(process.env['BROWSERSTACK_PROXY']);
var localProxyOptions = getProxyOptions(process.env['BROWSERSTACK_LOCAL_PROXY']);
copyOptions(proxyOptions, opts, function (key) {
return 'proxy' + capitalize(key);
});
copyOptions(localProxyOptions, opts, function (key) {
return 'local-proxy-' + key;
});
connector.start(opts, function (err) {

@@ -186,3 +246,3 @@ if (err) {

return function (_x) {
return function (_x2) {
return _ref.apply(this, arguments);

@@ -222,3 +282,3 @@ };

return function (_x2) {
return function (_x3) {
return _ref2.apply(this, arguments);

@@ -525,3 +585,3 @@ };

return function (_x3, _x4) {
return function (_x4, _x5) {
return _ref3.apply(this, arguments);

@@ -528,0 +588,0 @@ };

2

package.json
{
"name": "testcafe-browser-provider-browserstack",
"version": "1.0.0",
"version": "1.1.0",
"description": "browserstack TestCafe browser provider plugin.",

@@ -5,0 +5,0 @@ "repository": "https://github.com/DevExpress/testcafe-browser-provider-browserstack",

@@ -39,3 +39,11 @@ # testcafe-browser-provider-browserstack

## Browserstack Proxy Options
Proxy options can be passed via envrionment variables.
- `BROWSERSTACK_PROXY` - a string that specifies a proxy for the Browserstack local binary. It should have the following structure: `user:pass@proxyHostName:port`,
- `BROWERSTACK_LOCAL_PROXY` - a string that specifies a proxy for the local web server. It should have the following structure: `user:pass@proxyHostName:port`,
- `BROWSERSTACK_FORCE_PROXY` - if it's not empty, forces all traffic of Browserstack local binary to go through the proxy,
- `BROWSERSTACK_FORCE_LOCAL` - if it's not empty, forces all traffic of Browserstack local binary to go through the local machine
## Author
Developer Express Inc. (https://devexpress.com)
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