What is the canonical way to run the same grunt task continuously, multiple times until it fails?
I'd like to keep the question generic, but here is a specific use case:
We have a huge set of end-to-end tests written in Protractor which we run via grunt
with the help of grunt-protractor-runner
and grunt-contrib-connect
. What we'd like to do is to keep the connect
task running (the web-server serving from a dist
directory) while looping over the protractor
until it fails (or/and up to N
times). The tasks:
connect: {
test: {
options: {
base: 'dist',
port: 9001
}
},
},
protractor: {
options: {
keepAlive: true,
noColor: false
},
local: {
options: {
configFile: "test/e2e/config/local.conf.js"
}
}
},
grunt.registerTask('e2e:local', [
'connect:test',
'protractor:local'
]);
Here, we'd like to execute connect:test
once and protractor:local
multiple times.