Permalink
Browse files

Init inside mocha setup function to avoid BrowserStack timeouts.

  • Loading branch information...
1 parent 791bfb1 commit 30b97230dbcd64ed3f2c87269d69559aff219568 @rupl rupl committed Jun 12, 2015
Showing with 11 additions and 4 deletions.
  1. +11 −4 examples/webdrivercss.browserstack.with.mocha.js
@@ -52,15 +52,22 @@ var client = webdriverio.remote({
port: 80,
user: config.browserstack.user,
key: config.browserstack.key
-}).init();
-
-// Initialize webdrivercss
-webdrivercss.init(client, options.webdrivercss);
+});
// Run the test
describe('Win7 / IE9: My Component @ 1024', function () {
this.timeout(600000);
+ // If multiple tests are run by mocha, use its setup function to initialize
+ // webdriverio and webdrivercss. Otherwise, BrowserStack connections might
+ // timeout while you wait for the first few tests to run.
+ before(function(){
+ // Initialize webdriverio
+ client.init();
+ // Initialize webdrivercss
+ webdrivercss.init(client, options.webdrivercss);
+ });
+
it('should look the same', function (done) {
client
.url(options.test.url)

0 comments on commit 30b9723

Please sign in to comment.