tatsuyafw / gulp-nightwatch

gulp plugin for Nightwatch.js
MIT License
30 stars 18 forks source link

Alert completion of tests #25

Closed jcarpe closed 9 years ago

jcarpe commented 9 years ago

I'd like to be able to detect the true completion of the nightwatch testing in the browser from my gulp task, and no just the completion of the gulp task itself. For example if I run the following:

gulp.task( 'test', ['nightwatch:firefox'], function () {
  // would expect to run after completion of tests
};

gulp.task( 'nightwatch:firefox', function () {
  gulp.src( '' )
  .pipe( nightwatch( {
    configFile: 'test/nightwatch.json',
    cliArgs: [ '--reporter test/e2e-reporter.js' ]
  }));
});

I would like to have "test" executed after the completion of all actual testing in "nightwatch:firefox" and not just on completion of gulp running the task.

tatsuyafw commented 9 years ago

Hi @jcarpe .

I think the nightwatch:firefox task should return gulp.src as below.

gulp.task( 'nightwatch:firefox', function () {
  return gulp.src( '' )
  .pipe( nightwatch( {
    configFile: 'test/nightwatch.json',
    cliArgs: [ '--reporter test/e2e-reporter.js' ]
  }));
});

For more info, please also see https://github.com/gulpjs/gulp/blob/master/docs/API.md#deps

jcarpe commented 9 years ago

Well, I feel more than a little silly... Thanks!