<commit_before>'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');
  }));
});<commit_msg>Support CI using sauce labs<commit_after>'use strict';

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

var LOCAL = !process.env.CI;

if (LOCAL) {
  chromedriver.start();
  browser.remote('http://localhost:9515/').timeout('60s').operationTimeout('5s');
  after(function () {
    chromedriver.stop();
  });
} else {
  browser.remote('ondemand.saucelabs.com', 80, 'sauce-runner', 'c71a5c75-7c28-483f-9053-56da13b40bc2').timeout('240s').operationTimeout('30s');
}

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) {
    console.log('getting url');
    yield browser.get('http://www.example.com');
    console.log('getting heading text');
    var heading = yield getHeadingText(browser);
    console.log('checking heading text');
    assert(heading.trim() == 'Example Domain');
  }));
});
{'fraction_non_alphanumeric': 0.18679458239277652, 'fraction_numerical': 0.025959367945823927, 'mean_word_length': 5.199300699300699, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2702793', 'n_tokens_mistral': 586, 'n_tokens_neox': 551, 'n_words': 112}