redoc/build/tasks/e2e.js

35 lines
776 B
JavaScript
Raw Normal View History

2016-01-15 23:34:28 +03:00
var gulp = require('gulp');
var gp = require('gulp-protractor');
var browserSync = require('browser-sync').create('bs-e2e');
gulp.task('test-server', function (done) {
browserSync.init({
open: false,
notify: false,
port: 3000,
ghostMode: false,
server: {
baseDir: './tests/e2e',
routes: {
'/dist': './dist',
2016-02-01 20:37:32 +03:00
'/swagger.yml': './demo/swagger.yml'
2016-01-15 23:34:28 +03:00
},
}
}, done);
});
2016-01-17 01:36:23 +03:00
gulp.task('e2e', ['bundleProd', 'test-server'], function(done) {
2016-01-15 23:34:28 +03:00
gulp.src(['tests/e2e/**/*.js'], { read:false })
.pipe(gp.protractor({
configFile: './protractor.conf.js'
})).on('error', function(e) {
browserSync.exit();
throw e;
done();
}).on('end', function() {
browserSync.exit();
done();
});
});