Grunt หยุดทำงานหลังจากรันหนึ่งงานด้วย protractor webdriver-manager

ขณะนี้ฉันกำลังพยายามผูกการทดสอบไม้โปรแทรกเตอร์ E2E เข้ากับเสียงฮึดฮัด จนถึงตอนนี้ยังไม่ประสบความสำเร็จมากนัก เอกสารทั้งหมดที่ฉันสามารถหาได้บอกว่าเสียงฮึดฮัดน่าจะใช้ได้ดีกับสถานการณ์ของฉัน อย่างไรก็ตาม หลังจากรัน webdriver-manager update --standalone แล้ว เสียงฮึดฮัดจะออกโดยไม่มีข้อความแสดงข้อผิดพลาดหรือทำงานอื่นใด

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 จากนั้นหยุด ฉันเข้าใจว่าแต่ละงานควรรันตามลำดับ และไม่หยุดจนกว่าจะสิ้นสุดหรือมีข้อผิดพลาด ฉันไม่มีความคิด!


person Brian    schedule 18.08.2015    source แหล่งที่มา


คำตอบ (1)


คุณสามารถลองสร้างงานแบบกำหนดเองที่เรียกงานหลายอย่างของคุณ เช่นนี้

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

person PM1    schedule 09.10.2015