min-wd
Advanced tools
Comparing version 2.8.0 to 2.9.0
# Changes | ||
## 2.9.0 | ||
Moshe Kolodnya [made it possible][PR14] to use a different config file. He also | ||
[sent a PR][PR13] to allow the `.min-wd` file to be loaded as a node module. | ||
Thanks! | ||
[PR14]: https://github.com/mantoni/min-webdriver/pull/14 | ||
[PR13]: https://github.com/mantoni/min-webdriver/pull/13 | ||
## 2.8.0 | ||
@@ -4,0 +13,0 @@ |
@@ -12,2 +12,3 @@ /* | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
@@ -24,4 +25,10 @@ function override(options, overrides) { | ||
function loadOptions(fileName, key, options) { | ||
var overrides; | ||
if (fs.existsSync(fileName)) { | ||
var overrides = JSON.parse(fs.readFileSync(fileName, 'utf8')); | ||
try { | ||
overrides = require(path.resolve(fileName)); | ||
} catch (e) { | ||
overrides = JSON.parse(fs.readFileSync(fileName, 'utf8')); | ||
} | ||
if (key) { | ||
@@ -51,3 +58,3 @@ overrides = overrides[key]; | ||
if (!loadOptions('.min-wd', null, options)) { | ||
if (!loadOptions(opts.wdFile || '.min-wd', null, options)) { | ||
loadOptions('package.json', 'webdriver', options); | ||
@@ -54,0 +61,0 @@ } |
@@ -43,5 +43,7 @@ /* | ||
} | ||
done(); | ||
if (done) { | ||
done(); | ||
} | ||
})); | ||
}; |
{ | ||
"name": "min-wd", | ||
"version": "2.8.0", | ||
"version": "2.9.0", | ||
"description": "Minimal WebDriver that pipes stdin to browsers", | ||
@@ -15,3 +15,4 @@ "keywords": [ | ||
"az7arul <az7arul@gmail.com>", | ||
"Matheus Kautzmann <kautzmann5@gmail.com>" | ||
"Matheus Kautzmann <kautzmann5@gmail.com>", | ||
"Moshe Kolodny <kolodny.github@gmail.com>" | ||
], | ||
@@ -18,0 +19,0 @@ "homepage": "https://github.com/mantoni/min-webdriver", |
@@ -37,2 +37,20 @@ # Minimal WebDriver | ||
You can also have the `.min-wd` file be loaded as a module: | ||
``` | ||
var hostname = true ? "localhost" : "otherhost"; | ||
module.export = { | ||
"hostname": hostname, | ||
"port": 4444, | ||
"browsers": [{ | ||
"name": "internet explorer", | ||
"version": "10" | ||
}, { | ||
"name": "chrome" | ||
}] | ||
} | ||
``` | ||
Alternatively, add a `webdriver` property with the configs to your | ||
@@ -77,3 +95,4 @@ `package.json` file. | ||
See ["Supported options"](#supported-options) for additional SauceLabs specific | ||
options. | ||
options and ["SauceLabs on Travis"](sourcelabs-on-travis) on how to run | ||
min-webdriver tests on Travis. | ||
@@ -113,3 +132,4 @@ ## Loading a web page | ||
**Notice:** This option is not used if explicitly setting the `asyncPolling` option to `false`. | ||
**Notice:** This option is not used if explicitly setting the `asyncPolling` | ||
option to `false`. | ||
@@ -130,2 +150,3 @@ ## API | ||
- `wdFile` specify the location of the `.min-wd` config file. Defaults to `.min-wd`. | ||
- `sauceLabs` whether to run tests with `saucelabs`. Defaults to `false`. | ||
@@ -160,2 +181,28 @@ - `hostname` the host to connect to. Defaults to `localhost`. If `sauceLabs` is | ||
### SauceLabs on Travis | ||
Assuming you have your linter and headless tests in an npm "test" script and | ||
the SauceLabs tests in a script called "wd", then the SauceLabs builds can be | ||
used by configuring your `.travis.yml` like this: | ||
``` | ||
language: node_js | ||
node_js: | ||
- "0.12" | ||
- "4.2" | ||
env: | ||
global: | ||
- SAUCE_USERNAME=mantoni | ||
- secure: "your-secured-access-key" | ||
script: | ||
- 'npm test' | ||
- 'if [ "x$TRAVIS_NODE_VERSION" = "x4.2" ]; then npm run wd; fi' | ||
``` | ||
This will run `npm test` on Node 0.12 and 4.2 while running the "wd" script | ||
only in the node 4.2 build. See the Travis [documentation for encryption | ||
keys][TravisKeys] for details about the `secure` config. | ||
## Known issues and solutions | ||
@@ -197,9 +244,9 @@ | ||
For the time being, MS Edge currently doesn't support `asyncPolling` set to `true`. | ||
To configure edge use `{ "name": "microsoftedge" }`. For the time being, MS | ||
Edge doesn't support `asyncPolling` set to `true`. If you want to test with | ||
that browser you must set `asyncPolling` to `false`. | ||
If you want to test with that browser you must set `asyncPolling` to `false`. | ||
## Compatibility | ||
- Node 0.10 or later | ||
- Node 0.10, 0.12, 4.x, 5.x | ||
- Selenium Server 2.39 or later | ||
@@ -219,1 +266,2 @@ | ||
[mocaccino]: https://github.com/mantoni/mocaccino.js | ||
[TravisKeys]: https://docs.travis-ci.com/user/encryption-keys/ |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
25639
547
261
7