Skip to content

Commit ee71a2e

Browse files
authored
Merge pull request #853 from udarrr/main
resolved onCancel bug and polish docs
2 parents 75d2b78 + 0445c62 commit ee71a2e

File tree

4 files changed

+31
-13
lines changed

4 files changed

+31
-13
lines changed

HISTORY.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# 9.2.3 (2023-10-21)
2+
* fixed onCancel bug with got
3+
4+
# 9.2.2 (2023-08-26)
5+
* fixed splitting opts.javaArgs
6+
7+
# 9.2.1 (2023-08-26)
8+
* added checking downloaded files
9+
110
# 9.1.0 (2023-08-26)
211
* added new feature processKiller
312

docs/API.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,20 @@ Here you can find an up-to-date example of the configuration object:
2323
const selenium = require('selenium-standalone');
2424

2525
async function myFn() {
26-
await selenium.install({
26+
//result is obj with paths to binary and some info like urls to installed files { fsPaths, urls, opts }
27+
const details = await selenium.install({
2728
// check for more recent versions of selenium here:
2829
// https://selenium-release.storage.googleapis.com/index.html
2930
version: process.env.SELENIUM_VERSION || '4.9.0',
3031
baseURL: 'https://selenium-release.storage.googleapis.com',
3132
drivers: {
3233
chrome: {
3334
// check for more recent versions of chrome driver here:
34-
// https://chromedriver.storage.googleapis.com/index.html
35+
// https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing
3536
version: 'latest',
3637
arch: process.arch,
37-
baseURL: 'https://chromedriver.storage.googleapis.com'
38-
},
39-
ie: {
40-
// check for more recent versions of internet explorer driver here:
41-
// https://selenium-release.storage.googleapis.com/index.html
42-
version: '3.150.1',
43-
arch: process.arch,
44-
baseURL: 'https://selenium-release.storage.googleapis.com'
38+
baseURL: 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing'
39+
channel: 'stable', //option
4540
}
4641
}
4742
});
@@ -54,6 +49,18 @@ async function myFn() {
5449
}
5550
});
5651

52+
//or
53+
//staring drivers 'chrome' | 'firefox' | 'chromiumedge' without selenium-server
54+
const chromeDriverChildProcess = await selenium.start({
55+
onlyDriver: 'chrome'
56+
drivers: {
57+
chrome: {
58+
version: 'latest',
59+
onlyDriverArgs: [],//option
60+
},
61+
}
62+
});
63+
5764
// run tests
5865

5966
// finally kill selenium process!
@@ -86,7 +93,7 @@ arch [sometimes](https://code.google.com/p/selenium/issues/detail?id=5116#c9).
8693

8794
`opts.requestOpts` can be any valid [`got` options object](https://www.npmjs.com/package/got#proxies). You can use this for example to set a timeout.
8895

89-
`opts.onlyDriver` can be any valid 'chrome' | 'firefox' | 'chromiumedge' it allow to install any driver without selenium server
96+
`opts.onlyDriver` can be any valid 'chrome' | 'firefox' | 'chromiumedge' it allow to install any driver without selenium server, driver also can be parametrized with onlyDriverArgs, it's []
9097

9198
returns `Promise<void>`
9299

@@ -127,6 +134,8 @@ If you're getting this error, it means that you didn't shut down the server succ
127134
pkill -f selenium-standalone
128135
```
129136

137+
since 9.1.0 it's been checked and killed automatically
138+
130139
## Set `selenium-standalone` Version as NodeJS environment parameter
131140

132141
You can set any version by `process.env.SELENIUM_VERSION=3.141.59` before starting selenium-standalone. Default values are here: [lib/default-config.js](../lib/default-config.js)

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"execa": "^5.1.1",
4747
"find-process": "^1.4.7",
4848
"fkill": "^7.2.1",
49-
"got": "^11.8.2",
49+
"got": "^11.8.6",
5050
"is-port-reachable": "^3.0.0",
5151
"lodash.mapvalues": "^4.6.0",
5252
"lodash.merge": "^4.6.2",

0 commit comments

Comments
 (0)