本文介绍了量角器-黄瓜报告:result.json为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照此问题将此行添加到配置文件 resultJsonOutputFile:'report.json',我可以生成report.json文件,但运行测试后此文件为空。

After i follow this question Cucumber HTML report with Protractor to add this line to config file resultJsonOutputFile: 'report.json', i can generate report.json file but this file is empty after i run my test.

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

---------------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
    }
};

我做错了配置吗?您能帮我指导一下为量角器黄瓜生成报告吗?非常感谢。

Am i doing wrong or missing with my config? Could you help me give a guide to generate report for protractor-cucumber? Thank so much.

推荐答案

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

Changing the following code should solve the issue. (Refresh the folder in IDE to view the report.json)

// resultJsonOutputFile:'report.json',

// resultJsonOutputFile: 'report.json',

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

这篇关于量角器-黄瓜报告:result.json为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 18:35