我用黄瓜和量角器工作后,我使用如何生成JSON文件执行完成
cucumber-html-reporter
我已经添加配置生成报告
var options = {
theme: 'bootstrap',
jsonFile: 'reporter/cucumber_report.json',
output: 'reporter/cucumber_report.html',
reportSuiteAsScenarios: true,
launchReport: true,
};
defineSupportCode(function({ After }) {
After((scenario)=> {
reporter.generate(options);
});
});
但我生成报告'不生成与此代码的JSON文件,我在谷歌搜索和生成JSON文件的代码应该被添加到conf.js
cucumberOpts
,但我不知道代码应该是cucumberOpts
生成的JSON文件并转换成报告。
我希望你能帮助我。
感谢您的回应我已经生成了Json文件,但现在我有这个错误'无法解析cucumberjs输出到json:'记者/ cucumber_report.json'SyntaxError:记者/ cucumber_report.json:意外的JSON输入结束'我我不确定这是什么意思,你之前有过这个错误吗? – burq24
你能分享生成JSON和JSON输出本身的代码吗? – wswebcreation