I'm trying to use grunt to run Xvfb and my protractor tests, but when I executed my Task protractor-xvfb, I've got this return:
Running tasks: protractor-xvfb Warning: Task "protractor-xvfb" not found. Use --force to continue.
Aborted due to warnings.
My Gruntfile.js:
module.exports = function(grunt) {
grunt.initConfig({
protractor: {
options: {
keepAlive: true,
configFile: "protractor.conf.js"
},
run: {}
},
shell: {
xvfb: {
command: 'Xvfb :99 -ac -screen 0 1600x1200x24',
options: {
async: true
}
}
},
env: {
xvfb: {
DISPLAY: ':99'
}
}
});
grunt.registerTask('protractor-xvfb',[
'shell:xvfb',
'env:xvfb',
'protractor:run',
'shell:xvfb:kill'
]);
// assim funciona
grunt.registerTask('test', 'Test task.', function() {
grunt.log.writeln('Lorem ipsum dolor sit amet.');
});
}
When I executed my Task test, it is sucessful and I've got this return:
Running tasks: test
Running "test" task Lorem ipsum dolor sit amet.
Done, without errors.
OBS: My tests with protractor without grunt is working fine. Return:
Finished in 24.753 seconds
9 tests, 5 assertions, 0 failures
OBS2: I'm following this example: Running Xvfb from Grunt