【问题标题】:How to launch protractor instance multiple times from Grunt task如何从 Grunt 任务中多次启动量角器实例
【发布时间】:2015-07-08 06:56:39
【问题描述】:

我正在尝试从这样的繁重任务中多次启动量角器

grunt.registerTask('makeapps', 'Create Apps', function(count) {

      console.log('value of count is' + count);
      var done=this.async();

      for(var i=1 ;i <= count; i++)
      {

              grunt.initConfig({

              protractor: {
                options: {
                  configFile: "./createAppConf.js", // Default config file which includes protractor tests and other dependencies such as HTML protractor screenshot reporter
                  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
                  }

                },
                your_target: {   // Grunt requires at least one target to run so you can simply put 'all: {}' here too.
                  options: {
                    configFile: "createAppConf.js", // // Default config file which includes protractor tests and other dependencies such as HTML protractor screenshot reporter
                    args: {} // Target-specific arguments
                  }
                },
              },
             })

              grunt.loadNpmTasks('grunt-protractor-runner');
       }  

       done();

});

我这样运行任务

grunt makeapps:3 量角器

我只能启动量角器和测试一次。我无法多次启动它。谁能告诉我我做错了什么?

【问题讨论】:

    标签: gruntjs protractor


    【解决方案1】:

    您的解决方案将运行您拥有的功能在它旁边定义的量角器任务。 Grunt 更具声明性,它首先收集任务定义,然后您可以触发它们。

    使用https://github.com/sindresorhus/grunt-concurrenthttps://github.com/iammerrick/grunt-parallel 怎么样?

    【讨论】:

      猜你喜欢
      • 2023-03-14
      • 1970-01-01
      • 1970-01-01
      • 2013-02-23
      • 1970-01-01
      • 1970-01-01
      • 2015-05-22
      • 2019-08-06
      • 2018-12-21
      相关资源
      最近更新 更多