Skip to content

Commit cad04c8

Browse files
Lukas-KullmannAndreyBelym
authored andcommitted
Add ability to set number of parallel runs (closes #27) (#28)
1 parent bfe71c3 commit cad04c8

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ lib
22
node_modules
33
.screenshots
44
.idea
5+
*.iml

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Before using this plugin, save the BrowserStack username and access key to envir
1414

1515
Project name and build name will be displayed in BrowserStack if you set the environment variables `BROWSERSTACK_PROJECT_NAME` and `BROWSERSTACK_BUILD_ID`.
1616

17+
If you have troubles starting multiple browsers at once, or get `browserstack-local` related errors like [#27](https://github.com/DevExpress/testcafe-browser-provider-browserstack/issues/27),
18+
try setting the `BROWSERSTACK_PARALLEL_RUNS` environment variable to the number of browsers you want to run simultaneously, or to 1 if you want to run just one browser.
19+
1720
You can determine the available browser aliases by running
1821
```
1922
testcafe -b browserstack

src/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,18 @@ function getProxyOptions (proxyConfig) {
7575

7676
function createBrowserStackConnector (accessKey) {
7777
return new Promise((resolve, reject) => {
78-
var connector = new BrowserstackConnector();
79-
78+
var connector = new BrowserstackConnector();
79+
var parallelRuns = process.env['BROWSERSTACK_PARALLEL_RUNS'];
80+
8081
var opts = {
8182
key: accessKey,
8283
logfile: OS.win ? 'NUL' : '/dev/null',
8384
forceLocal: !!process.env['BROWSERSTACK_FORCE_LOCAL'],
8485
forceProxy: !!process.env['BROWSERSTACK_FORCE_PROXY'],
8586
localIdentifier: Date.now(),
8687

88+
...parallelRuns ? { parallelRuns } : {},
89+
8790
//NOTE: additional args use different format
8891
'enable-logging-for-api': true
8992
};

0 commit comments

Comments
 (0)