I'm running protractor tests on a connect server, since there is no built in web server as in karma. No problem with that, only karma shuts down its web server once it's done running the tests but there is no such mechanism in protractor.
I'd like to run protractor tests on a connect server and then spin up another connect server, potentially with a different configuration. So far I've managed to run another connect server on a different port but I still have the two connect servers running side by side and I'd like to close the one I used for testing.
Here is my connect config:
connect: {
test: {
options: {
port: 8001,
}
},
production: {
options: {
port: 8000,
keepalive: true,
}
}
}
and my grunt tasks:
grunt.registerTask('default', ['jshint', 'karma:unit', 'clean', 'requirejs', 'concat', 'uglify', 'connect:test', 'protractor:e2e']);
grunt.registerTask('preview-live', ['default', 'connect:production']);
I've had a look at the keepalive option, rolling my own and even grunt events but I still can't figure out how to go about this.