'use strict';

var assert = require('assert');
var chromedriver = require('chromedriver');
var browser = require('../');

chromedriver.start();
browser.remote('http://localhost:9515/').timeout('60s').operationTimeout('20s');
after(function () {
  chromedriver.stop();
});

var getHeadingText = browser.async(function* (browser) {
  var heading = yield browser.elementByTagName('h1').text();
  return heading;
});

describe('www.example.com', function () {
  it('Has a header that reads "Example Domain"', browser(function* (browser) {
    yield browser.get('http://www.example.com');
    var heading = yield getHeadingText(browser);
    assert(heading.trim() == 'Example Domain');
  }));
});

@@ -115,16 +115,61 @@
 ../');%0A%0A
+var LOCAL = !process.env.CI;%0A%0Aif (LOCAL) %7B%0A  
 chromedr
@@ -182,16 +182,18 @@
 tart();%0A
+  
 browser.
@@ -262,15 +262,16 @@
 ut('
-20
+5
 s');%0A
+  
 afte
@@ -284,24 +284,26 @@
 tion () %7B%0A  
+ 
+ 
 chromedriver
@@ -311,19 +311,176 @@
 stop();%0A
+  
 %7D);
+%0A%7D else %7B%0A  browser.remote('ondemand.saucelabs.com', 80, 'sauce-runner', 'c71a5c75-7c28-483f-9053-56da13b40bc2').timeout('240s').operationTimeout('30s');%0A%7D
 %0A%0Avar ge
@@ -731,24 +731,56 @@
 (browser) %7B%0A
+    console.log('getting url');%0A
     yield br
@@ -812,24 +812,65 @@
 mple.com');%0A
+    console.log('getting heading text');%0A
     var head
@@ -906,16 +906,58 @@
 owser);%0A
+    console.log('checking heading text');%0A
     asse

Support CI using sauce labs