【问题标题】:Cucumber with Protractor json Report带量角器 json 报告的黄瓜
【发布时间】:2017-04-30 19:48:00
【问题描述】:

我已经实现了黄瓜量角器示例,当我添加时它工作正常

resultJsonOutputFile: 'report.json'  

生成json报告,如果所有步骤都成功则生成报告,但如果一个步骤失败则未生成报告,有没有人有任何原因导致这种情况发生?

protractor.conf 文件

   exports.config = {
      getPageTimeout: 600000,
      allScriptsTimeout: 700000,
      framework: 'custom',
      frameworkPath: require.resolve('protractor-cucumber-framework'),

      capabilities: {
        'browserName': 'chrome'
      },
      specs: [
        '/home/git/adap_gateway/src/test/features/*.feature'
      ],

      baseURL: 'http://localhost:8099/',

      cucumberOpts: {
        require: '/home/git/adap_gateway/src/test/javascript/stepDef/stepDefinitions.js',
      },
      resultJsonOutputFile: 'report.json'

    }; 

功能文件

Feature: Running Cucumber with Protractor

Scenario: Protractor and Cucumber Test
    Given I go to "http://localhost:8099/#/"
    When I add login credential 
    Then I go to scenario home page
    Then I go to scenario details page
    Then I go to edit attack tree page
    Then build attack tree

【问题讨论】:

  • 这应该不会发生,能否请您指定量角器版本?

标签: protractor cucumber


【解决方案1】:

将json输出结果放入cucumberOpts中。

试试这样的:

cucumberOpts: {
    strict: true,    
    format: 'json:reports/current/cucumber_report.json', 
    'format-options': '{"colorsEnabled": true }',
    require: [
        'features/step_definitions/*.js', 
        'features/step_definitions/shared/*.js', 
        'support/*.js'
    ],
},

【讨论】:

    猜你喜欢
    • 2014-09-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-17
    • 1970-01-01
    相关资源
    最近更新 更多