<commit_before>var fs = require('fs');
var path = require('path');
var childProcess = require('child_process');
var selenium = require('selenium-standalone');
var webdriverio = require('webdriverio');

jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;

function gulp(task, callback) {
  return childProcess.exec([
    'node_modules/.bin/gulp',
    '--gulpfile', path.resolve(__dirname, 'fixtures', 'gulpfile.js'),
    task
  ].join(' '), callback);
}

function withSelenium(callback) {
  selenium.install(function() {
    selenium.start(function(error, seleniumProcess) {
      callback(seleniumProcess, webdriverio.remote().init());
    });
  });
}

describe('gulp-jasmine-browser', function() {
  it('can run tests via PhantomJS', function(done) {
    var gulpProcess = gulp('phantomjs', function(error, stdout, stderr) {
      expect(error).toBe(null);
      expect(stderr).toBe('');
      expect(stdout).toContain('2 specs, 1 failure');
      gulpProcess.kill('SIGKILL');
    });
    gulpProcess.on('close', done);
  });

  xit('allows running tests in a browser', function(done) {
    var gulpProcess = gulp('server');
    gulpProcess.on('close', done);
    withSelenium(function(seleniumServer, webdriver) {
      return webdriver
        .url('http://localhost:8888')
        .getText('.bar.failed', function(error, text) {<commit_msg>try disabling the phantom test only<commit_after>var fs = require('fs');
var path = require('path');
var childProcess = require('child_process');
var selenium = require('selenium-standalone');
var webdriverio = require('webdriverio');

jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;

function gulp(task, callback) {
  return childProcess.exec([
    'node_modules/.bin/gulp',
    '--gulpfile', path.resolve(__dirname, 'fixtures', 'gulpfile.js'),
    task
  ].join(' '), callback);
}

function withSelenium(callback) {
  selenium.install(function() {
    selenium.start(function(error, seleniumProcess) {
      callback(seleniumProcess, webdriverio.remote().init());
    });
  });
}

describe('gulp-jasmine-browser', function() {
  xit('can run tests via PhantomJS', function(done) {
    var gulpProcess = gulp('phantomjs', function(error, stdout, stderr) {
      expect(error).toBe(null);
      expect(stderr).toBe('');
      expect(stdout).toContain('2 specs, 1 failure');
      gulpProcess.kill('SIGKILL');
    });
    gulpProcess.on('close', done);
  });

  it('allows running tests in a browser', function(done) {
    var gulpProcess = gulp('server');
    gulpProcess.on('close', done);
    withSelenium(function(seleniumServer, webdriver) {
      return webdriver
        .url('http://localhost:8888')
        .getText('.bar.failed', function(error, text) {
{'fraction_non_alphanumeric': 0.16356877323420074, 'fraction_numerical': 0.008178438661710037, 'mean_word_length': 4.360557768924303, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3261481', 'n_tokens_mistral': 887, 'n_tokens_neox': 835, 'n_words': 165}