纽曼如何像邮递员gui一样生成json摘要

时间:2020-03-05 08:44:51

标签: node.js postman newman

我正在研究一个节点js模块,该模块运行邮递员集合并根据指定的格式(json或html)生成报告。

var reporters = ['cli'];
var reporter = {};
if(format === 'html')
{
    reporters.push('htmlextra');
    reporter['htmlextra'] = {
        export: 'reporting.html',
        showOnlyFails: true
    };
}
else if(format === 'json')
{
    reporters.push('json');
    reporter['json'] = {
        export: 'reporting.json'
    };
}
newman.run({
    collection: collection,
    reporters: reporters,
    reporter: reporter
});

当我将json指定为reporter时,newman生成的架构与Postman GUI运行器生成的架构不一样,这不是我想要的,因为我必须使用另一种使用Postman GUI格式的工具。

有记者吗?还是我必须自己写?

0 个答案:

没有答案
相关问题