【问题标题】:Protractor-cucumber report: result.json is empty量角器-黄瓜报告:result.json 为空
【发布时间】:2015-11-03 09:29:56
【问题描述】:

在我按照这个问题Cucumber HTML report with Protractor 将此行添加到配置文件resultJsonOutputFile: 'report.json' 之后,我可以生成report.json 文件,但是在我运行测试后这个文件是空的。

---------------conf.js--------------

exports.config = {

    allScriptTimeout: 60000, //To set up a timeout for each test executed on Protractor
    baseUrl: 'http://localhost/wp/index.php',
    seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
    //seleniumServerJar: 'selenium-server-standalone-2.48.2.jar',
    framework: 'cucumber',
    specs: [
        'Feature/login.feature'
    ],
    capabilities: {
        browserName: 'firefox',
    },
    onPrepare   : function () {
       //driver.manage().window().setSize( width, height );
        global.driver = browser.driver;
        browser.ignoreSynchronization = true;
    },
    resultJsonOutputFile: 'report.json',
    cucumberOpts: {
        require: 'Feature/Steps/*_steps.js',
        format: 'pretty',
        defaultTimeoutInterval: 30000
    }
};

我的配置做错了吗?你能帮我提供一个为量角器黄瓜生成报告的指南吗?非常感谢。

【问题讨论】:

    标签: json cucumber protractor reporting


    【解决方案1】:

    更改以下代码应该可以解决问题。 (刷新IDE文件夹查看report.json)

    // resultJsonOutputFile: 'report.json',

    cucumberOpts: {  
        require: 'Feature/Steps/*_steps.js',  
        format: 'pretty',  
        format:'json:../report.json'  
    }   
    

    【讨论】:

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