forked from rwillmer/ng2-firebase-step-by-step
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
54 lines (43 loc) · 1.15 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
var gulp = require('gulp');
var protractor = require("gulp-protractor").protractor;
var protractor_conf = require('./e2e-tests/protractor.conf');
var browserSync = require('browser-sync');
var config = {
baseDir: 'app'
};
gulp.task('default', function() {
// place code for your default task here
});
gulp.task('e2e-test', ['e2e-install'], function() {
var bs = browserSync.create();
bs.init({
server: {
baseDir: config.baseDir
},
open: false
});
gulp.src(protractor_conf.config.specs)
.pipe(protractor({
configFile: "e2e-tests/protractor.conf.js",
args: ['--baseUrl', 'http://127.0.0.1:3000']
}))
.on('error', function(e) {
throw e
})
.on('end', function () {
// Close browser sync server
bs.exit();
})
});
gulp.task('e2e-install', function() {
var exec = require('child_process').execSync;
exec('node_modules/protractor/bin/webdriver-manager update')
});
gulp.task('serve-dev', function() {
/**
* Run Browsersync with server config
*/
browserSync({
server: config.baseDir,
});
});