使用量angular器webdriver-manager运行一个任务后,Grunt停止

我目前正在试图将一些量angular器E2Etesting绑定到咕噜声。 到目前为止,还没有那么成功。 我所能find的所有文件都说咕噜声应该适合我的情况。 但是,在运行webdriver-manager update --standalone ,grunt退出而没有错误消息或者运行任何其他任务。

我的Gruntfile:

 'use strict'; module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), protractor: { options: { configFile: "./conf.js", // Default config file keepAlive: true, // If false, the grunt process stops when the test fails. noColor: false, // If true, protractor will not use colors in its output. args: { // Arguments passed to the command } }, all: {} // Grunt requires at least one target to run so you can simply put 'all: {}' here too. }, protractor_webdriver: { update : { options: { path:'node_modules/.bin/', command: ['webdriver-manager update --standalone'] }, }, e2eStart: { options: { keepAlive: true, path:'node_modules/.bin/', command: ['webdriver-manager start'] }, }, } }); grunt.registerTask('default', ['protractor_webdriver:update', 'protractor_webdriver:e2eStart', 'protractor:all']); grunt.loadNpmTasks('grunt-protractor-webdriver'); grunt.loadNpmTasks('grunt-protractor-runner'); }; 

因为有人可能好奇:packages.json

 { "name": "Protractor-me", "description": "Protractor-me!", "version": "0.0.1", "devDependencies": { "grunt": "^0.4.5", "grunt-protractor-runner": "~2.0.0", "grunt-protractor-webdriver": "~0.2.0", "jasmine-reporters": "^2.0.7" }, "install": {} } 

最后,grunt –verbose输出

 $ grunt --verbose Initializing Command-line options: --verbose Reading "Gruntfile.js" Gruntfile...OK Registering Gruntfile tasks. Reading package.json...OK Parsing package.json...OK Initializing config...OK Registering "grunt-protractor-webdriver" local Npm module tasks. Reading /Users/brianalbright/workspace/qa/personal/Brian/Angular/feed_editor_2/node_modules/grunt-protractor-webdriver/package.json...OK Parsing /Users/brianalbright/workspace/qa/personal/Brian/Angular/feed_editor_2/node_modules/grunt-protractor-webdriver/package.json...OK Loading "protractor_webdriver.js" tasks...OK + protractor_webdriver Registering "grunt-protractor-runner" local Npm module tasks. Reading /Users/brianalbright/workspace/qa/personal/Brian/Angular/feed_editor_2/node_modules/grunt-protractor-runner/package.json...OK Parsing /Users/brianalbright/workspace/qa/personal/Brian/Angular/feed_editor_2/node_modules/grunt-protractor-runner/package.json...OK Loading "protractor_runner.js" tasks...OK + protractor Loading "Gruntfile.js" tasks...OK + default No tasks specified, running default tasks. Running tasks: default Running "default" task Running "protractor_webdriver:update" (protractor_webdriver) task Verifying property protractor_webdriver.update exists in config...OK File: [no files] Options: path="node_modules/.bin/", command=["webdriver-manager update --standalone"], keepAlive=false Starting Selenium server >> selenium standalone is up to date. >> chromedriver is up to date. $ 

它运行webdriver-manager更新,然后停止。 这是我的理解,每个任务应该按顺序运行,而不是停止,直到它结束或错误。 我没有想法!

你可以尝试创build一个调用你的多任务的自定义任务,就像这样:

 grunt.registerTask('foo', 'My "foo" task.', function() { // Enqueue "bar" and "baz" tasks, to run after "foo" finishes, in-order. grunt.task.run('bar', 'baz'); // Or: grunt.task.run(['bar', 'baz']); }); 

http://gruntjs.com/creating-tasks#custom-tasks