mwaylabs / generator-m-ionic

Advanced workflows and setup for building rock-solid Ionic apps
MIT License
671 stars 134 forks source link

`gulp protractor` task never returns #310

Closed yossi-shasho closed 8 years ago

yossi-shasho commented 8 years ago

after done running the tests, gulp protractor process just hangs and never return. This makes it harder to run it in CI environments.

gruppjo commented 8 years ago

Hi @yossi-shasho, thanks for bringing it up. We are aware of this. We're planning to make improvements to the whole testing workflow #307. Are you actively going to run it in CI environments? Some more perspectives than our own might be very helpful :)

yossi-shasho commented 8 years ago

@gruppjo yes, thats exactly what we're going to do - put it as one of the steps in our CI. I'd love to help you anyway i could.

gruppjo commented 8 years ago

The plugin we're currently using doesn't support this. I created an issue: https://github.com/mllrsohn/gulp-protractor/issues/94 However there's another plugin that does, but I think it doesn't handle the webdriver automatically, but I'll have to verify. https://github.com/rochejul/gulp-angular-protractor

gruppjo commented 8 years ago

They do support automatic webdriver download, but there is a different error: https://github.com/rochejul/gulp-angular-protractor/issues/8

gruppjo commented 8 years ago

This is how I ran it:

npm i --save-dev gulp-angular-protractor

In gulp/testing.js:

gulp.task('protractor-new', ['serve', 'linting'], function (done) {
  gulp
    .src(paths.protractor)
    .pipe($.angularProtractor({
      'configFile': 'protractor.conf.js',
      'debug': false,
      'autoStartStopServer': true
    }))
    .on('error', function (e) {
      console.log(e);
    })
    .on('end', function () {
      bs.exit();
      done();
    });
});

When downgrading to 0.0.6 it ran fine, but the gulp task didn't stop after execution.

@yossi-shasho can you verify?

yossi-shasho commented 8 years ago

I followed the steps, however $ gulp protractor-new never returned as well.

gruppjo commented 8 years ago

Ok, we'll just have to wait and see how this issue plays out:) mllrsohn/gulp-protractor#94 Maybe when can contribute to a solution. I'll be gone until Feb 29, so don't expect updates from me till then.

gruppjo commented 8 years ago

Hi all and @yossi-shasho,

I traced this back to an issue in browser-sync (https://github.com/BrowserSync/browser-sync/issues/1121 and https://github.com/BrowserSync/browser-sync/issues/1052) and prepared a fix. This will work with the next version.

Additionally you can replay the changes from this commit (https://github.com/mwaylabs/generator-m-ionic/commit/4797546b9456e1ccf2524c1d24fa79e14da79fce) in your project and it should also work. Given that you have browser-sync 2.13.0 installed.

yossi-shasho commented 8 years ago

awesome! when will this be released?

gruppjo commented 8 years ago

No more than two weeks I think (depending on which features will make it into 1.9.0). However it's fairly easy to produce in your current project as I mentioned above!