mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-30 04:23:44 +03:00
35 lines
778 B
JavaScript
35 lines
778 B
JavaScript
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',
|
|
'/swagger.json': './demo/swagger.json'
|
|
},
|
|
}
|
|
}, done);
|
|
});
|
|
|
|
|
|
gulp.task('e2e', ['bundleProd', 'test-server'], function(done) {
|
|
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();
|
|
});
|
|
});
|