webdriverio-boneyard / gulp-webdriver

gulp-webdriver is a gulp plugin to run selenium tests with the WebdriverIO testrunner
http://webdriver.io
MIT License
76 stars 33 forks source link

Finish on error #22

Closed silvenon closed 8 years ago

silvenon commented 9 years ago

The task doesn't finish when tests fail, so gulp just waits forever.

import webdriver from 'gulp-webdriver';

gulp.src('webdriver', () => {
  return gulp.src('wdio.conf.js')
    .pipe(webdriver());
});
Robinfr commented 9 years ago

Ideally it should just log the error and not emit an error event when the tests fail. Right now this can't be used in CI since it will stop the process.

Edit: @silvenon for now you can do the following:

gulp.task('webdriver', function (done) {
    return gulp.src('wdio.conf.js')
        .pipe(webdriver())
        .on('error', function(){
            done();
        });
});

That will make the process continue.

silvenon commented 9 years ago

@Robinfr thanks, but in this case won't the process hang if it does not emit an error?

christian-bromann commented 9 years ago

is

stream.emit('error', new gutil.PluginError('gulp-webdriver', 'wdio exited with code ' + code, {
    showStack: false
}));

not the proper way to finish the gulp task with an error?

Robinfr commented 9 years ago

@matia no it won't block if there is no error.

@christian I'm not sure. All I know is that if a error is emitted in a gulp task, the execution is stopped. So I would say that it's probably not the correct way for this case.

In this case, the tests failing does not mean that the gulp task failed that's why.

The gulp task is a success as long as all the tests have been run.

christian-bromann commented 8 years ago

This got obsolete with v2.0.0