【问题标题】:Grunt-stubby and protractor taskGrunt-stubby 和量角器任务
【发布时间】:2023-03-14 02:16:02
【问题描述】:

我在我的项目中使用 Grunt 和 angular 和 node。对于测试,我使用 cucumber + protractor + grunt-stubby 这是我在 Gruntfile.js 中的注册任务

grunt.registerTask('test', [
    'selenium_start',
    'clean:server',    
    'ngconstant:testing',
    'concurrent:test',
    'autoprefixer',
    'connect:test',
    'karma',
    'stubby',
    'protractor',
    'selenium_stop',
  ]);

我的问题是当量角器任务运行时,stubbys 任务结束了。

【问题讨论】:

    标签: gruntjs cucumber protractor stubs stub-data-generation


    【解决方案1】:

    我的猜测 - 你需要使用 grunt-protractor-runner 和 grunt-protractor-webdriver 并告诉 grunt 和 protractor 哪个端口 stubby 正在侦听,例如:

    grunt.initConfig({
        ..
        // Grunt server settings
        connect: {
            stubby: {
                options: {
                    ..
                    port: 8001
                    .. 
                }
            }
        },
        ..
        protractor: {
            ..
            stubby: {
                options: {
                    ..
                    args: {
                         baseUrl: 'http://localhost:8001'
                    }
                    ..
                }
            }
            ..
        }
        ..
    
    });
    ..
    grunt.registerTask('test', [    
        ..,
        'karma',
        'connect:stubby',
        'stubby',
        'protractor:stubby'
    ]);
    ..
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-11
      • 1970-01-01
      • 2021-02-13
      • 2016-01-08
      • 2013-02-23
      • 2014-02-17
      相关资源
      最近更新 更多