OverZealous / run-sequence

Run a series of dependent gulp tasks in order
MIT License
961 stars 56 forks source link

Task after webdriver_standalone is not running. #96

Closed Bsunny closed 7 years ago

Bsunny commented 7 years ago

I need to run following tasks one after other:

  1. Webdriver-manager update
  2. Webdriver-manager start
  3. Run my scripts

Problem: Task 1 ran --> after that Task 2 ran --> but Task 3 DID NOT ran...

On the command prompt, it stuck after this line. 23:08:49.060 INFO - Selenium Server is up and running

My gulp file has following:

var gulp = require('gulp');
var runSequence = require('run-sequence');
var protractor = require('gulp-protractor').protractor;
var webdriver_update = require('gulp-protractor').webdriver_update;
var webdriver_standalone = require('gulp-protractor').webdriver_standalone;

gulp.task('default', function (callback) {
    runSequence('webdriver_update', 'webdriver_standalone', 'run_scripts', function () {
            console.log('AABB');
            callback;
    });
});

gulp.task('webdriver_update',webdriver_update);
gulp.task('webdriver_standalone',webdriver_standalone);
gulp.task('run_scripts', function () {
    gulp.src(['./specs/LoginPage/*specs.js'])
        .pipe(protractor({
            configFile: "conf.js"
        }))
        .on('error', function(e){
            throw e
        });
});
OverZealous commented 7 years ago

It appears that your tasks aren't configured correctly for asynchronous processes. Please read the documentation.

If the tasks don't return something (promise, stream, callback), or they never complete, then run-sequence cannot determine when to start the next task.

Bsunny commented 7 years ago

It is 'webdriver_standalone' task that is not returning anything. Can you please help me to make it return, what code should I write ?

OverZealous commented 7 years ago

This is then a Gulp or webdriver issue, not run-sequence. run-sequence simply asks gulp to run the specific tasks. It listens for a task to end before starting the next. If a task never ends, then it cannot start the next one.