2015-11-03 292 views
0

在我按照這個問題Cucumber HTML report with Protractor將此行添加到配置文件resultJsonOutputFile: 'report.json',我可以生成report.json文件,但在運行我的測試後,此文件是空的。量角器黃瓜報告:result.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 
    } 
}; 

我做錯了或缺失我的配置?你能幫我給一份指南來生成量角器黃瓜報告嗎?非常感謝。

回答

1

更改以下代碼應解決該問題。 (刷新在IDE的文件夾,以查看report.json)

// resultJsonOutputFile: 'report.json',

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