min-wd
Advanced tools
Comparing version 2.6.1 to 2.7.0
# 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); |
@@ -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 @@ |
23831
539
213
+ Addedagent-base@4.3.0(transitive)
+ Addeddebug@3.2.7(transitive)
+ Addedes6-promise@4.2.8(transitive)
+ Addedes6-promisify@5.0.0(transitive)
+ Addedhttps-proxy-agent@2.2.4(transitive)
+ Addedms@2.1.3(transitive)
+ Addedsaucelabs@1.5.0(transitive)
- Removedsaucelabs@0.1.1(transitive)
Updatedsaucelabs@^1.0