我試圖用咕嚕運行的Xvfb和我的量角器的測試,但是當我執行我的任務量角器-xvfb的,我有這樣的回報:步兵+量角器 - 任務「殼:xvfb的」未找到
正在運行的任務:量角器-xvfb警告:任務「量角器-xvfb」未找到 。使用--force繼續。
由於警告而中止。
我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.');
});
}
當我執行我的任務測試中,它是SUCESSFUL和我有這個回報:
運行的任務:test
正在運行「測試」任務Lorem ipsum dolor坐amet。
完成,沒有錯誤。
OBS:我用沒有咕嚕聲的量角器測試工作正常。返回:
完成了24.753秒
9測試,5個斷言,0失敗
OBS2:我下面這個例子:Running Xvfb from Grunt
我編輯了我的命令,但仍然無法正常工作。 – Rfranca
我用這個解決方案解決了我的問題http://stackoverflow.com/questions/30985531/grunt-protractor-task-shellxvfb-not-found-solved – Rfranca