Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Init webdriver inside mocha setup function to avoid BrowserStack timeouts. #82

Merged
merged 1 commit into from
Jun 12, 2015

Conversation

rupl
Copy link
Contributor

@rupl rupl commented Jun 12, 2015

As mentioned in #81 (comment) this small change will save people a big debugging headache once they have more than 2 or 3 tests being initiated by mocha.

@christian-bromann
Copy link
Contributor

@rupl thanks but I don't quite understand the enhancement of this PR. Who is timing out here?

@rupl
Copy link
Contributor Author

rupl commented Jun 12, 2015

My connection to Browserstack was timing out. Nothing was going wrong with webdriverio or webdrivercss, this is mostly just me fixing a "not thinking in async" mistake :bowtie:

Say I have 4 copies like this example file. When I send all the files to mocha, it would kick off 4 connections to BrowserStack instantly. Then webdrivercss would run them one at a time, so by the time it got to the third or fourth test, the 90-second BrowserStack timeout had been passed, and the tests at the back of the line could not complete.

By using mocha's before(), the individual BrowserStack connections are only opened when the test is finally being run. It's less resource intensive on their service, and avoids timeouts.

@christian-bromann
Copy link
Contributor

Ohh now I get the point. Make sense. I hope this will get a lot easier once I hooked up WebdriverCSS with WebdriverIO v3. It will allow us to run multiple instances at the same time. Until then this is definitely the way to go. Thanks again

christian-bromann added a commit that referenced this pull request Jun 12, 2015
Init webdriver inside mocha setup function to avoid BrowserStack timeouts.
@christian-bromann christian-bromann merged commit 2619c14 into webdriverio-boneyard:master Jun 12, 2015
@rupl rupl deleted the add-examples branch June 29, 2015 11:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants