Socket
Socket
Sign inDemoInstall

min-wd

Package Overview
Dependencies
6
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.6.1 to 2.7.0

5

CHANGES.md
# Changes
## 2.7.0
- Add the option to test using synchronous polling (Matheus Kautzmann)
- Bump saucelabs version to `^1.0` (Matheus Kautzmann)
## 2.6.1

@@ -4,0 +9,0 @@

@@ -35,2 +35,8 @@ /*

window._webdriver_manualPoll = function () {
var str = logs.join('');
logs = [];
return str;
};
brout.on('out', push);

@@ -37,0 +43,0 @@ brout.on('err', push);

24

lib/driver.js

@@ -26,4 +26,12 @@ /*

function pollLogs(context, callback) {
request(context, 'POST', '/execute_async', {
script : 'window._webdriver_poll(arguments[0]);',
var endpoint = context.asyncPolling ? '/execute_async' : '/execute';
var timeout = context.asyncPolling ? 0 : context.pollingInterval;
var script;
if (context.asyncPolling) {
script = 'window._webdriver_poll(arguments[0]);';
} else {
script = 'return window._webdriver_manualPoll();';
}
request(context, 'POST', endpoint, {
script : script,
args : []

@@ -75,6 +83,10 @@ }, function (err, res) {

if (context.out.write(res.value)) {
pollLogs(context, callback);
setTimeout(function () {
pollLogs(context, callback);
}, timeout);
} else {
context.out.once('drain', function () {
pollLogs(context, callback);
setTimeout(function () {
pollLogs(context, callback);
}, timeout);
});

@@ -163,3 +175,3 @@ }

context.basePath = context.basePath + '/session/' + res.sessionId;
if (context.timeout === 0) {
if (!context.asyncPolling || context.timeout === 0) {
callback(null);

@@ -187,2 +199,4 @@ return;

url : options.url,
asyncPolling : options.asyncPolling,
pollingInterval : options.pollingInterval,
timeout : options.timeout,

@@ -189,0 +203,0 @@ basePath : '/wd/hub',

@@ -43,2 +43,4 @@ /*

}],
asyncPolling : true,
pollingInterval : 1000,
closeOnError : true,

@@ -45,0 +47,0 @@ closeOnSuccess : true

@@ -75,3 +75,3 @@ /*

if (!sessionId) {
fail(context, options, 'Received HTTP status ' + res.statucCode
fail(context, options, 'Received HTTP status ' + res.statusCode
+ ' without location header', res.headers, body, callback);

@@ -78,0 +78,0 @@ return;

{
"name": "min-wd",
"version": "2.6.1",
"version": "2.7.0",
"description": "Minimal WebDriver that pipes stdin to browsers",

@@ -14,3 +14,4 @@ "keywords": [

"Dustin Wyatt <dustin.wyatt@gmail.com>",
"az7arul <az7arul@gmail.com>"
"az7arul <az7arul@gmail.com>",
"Matheus Kautzmann <kautzmann5@gmail.com>"
],

@@ -34,3 +35,3 @@ "homepage": "https://github.com/mantoni/min-webdriver",

"resolve": "^1.0",
"saucelabs": "^0.1.1",
"saucelabs": "^1.0",
"source-mapper": "^1.0",

@@ -37,0 +38,0 @@ "through2": "^1.1"

@@ -111,2 +111,4 @@ # Minimal WebDriver

**Notice:** This option is not used if explicitly setting the `asyncPolling` option to `false`.
## API

@@ -131,2 +133,3 @@

`80` is used.
- `asyncPolling` whether to use async polling when looking for test results. Defaults to `true`.
- `timeout` if a script does not respond to log polling calls for this amount

@@ -143,2 +146,7 @@ of milliseconds, the test run is aborted. Defaults to 10 seconds.

Some options are only considered depending on the `asyncPolling` value:
- `pollingInterval` sets the time interval between test log checks. Only apply if `asyncPolling` is `false`. Defaults to 1000 milliseconds.
- `timeout` option won't apply if `asyncPolling` is set to `false` because the test log is checked manually respecting `pollingInterval`.
SauceLabs specific options that only apply if `sauceLabs` is set to `true`:

@@ -185,2 +193,8 @@

#### Usage with Microsoft Edge browser
For the time being, MS Edge currently doesn't support `asyncPolling` set to `true`.
If you want to test with that browser you must set `asyncPolling` to `false`.
## Compatibility

@@ -187,0 +201,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc