I am trying to setup end to end tests using protractor and gulp. So in order to execute my tests on the CI server I will need spin off a server which serves ionic my html/js/css.
I am not entirely sure how ionic cli triggers the server, does it have some sort of task runner under the hood? If so, could I trigger it from the gulp script?
This is not the most elegant way but I believe this gets the job done.
First include child-process in your gulpfile.js
var exec = require('child_process').exec;
Create a new gulp task startServer like
gulp.task('startServer', function(){
exec('ionic serve', function (err, stdout, stderr) {});
});
Pass this new task to your default task like,
gulp.task('default', [/*'task1','task2',...,*/'startServer']);
Then simply run gulp instead of ionic serve and you're all set.
Hope that helps. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With