How to get out of the protractor when done

When I run gulp-protractor , it performs my tests perfectly, but when this is done, it does not exit

8 specs, 0 failures
Finished in 14.874 seconds
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 passed
[14:40:57] Finished 'test:e2e' after 16 s

When done, I need to click ctrl + cto continue. Is it possible to tell the protractor to leave when finished?

+4
source share
1 answer

Check the gulp file,

Do you have a command to exit the process when tests are completed?

eg.

gulp.task('e2e', function() {
gulp.src(['foo/bar'])
    .pipe(protractor({
        configFile: 'protractor.conf.js',
        args: ['--baseUrl', baseUrl],
        keepAlive: true
    }))
    .on('end', function() {
        console.log('E2E Testing complete');
        process.exit();
    })
    .on('error', function(error) {
        console.log('E2E Tests failed');
        process.exit(1);
    });

});

key line process.exit()

+10
source

All Articles